equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
745 return false; |
745 return false; |
746 } else { |
746 } else { |
747 return false; |
747 return false; |
748 } |
748 } |
749 |
749 |
750 Qt::CheckState state; |
750 Qt::CheckState state = (static_cast<Qt::CheckState>(value.toInt()) == Qt::Checked |
751 if ( flags & Qt::ItemIsTristate ) { |
|
752 state = static_cast<Qt::CheckState>( (value.toInt() + 1) % 3 ); |
|
753 } else { |
|
754 state = (static_cast<Qt::CheckState>(value.toInt()) == Qt::Checked |
|
755 ? Qt::Unchecked : Qt::Checked); |
751 ? Qt::Unchecked : Qt::Checked); |
756 } |
|
757 return model->setData(index, state, Qt::CheckStateRole); |
752 return model->setData(index, state, Qt::CheckStateRole); |
758 } |
753 } |
759 |
754 |
760 QT_END_NAMESPACE |
755 QT_END_NAMESPACE |
761 |
756 |