Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/graphicsview/qgraphicswidget_p.h

    r2 r561  
    22**
    33** 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])
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4848//
    4949// This file is not part of the Qt API.  It exists for the convenience
    50 // of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp.  This header
    51 // file may change from version to version without notice, or even be removed.
     50// of
     51// version without notice, or even be removed.
    5252//
    5353// We mean it.
     
    6969#if !defined(QT_NO_GRAPHICSVIEW) || (QT_EDITION & QT_MODULE_GRAPHICSVIEW) != QT_MODULE_GRAPHICSVIEW
    7070
    71 class Q_GUI_EXPORT QGraphicsWidgetPrivate : public QGraphicsItemPrivate
     71class QGraphicsWidgetPrivate : public QGraphicsItemPrivate
    7272{
    7373    Q_DECLARE_PUBLIC(QGraphicsWidget)
    7474public:
    7575    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),
    8477          layout(0),
    8578          inheritedPaletteResolveMask(0),
     
    9184          focusNext(0),
    9285          focusPrev(0),
    93           focusChild(0),
    9486          windowFlags(0),
    95           hoveredSubControl(QStyle::SC_None),
    96           grabbedSection(Qt::NoSection),
    97           buttonMouseOver(false),
    98           buttonSunken(false),
     87          windowData(0),
    9988          setWindowFrameMargins(false),
    100           leftWindowFrameMargin(0),
    101           topWindowFrameMargin(0),
    102           rightWindowFrameMargin(0),
    103           bottomWindowFrameMargin(0)
     89          windowFrameMargins(0)
    10490    { }
     91
    10592
    10693    void init(QGraphicsItem *parentItem, Qt::WindowFlags wFlags);
     
    10895
    10996    // 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);
    122102    void setLayout_helper(QGraphicsLayout *l);
    123 
    124     qreal leftLayoutItemMargin;
    125     qreal topLayoutItemMargin;
    126     qreal rightLayoutItemMargin;
    127     qreal bottomLayoutItemMargin;
    128103
    129104    // Layouts
     
    203178    QGraphicsWidget *focusNext;
    204179    QGraphicsWidget *focusPrev;
    205     QGraphicsWidget *focusChild;
    206     void setFocusWidget();
    207     void clearFocusWidget();
    208180
    209181    // Windows
    210182    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();
    219199
    220200    bool setWindowFrameMargins;
    221     qreal leftWindowFrameMargin;
    222     qreal topWindowFrameMargin;
    223     qreal rightWindowFrameMargin;
    224     qreal bottomWindowFrameMargin;
     201    mutable qreal *windowFrameMargins;
     202    void ensureWindowFrameMargins() const;
    225203
    226204#ifndef QT_NO_ACTION
Note: See TracChangeset for help on using the changeset viewer.