summaryrefslogtreecommitdiffstats
path: root/src/qlistselectionmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qlistselectionmanager.cpp')
-rw-r--r--src/qlistselectionmanager.cpp11
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());