diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-13 14:43:26 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-13 14:43:26 (GMT) |
commit | 5de6b5b90e56e325d8972c4eed2ce8df2f716a76 (patch) | |
tree | 0e1f53d9cb0046ca8dee4dd0445984cf86fd27f0 /src/gui/itemviews/qitemselectionmodel.cpp | |
parent | ce1c485bea8baddbc89d35b3a0f94374205d94a3 (diff) | |
parent | 6b2cf497268037a5c127affeef3e6efd055164ec (diff) | |
download | Qt-5de6b5b90e56e325d8972c4eed2ce8df2f716a76.zip Qt-5de6b5b90e56e325d8972c4eed2ce8df2f716a76.tar.gz Qt-5de6b5b90e56e325d8972c4eed2ce8df2f716a76.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (53 commits)
removed a few warnings on wince builds
Removed double setting of _WIN32_WINNT
QTreeView: remove dead code.
doc: Clarify effect of QFont::NoFontMerging
Revert "Implement heightForWidth support for QTabWidget and QStackedLayout."
build fix for S60
Improve handling of QAction in soft key manager
Remove useless assert
qdrawhelper: fix optim in 2245641ba
QSlider and StyleSheet: fix one pixel error while drawing the SliderAddPage
accelerate QWindowsPipeWriter for bigger chunks of data
Fix antialiasing with transformed text in OpenGL2 paint engine
Fix flattening of largely scaled, thin, dashed beziers.
Increased the precision used to flatten beziers
Fix QT_NO_MOVIE
Fix compile error with QT_NO_ACTION in QtGui
Fix QT_NO_COMPLETER
Fix QT_NO_FSCOMPLETER
Fix QT_NO_FILESYSTEMMODEL
Build fix
...
Diffstat (limited to 'src/gui/itemviews/qitemselectionmodel.cpp')
-rw-r--r-- | src/gui/itemviews/qitemselectionmodel.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp index d6e68f6..f848321 100644 --- a/src/gui/itemviews/qitemselectionmodel.cpp +++ b/src/gui/itemviews/qitemselectionmodel.cpp @@ -292,6 +292,27 @@ static void indexesFromRange(const QItemSelectionRange &range, QModelIndexList & } /*! + Returns true if the selection range contains no selectable item + \since 4.7 +*/ + +bool QItemSelectionRange::isEmpty() const +{ + if (!isValid() || !model()) + return true; + + for (int column = left(); column <= right(); ++column) { + for (int row = top(); row <= bottom(); ++row) { + QModelIndex index = model()->index(row, column, parent()); + Qt::ItemFlags flags = model()->flags(index); + if ((flags & Qt::ItemIsSelectable) && (flags & Qt::ItemIsEnabled)) + return false; + } + } + return true; +} + +/*! Returns the list of model index items stored in the selection. */ |