summaryrefslogtreecommitdiffstats
path: root/source/l/qt/qt.QSortFilterProxyModel.reformatted.diff
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2011-04-25 13:37:00 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:45:18 +0200
commit75a4a592e5ccda30715f93563d741b83e0dcf39e (patch)
tree502f745607e77a2c4386ad38d818ddcafe81489c /source/l/qt/qt.QSortFilterProxyModel.reformatted.diff
parentb76270bf9e6dd375e495fec92140a79a79415d27 (diff)
downloadcurrent-75a4a592e5ccda30715f93563d741b83e0dcf39e.tar.gz
current-75a4a592e5ccda30715f93563d741b83e0dcf39e.tar.xz
Slackware 13.37slackware-13.37
Mon Apr 25 13:37:00 UTC 2011 Slackware 13.37 x86_64 stable is released! Thanks to everyone who pitched in on this release: the Slackware team, the folks producing upstream code, and linuxquestions.org for providing a great forum for collaboration and testing. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. As always, thanks to the Slackware community for testing, suggestions, and feedback. :-) Have fun!
Diffstat (limited to 'source/l/qt/qt.QSortFilterProxyModel.reformatted.diff')
-rw-r--r--source/l/qt/qt.QSortFilterProxyModel.reformatted.diff92
1 files changed, 92 insertions, 0 deletions
diff --git a/source/l/qt/qt.QSortFilterProxyModel.reformatted.diff b/source/l/qt/qt.QSortFilterProxyModel.reformatted.diff
new file mode 100644
index 000000000..0ab94b319
--- /dev/null
+++ b/source/l/qt/qt.QSortFilterProxyModel.reformatted.diff
@@ -0,0 +1,92 @@
+--- ./src/gui/itemviews/qsortfilterproxymodel.cpp.orig 2010-11-20 17:54:23.000000000 -0600
++++ ./src/gui/itemviews/qsortfilterproxymodel.cpp 2011-01-07 00:40:04.000000000 -0600
+@@ -782,14 +782,14 @@
+ if (orthogonal_source_to_proxy.isEmpty()) {
+ const int ortho_end = (orient == Qt::Horizontal) ? model->rowCount(source_parent) : model->columnCount(source_parent);
+
++ orthogonal_source_to_proxy.resize(ortho_end);
++
+ for (int ortho_item = 0; ortho_item < ortho_end; ++ortho_item) {
+ if ((orient == Qt::Horizontal) ? q->filterAcceptsRow(ortho_item, source_parent)
+ : q->filterAcceptsColumn(ortho_item, source_parent)) {
+ orthogonal_proxy_to_source.append(ortho_item);
+ }
+ }
+- orthogonal_source_to_proxy.resize(orthogonal_proxy_to_source.size());
+-
+ if (orient == Qt::Horizontal) {
+ // We're reacting to columnsInserted, but we've just inserted new rows. Sort them.
+ sort_source_rows(orthogonal_proxy_to_source, source_parent);
+--- ./tests/auto/qsortfilterproxymodel/qsortfilterproxymodel.pro.orig 2010-11-20 17:54:28.000000000 -0600
++++ ./tests/auto/qsortfilterproxymodel/qsortfilterproxymodel.pro 2011-01-07 00:40:04.000000000 -0600
+@@ -1,6 +1,7 @@
+ load(qttest_p4)
+
+-SOURCES += tst_qsortfilterproxymodel.cpp
+-
++INCLUDEPATH += $$PWD/../modeltest
+
++SOURCES += tst_qsortfilterproxymodel.cpp ../modeltest/dynamictreemodel.cpp ../modeltest/modeltest.cpp
++HEADERS += ../modeltest/dynamictreemodel.h ../modeltest/modeltest.h
+
+--- ./tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp.orig 2010-11-20 17:54:28.000000000 -0600
++++ ./tests/auto/qsortfilterproxymodel/tst_qsortfilterproxymodel.cpp 2011-01-07 00:41:02.000000000 -0600
+@@ -43,6 +43,9 @@
+ #include <QtTest/QtTest>
+ #include "../../shared/util.h"
+
++#include "dynamictreemodel.h"
++#include "modeltest.h"
++
+ #include <QtCore>
+ #include <QtGui>
+
+@@ -143,6 +146,7 @@
+ void taskQTBUG_10287_unnecessaryMapCreation();
+
+ void testMultipleProxiesWithSelection();
++ void filteredColumns();
+
+ protected:
+ void buildHierarchy(const QStringList &data, QAbstractItemModel *model);
+@@ -3135,5 +3139,40 @@
+ // No assert failure, it passes.
+ }
+
++class FilteredColumnProxyModel : public QSortFilterProxyModel
++{
++ Q_OBJECT
++public:
++ FilteredColumnProxyModel(QObject *parent = 0)
++ : QSortFilterProxyModel(parent)
++ {
++
++ }
++
++protected:
++ bool filterAcceptsColumn(int column, const QModelIndex &source_parent) const
++ {
++ return column % 2 != 0;
++ }
++};
++
++void tst_QSortFilterProxyModel::filteredColumns()
++{
++ DynamicTreeModel *model = new DynamicTreeModel(this);
++
++ FilteredColumnProxyModel *proxy = new FilteredColumnProxyModel(this);
++ proxy->setSourceModel(model);
++
++ new ModelTest(proxy, this);
++
++ ModelInsertCommand *insertCommand = new ModelInsertCommand(model, this);
++ insertCommand->setNumCols(2);
++ insertCommand->setStartRow(0);
++ insertCommand->setEndRow(0);
++ // Parent is QModelIndex()
++ insertCommand->doCommand();
++
++}
++
+ QTEST_MAIN(tst_QSortFilterProxyModel)
+ #include "tst_qsortfilterproxymodel.moc"