diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-08-11 06:11:20 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-08-11 06:11:20 (GMT) |
commit | 21acca0629c03e6c3cfdfb23441b2b0ac6313a59 (patch) | |
tree | f66d6468c639d536f40274dd8ced1267af981a67 /src/gui/itemviews/qstyleditemdelegate.cpp | |
parent | 5b80fbad54eccfc79f38c4f24d6267834b23e742 (diff) | |
parent | 975b75bcda1570adc2aa0d0327c5445b25da1515 (diff) | |
download | Qt-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.cpp | 7 |
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); } |