diff options
Diffstat (limited to 'src/widgets/kernel/qwidget_p.h')
-rw-r--r-- | src/widgets/kernel/qwidget_p.h | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 15704f32c9..a9c73c6a26 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -73,19 +73,20 @@ #include "QtWidgets/qgraphicsview.h" #endif #include <private/qgesture_p.h> +#include <qpa/qplatformbackingstore.h> QT_BEGIN_NAMESPACE // Extra QWidget data // - to minimize memory usage for members that are seldom used. // - top-level widgets have extra extra data to reduce cost further +class QWidgetWindow; class QPaintEngine; class QPixmap; class QWidgetBackingStore; class QGraphicsProxyWidget; class QWidgetItemV2; class QOpenGLContext; -class QPlatformTextureList; class QStyle; @@ -164,7 +165,7 @@ struct QTLWExtra { QWidgetBackingStoreTracker backingStoreTracker; QBackingStore *backingStore; QPainter *sharedPainter; - QWindow *window; + QWidgetWindow *window; QOpenGLContext *shareContext; // Implicit pointers (shared_null). @@ -342,6 +343,7 @@ public: QPainter *sharedPainter() const; void setSharedPainter(QPainter *painter); QWidgetBackingStore *maybeBackingStore() const; + QWidgetWindow *windowHandle() const; template <typename T> void repaint(T t); @@ -374,6 +376,7 @@ public: void lower_sys(); void stackUnder_sys(QWidget *); + QWidget *deepestFocusProxy() const; void setFocus_sys(); void updateFocusChild(); @@ -420,7 +423,7 @@ public: QRect clipRect() const; QRegion clipRegion() const; - void setSystemClip(QPaintDevice *paintDevice, const QRegion ®ion); + void setSystemClip(QPaintEngine *paintEngine, qreal devicePixelRatio, const QRegion ®ion); void subtractOpaqueChildren(QRegion &rgn, const QRect &clipRect) const; void subtractOpaqueSiblings(QRegion &source, bool *hasDirtySiblingsAbove = 0, bool alsoNonOpaque = false) const; @@ -644,6 +647,12 @@ public: #ifndef QT_NO_OPENGL virtual GLuint textureId() const { return 0; } + virtual QPlatformTextureList::Flags textureListFlags() { + Q_Q(QWidget); + return q->testAttribute(Qt::WA_AlwaysStackOnTop) + ? QPlatformTextureList::StacksOnTop + : QPlatformTextureList::Flags(0); + } virtual QImage grabFramebuffer() { return QImage(); } virtual void beginBackingStorePainting() { } virtual void endBackingStorePainting() { } @@ -904,26 +913,26 @@ public: : QGraphicsEffectSourcePrivate(), m_widget(widget), context(0), updateDueToGraphicsEffect(false) {} - void detach() Q_DECL_OVERRIDE + void detach() override { m_widget->d_func()->graphicsEffect = 0; } - const QGraphicsItem *graphicsItem() const Q_DECL_OVERRIDE + const QGraphicsItem *graphicsItem() const override { return 0; } - const QWidget *widget() const Q_DECL_OVERRIDE + const QWidget *widget() const override { return m_widget; } - void update() Q_DECL_OVERRIDE + void update() override { updateDueToGraphicsEffect = true; m_widget->update(); updateDueToGraphicsEffect = false; } - bool isPixmap() const Q_DECL_OVERRIDE + bool isPixmap() const override { return false; } - void effectBoundingRectChanged() Q_DECL_OVERRIDE + void effectBoundingRectChanged() override { // ### This function should take a rect parameter; then we can avoid // updating too much on the parent widget. @@ -933,16 +942,16 @@ public: update(); } - const QStyleOption *styleOption() const Q_DECL_OVERRIDE + const QStyleOption *styleOption() const override { return 0; } - QRect deviceRect() const Q_DECL_OVERRIDE + QRect deviceRect() const override { return m_widget->window()->rect(); } - QRectF boundingRect(Qt::CoordinateSystem system) const Q_DECL_OVERRIDE; - void draw(QPainter *p) Q_DECL_OVERRIDE; + QRectF boundingRect(Qt::CoordinateSystem system) const override; + void draw(QPainter *p) override; QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset, - QGraphicsEffect::PixmapPadMode mode) const Q_DECL_OVERRIDE; + QGraphicsEffect::PixmapPadMode mode) const override; QWidget *m_widget; QWidgetPaintContext *context; @@ -995,6 +1004,13 @@ inline QWidgetBackingStore *QWidgetPrivate::maybeBackingStore() const return x ? x->backingStoreTracker.data() : 0; } +inline QWidgetWindow *QWidgetPrivate::windowHandle() const +{ + if (QTLWExtra *x = maybeTopData()) + return x->window; + return nullptr; +} + QT_END_NAMESPACE #endif // QWIDGET_P_H |