diff options
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/doc/src/qtwidgets-examples.qdoc | 3 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 10 | ||||
-rw-r--r-- | src/widgets/widgets/qabstractscrollarea.cpp | 8 | ||||
-rw-r--r-- | src/widgets/widgets/qabstractscrollarea_p.h | 1 | ||||
-rw-r--r-- | src/widgets/widgets/qtoolbararealayout.cpp | 7 |
5 files changed, 22 insertions, 7 deletions
diff --git a/src/widgets/doc/src/qtwidgets-examples.qdoc b/src/widgets/doc/src/qtwidgets-examples.qdoc index 985aa24749..6ca15f25e5 100644 --- a/src/widgets/doc/src/qtwidgets-examples.qdoc +++ b/src/widgets/doc/src/qtwidgets-examples.qdoc @@ -127,7 +127,8 @@ /*! \ingroup all-examples - \title Graphicsview Examples + \target Graphicsview Examples + \title Graphics View Examples \brief Using the Graphics View framework. \page examples-graphicsview.html diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index a395785650..fc7bade9f7 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5036,6 +5036,8 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP return; #endif // Q_WS_MAC + const bool asRoot = flags & DrawAsRoot; + bool onScreen = paintOnScreen(); Q_Q(QWidget); #ifndef QT_NO_GRAPHICSEFFECT @@ -5065,12 +5067,17 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP sharedPainter->restore(); } sourced->context = 0; + + // Native widgets need to be marked dirty on screen so painting will be done in correct context + // Same check as in the no effects case below. + if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow())) + backingStore->markDirtyOnScreen(rgn, q, offset); + return; } } #endif //QT_NO_GRAFFICSEFFECT - const bool asRoot = flags & DrawAsRoot; const bool alsoOnScreen = flags & DrawPaintOnScreen; const bool recursive = flags & DrawRecursive; const bool alsoInvisible = flags & DrawInvisible; @@ -5084,7 +5091,6 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP subtractOpaqueChildren(toBePainted, q->rect()); if (!toBePainted.isEmpty()) { - bool onScreen = paintOnScreen(); if (!onScreen || alsoOnScreen) { //update the "in paint event" flag if (q->testAttribute(Qt::WA_WState_InPaintEvent)) diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index d8ee923f7a..db4ff8a2b7 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -167,7 +167,7 @@ QT_BEGIN_NAMESPACE QAbstractScrollAreaPrivate::QAbstractScrollAreaPrivate() :hbar(0), vbar(0), vbarpolicy(Qt::ScrollBarAsNeeded), hbarpolicy(Qt::ScrollBarAsNeeded), - shownOnce(false), sizeAdjustPolicy(QAbstractScrollArea::AdjustIgnored), + shownOnce(false), inResize(false), sizeAdjustPolicy(QAbstractScrollArea::AdjustIgnored), viewport(0), cornerWidget(0), left(0), top(0), right(0), bottom(0), xoffset(0), yoffset(0), viewportFilter(0) #ifdef Q_WS_WIN @@ -995,8 +995,12 @@ bool QAbstractScrollArea::event(QEvent *e) d->viewport->setMouseTracking(hasMouseTracking()); break; case QEvent::Resize: + if (!d->inResize) { + d->inResize = true; d->layoutChildren(); - break; + d->inResize = false; + } + break; case QEvent::Show: if (!d->shownOnce && d->sizeAdjustPolicy == QAbstractScrollArea::AdjustToContentsOnFirstShow) { d->sizeHint = QSize(); diff --git a/src/widgets/widgets/qabstractscrollarea_p.h b/src/widgets/widgets/qabstractscrollarea_p.h index 3093c2f812..2a4b20fe81 100644 --- a/src/widgets/widgets/qabstractscrollarea_p.h +++ b/src/widgets/widgets/qabstractscrollarea_p.h @@ -76,6 +76,7 @@ public: Qt::ScrollBarPolicy vbarpolicy, hbarpolicy; bool shownOnce; + bool inResize; mutable QSize sizeHint; QAbstractScrollArea::SizeAdjustPolicy sizeAdjustPolicy; diff --git a/src/widgets/widgets/qtoolbararealayout.cpp b/src/widgets/widgets/qtoolbararealayout.cpp index 94a1148ded..04ef6a80be 100644 --- a/src/widgets/widgets/qtoolbararealayout.cpp +++ b/src/widgets/widgets/qtoolbararealayout.cpp @@ -485,9 +485,12 @@ void QToolBarAreaLayoutInfo::moveToolBar(QToolBar *toolbar, int pos) QList<int> QToolBarAreaLayoutInfo::gapIndex(const QPoint &pos, int *minDistance) const { - int p = pick(o, pos); - if (rect.contains(pos)) { + // <pos> is in QToolBarAreaLayout coordinates. + // <item.pos> is in local dockarea coordinates (see ~20 lines below) + // Since we're comparing p with item.pos, we put them in the same coordinate system. + const int p = pick(o, pos - rect.topLeft()); + for (int j = 0; j < lines.count(); ++j) { const QToolBarAreaLayoutLine &line = lines.at(j); if (line.skip()) |