diff options
author | Marius Bugge Monsen <mmonsen@trolltech.com> | 2009-07-22 13:33:48 +1000 |
---|---|---|
committer | Marius Bugge Monsen <mmonsen@trolltech.com> | 2009-07-22 13:33:48 +1000 |
commit | 7b051514b67348a6d1ea628f1ccf63e8150f2cdd (patch) | |
tree | 7592ff4150ed865a5afa7825eeaca7f28fad467f | |
parent | b973371c811e5456ad7db3375c34e12bd1d50371 (diff) |
Implement the QListSelectionChange destructor.
-rw-r--r-- | src/qlistselectionmanager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/qlistselectionmanager.cpp b/src/qlistselectionmanager.cpp index c54e309..43d68a9 100644 --- a/src/qlistselectionmanager.cpp +++ b/src/qlistselectionmanager.cpp @@ -141,6 +141,10 @@ QtListSelectionChange::QtListSelectionChange(const QtListSelectionChange &other) { } +QtListSelectionChange::~QtListSelectionChange() +{ +} + int QtListSelectionChange::index() const { return d->from(); @@ -166,6 +170,7 @@ QtListSelectionManagerPrivate::QtListSelectionManagerPrivate() active(false), mode(QtListSelectionManager::Select) { + qRegisterMetaType<QtListSelectionChange>(); } QtListSelectionManagerPrivate::~QtListSelectionManagerPrivate() @@ -493,8 +498,12 @@ void QtListSelectionManager::setSelected(int index, int count, SelectionMode mod count += index; index = 0; } - if (count <= 0 || index >= d->selections.count()) + if (count <= 0) return; + if (index + count > d->selections.count()) { // ### FIXME + qWarning() << "QtListSelectionManager::setSelected selecting non-existing items"; + d->selections.resize(index + count); + } const int from = index; count = qMin(count, d->selections.count()); // this helps the usecase where count passed is INT_MAX const int to = qMin(index + count, d->selections.count()); |