Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.3.1
-
None
-
288365 289593
Description
QItemSelectionModel::selectedRows() doesn't respect Qt::ItemIsSelectable. Consider the following example:
#include <QtDebug>
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTreeWidget w;
for(int i=0; i < 10; ++i)
{
QTreeWidgetItem *item = new QTreeWidgetItem;
if(i&1)
else
item->setText(0,QString::number);
w.insertTopLevelItem(i, item);
}
w.setSelectionMode(QAbstractItemView::ExtendedSelection);
w.show();
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
a.exec();
qDebug() << w.selectionModel()->selectedIndexes().size();
qDebug() << w.selectionModel()->selectedRows().size();
return 1;
}