diff options
Diffstat (limited to 'tests/auto/qtreeview')
-rw-r--r-- | tests/auto/qtreeview/tst_qtreeview.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index facb982..c37a4ea 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -45,6 +45,7 @@ #include <QtTest/QtTest> #include <QtGui/QtGui> +#include <private/qabstractitemview_p.h> #include "../../shared/util.h" //TESTED_CLASS= @@ -112,6 +113,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 @@ -2947,7 +2950,7 @@ void tst_QTreeView::styleOptionViewItem() bool allCollapsed; }; - QTreeView view; + PublicView view; QStandardItemModel model; view.setModel(&model); MyDelegate delegate; @@ -3006,6 +3009,12 @@ 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) + 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); //test dynamic models { |