summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qstyleditemdelegate.cpp
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2009-08-11 06:11:20 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2009-08-11 06:11:20 (GMT)
commit21acca0629c03e6c3cfdfb23441b2b0ac6313a59 (patch)
treef66d6468c639d536f40274dd8ced1267af981a67 /src/gui/itemviews/qstyleditemdelegate.cpp
parent5b80fbad54eccfc79f38c4f24d6267834b23e742 (diff)
parent975b75bcda1570adc2aa0d0327c5445b25da1515 (diff)
downloadQt-21acca0629c03e6c3cfdfb23441b2b0ac6313a59.zip
Qt-21acca0629c03e6c3cfdfb23441b2b0ac6313a59.tar.gz
Qt-21acca0629c03e6c3cfdfb23441b2b0ac6313a59.tar.bz2
Merge branch 'master' of git@scm.dev.troll.no:qt/qt-s60-public
Diffstat (limited to 'src/gui/itemviews/qstyleditemdelegate.cpp')
-rw-r--r--src/gui/itemviews/qstyleditemdelegate.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/itemviews/qstyleditemdelegate.cpp b/src/gui/itemviews/qstyleditemdelegate.cpp
index f64a8ea..c739812 100644
--- a/src/gui/itemviews/qstyleditemdelegate.cpp
+++ b/src/gui/itemviews/qstyleditemdelegate.cpp
@@ -746,8 +746,13 @@ bool QStyledItemDelegate::editorEvent(QEvent *event,
return false;
}
- Qt::CheckState state = (static_cast<Qt::CheckState>(value.toInt()) == Qt::Checked
+ Qt::CheckState state;
+ if ( flags & Qt::ItemIsTristate ) {
+ state = static_cast<Qt::CheckState>( (value.toInt() + 1) % 3 );
+ } else {
+ state = (static_cast<Qt::CheckState>(value.toInt()) == Qt::Checked
? Qt::Unchecked : Qt::Checked);
+ }
return model->setData(index, state, Qt::CheckStateRole);
}