Changeset 561 for trunk/src/gui/graphicsview/qgraphicswidget_p.h
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/graphicsview/qgraphicswidget_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 48 48 // 49 49 // This file is not part of the Qt API. It exists for the convenience 50 // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header51 // file may change from version toversion without notice, or even be removed.50 // of 51 // version without notice, or even be removed. 52 52 // 53 53 // We mean it. … … 69 69 #if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW 70 70 71 class Q _GUI_EXPORT QGraphicsWidgetPrivate : public QGraphicsItemPrivate71 class QGraphicsWidgetPrivate : public QGraphicsItemPrivate 72 72 { 73 73 Q_DECLARE_PUBLIC(QGraphicsWidget) 74 74 public: 75 75 QGraphicsWidgetPrivate() 76 : leftMargin(0), 77 topMargin(0), 78 rightMargin(0), 79 bottomMargin(0), 80 leftLayoutItemMargin(0), 81 topLayoutItemMargin(0), 82 rightLayoutItemMargin(0), 83 bottomLayoutItemMargin(0), 76 : margins(0), 84 77 layout(0), 85 78 inheritedPaletteResolveMask(0), … … 91 84 focusNext(0), 92 85 focusPrev(0), 93 focusChild(0),94 86 windowFlags(0), 95 hoveredSubControl(QStyle::SC_None), 96 grabbedSection(Qt::NoSection), 97 buttonMouseOver(false), 98 buttonSunken(false), 87 windowData(0), 99 88 setWindowFrameMargins(false), 100 leftWindowFrameMargin(0), 101 topWindowFrameMargin(0), 102 rightWindowFrameMargin(0), 103 bottomWindowFrameMargin(0) 89 windowFrameMargins(0) 104 90 { } 91 105 92 106 93 void init(QGraphicsItem *parentItem, Qt::WindowFlags wFlags); … … 108 95 109 96 // Margins 110 qreal leftMargin; 111 qreal topMargin; 112 qreal rightMargin; 113 qreal bottomMargin; 114 QRectF contentsRect; 115 116 // Layout item margins 117 void getLayoutItemMargins(qreal *left, qreal *top, qreal *right, qreal *bottom) const; 118 void setLayoutItemMargins(qreal left, qreal top, qreal right, qreal bottom); 119 void setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt = 0); 120 121 void fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *newScene = 0); 97 enum {Left, Top, Right, Bottom}; 98 mutable qreal *margins; 99 void ensureMargins() const; 100 101 void fixFocusChainBeforeReparenting(QGraphicsWidget *newParent, QGraphicsScene *oldScene, QGraphicsScene *newScene = 0); 122 102 void setLayout_helper(QGraphicsLayout *l); 123 124 qreal leftLayoutItemMargin;125 qreal topLayoutItemMargin;126 qreal rightLayoutItemMargin;127 qreal bottomLayoutItemMargin;128 103 129 104 // Layouts … … 203 178 QGraphicsWidget *focusNext; 204 179 QGraphicsWidget *focusPrev; 205 QGraphicsWidget *focusChild;206 void setFocusWidget();207 void clearFocusWidget();208 180 209 181 // Windows 210 182 Qt::WindowFlags windowFlags; 211 QString windowTitle; 212 QStyle::SubControl hoveredSubControl; 213 Qt::WindowFrameSection grabbedSection; 214 uint buttonMouseOver : 1; 215 uint buttonSunken : 1; 216 QPointF mouseDelta; // to compensate for small error when interactively resizing 217 QRectF startGeometry; 218 QRect buttonRect; 183 struct WindowData { 184 QString windowTitle; 185 QStyle::SubControl hoveredSubControl; 186 Qt::WindowFrameSection grabbedSection; 187 uint buttonMouseOver : 1; 188 uint buttonSunken : 1; 189 QRectF startGeometry; 190 QRect buttonRect; 191 WindowData() 192 : hoveredSubControl(QStyle::SC_None) 193 , grabbedSection(Qt::NoSection) 194 , buttonMouseOver(false) 195 , buttonSunken(false) 196 {} 197 } *windowData; 198 void ensureWindowData(); 219 199 220 200 bool setWindowFrameMargins; 221 qreal leftWindowFrameMargin; 222 qreal topWindowFrameMargin; 223 qreal rightWindowFrameMargin; 224 qreal bottomWindowFrameMargin; 201 mutable qreal *windowFrameMargins; 202 void ensureWindowFrameMargins() const; 225 203 226 204 #ifndef QT_NO_ACTION
Note:
See TracChangeset
for help on using the changeset viewer.