summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qlistview.cpp
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-07-13 16:34:32 -0700
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2017-07-13 16:36:10 -0700
commitd38fe875c7850ca2c6ca28f91e94ae276735fac8 (patch)
treee5c92cef74e0853490d77cf0139b23f00d548a6e /src/widgets/itemviews/qlistview.cpp
parentac4e848c9802377b7c4ff673180f28b9ca76b746 (diff)
parent627f0a7f7d775ecd263b95dd07fca44bfcb0c5cf (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: src/widgets/widgets/qmainwindowlayout.cpp Change-Id: I306b4f5ad11bceb336c9091241b468d455fe6bb6
Diffstat (limited to 'src/widgets/itemviews/qlistview.cpp')
-rw-r--r--src/widgets/itemviews/qlistview.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index bc0ca7dc1c..e234bae4dd 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -50,7 +50,9 @@
#include <qstyle.h>
#include <qevent.h>
#include <qscrollbar.h>
+#if QT_CONFIG(rubberband)
#include <qrubberband.h>
+#endif
#include <private/qlistview_p.h>
#include <private/qscrollbar_p.h>
#include <qdebug.h>
@@ -1042,7 +1044,7 @@ void QListView::paintEvent(QPaintEvent *e)
d->commonListView->paintDragDrop(&painter);
#endif
-#ifndef QT_NO_RUBBERBAND
+#if QT_CONFIG(rubberband)
// #### move this implementation into a dynamic class
if (d->showElasticBand && d->elasticBand.isValid()) {
QStyleOptionRubberBand opt;
@@ -1870,6 +1872,11 @@ void QCommonListViewBase::paintDragDrop(QPainter *painter)
}
#endif
+QSize QListModeViewBase::viewportSize(const QAbstractItemView *v)
+{
+ return v->contentsRect().marginsRemoved(v->viewportMargins()).size();
+}
+
void QCommonListViewBase::updateHorizontalScrollBar(const QSize &step)
{
horizontalScrollBar()->d_func()->itemviewChangeSingleStep(step.width() + spacing());
@@ -1882,7 +1889,7 @@ void QCommonListViewBase::updateHorizontalScrollBar(const QSize &step)
const bool bothScrollBarsAuto = qq->verticalScrollBarPolicy() == Qt::ScrollBarAsNeeded &&
qq->horizontalScrollBarPolicy() == Qt::ScrollBarAsNeeded;
- const QSize viewportSize = qq->contentsRect().size();
+ const QSize viewportSize = QListModeViewBase::viewportSize(qq);
bool verticalWantsToShow = contentsSize.height() > viewportSize.height();
bool horizontalWantsToShow;
@@ -1912,7 +1919,7 @@ void QCommonListViewBase::updateVerticalScrollBar(const QSize &step)
const bool bothScrollBarsAuto = qq->verticalScrollBarPolicy() == Qt::ScrollBarAsNeeded &&
qq->horizontalScrollBarPolicy() == Qt::ScrollBarAsNeeded;
- const QSize viewportSize = qq->contentsRect().size();
+ const QSize viewportSize = QListModeViewBase::viewportSize(qq);
bool horizontalWantsToShow = contentsSize.width() > viewportSize.width();
bool verticalWantsToShow;