summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp')
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index d2463bfad1..380683a99e 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -43,6 +43,7 @@
#include <QtTest/QtTest>
#include <QtGui/QtGui>
#include <QtWidgets/QtWidgets>
+#include <private/qabstractitemview_p.h>
Q_DECLARE_METATYPE(QModelIndex)
#ifndef QT_NO_DRAGANDDROP
@@ -106,6 +107,8 @@ struct PublicView : public QTreeView
inline QStyleOptionViewItem viewOptions() const { return QTreeView::viewOptions(); }
inline int sizeHintForColumn(int column) const { return QTreeView::sizeHintForColumn(column); }
+ inline void startDrag(Qt::DropActions supportedActions) { QTreeView::startDrag(supportedActions); }
+ QAbstractItemViewPrivate* aiv_priv() { return static_cast<QAbstractItemViewPrivate*>(d_ptr.data()); }
};
class tst_QTreeView : public QObject
@@ -2933,7 +2936,7 @@ void tst_QTreeView::styleOptionViewItem()
bool allCollapsed;
};
- QTreeView view;
+ PublicView view;
QStandardItemModel model;
view.setModel(&model);
MyDelegate delegate;
@@ -2992,6 +2995,14 @@ void tst_QTreeView::styleOptionViewItem()
QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 4);
+ // test that the rendering of drag pixmap sets the correct options too (QTBUG-15834)
+#ifdef QT_BUILD_INTERNAL
+ delegate.count = 0;
+ QItemSelection sel(model.index(0,0), model.index(0,3));
+ QRect rect;
+ view.aiv_priv()->renderToPixmap(sel.indexes(), &rect);
+ QTRY_VERIFY(delegate.count >= 4);
+#endif
//test dynamic models
{