src/gui/kernel/qwidget_p.h
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
   108 class QGraphicsProxyWidget;
   108 class QGraphicsProxyWidget;
   109 class QWidgetItemV2;
   109 class QWidgetItemV2;
   110 
   110 
   111 class QStyle;
   111 class QStyle;
   112 
   112 
   113 class Q_AUTOTEST_EXPORT QRefCountedWidgetBackingStore
   113 class Q_AUTOTEST_EXPORT QWidgetBackingStoreTracker
   114 {
   114 {
   115 
   115 
   116 public:
   116 public:
   117     QRefCountedWidgetBackingStore();
   117     QWidgetBackingStoreTracker();
   118     ~QRefCountedWidgetBackingStore();
   118     ~QWidgetBackingStoreTracker();
   119 
   119 
   120     void create(QWidget *tlw);
   120     void create(QWidget *tlw);
   121     void destroy();
   121     void destroy();
   122 
   122 
   123     void widgetShown(QWidget *w);
   123     void registerWidget(QWidget *w);
   124     void widgetHidden(QWidget *w);
   124     void unregisterWidget(QWidget *w);
   125 
   125 
   126     inline QWidgetBackingStore* data()
   126     inline QWidgetBackingStore* data()
   127     {
   127     {
   128         return m_ptr;
   128         return m_ptr;
   129     }
   129     }
   142     {
   142     {
   143         return (0 != m_ptr);
   143         return (0 != m_ptr);
   144     }
   144     }
   145 
   145 
   146 private:
   146 private:
   147     Q_DISABLE_COPY(QRefCountedWidgetBackingStore)
   147     Q_DISABLE_COPY(QWidgetBackingStoreTracker)
   148 
   148 
   149 private:
   149 private:
   150     QWidgetBackingStore* m_ptr;
   150     QWidgetBackingStore* m_ptr;
   151     QSet<QWidget *> m_visibleWidgets;
   151     QSet<QWidget *> m_widgets;
   152 };
   152 };
   153 
   153 
   154 struct QTLWExtra {
   154 struct QTLWExtra {
   155     // *************************** Cross-platform variables *****************************
   155     // *************************** Cross-platform variables *****************************
   156 
   156 
   157     // Regular pointers (keep them together to avoid gaps on 64 bits architectures).
   157     // Regular pointers (keep them together to avoid gaps on 64 bits architectures).
   158     QIcon *icon; // widget icon
   158     QIcon *icon; // widget icon
   159     QPixmap *iconPixmap;
   159     QPixmap *iconPixmap;
   160     QRefCountedWidgetBackingStore backingStore;
   160     QWidgetBackingStoreTracker backingStore;
   161     QWindowSurface *windowSurface;
   161     QWindowSurface *windowSurface;
   162     QPainter *sharedPainter;
   162     QPainter *sharedPainter;
   163 
   163 
   164     // Implicit pointers (shared_null).
   164     // Implicit pointers (shared_null).
   165     QString caption; // widget caption
   165     QString caption; // widget caption