diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-07-16 00:57:01 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-07-16 00:57:01 (GMT) |
commit | 17e7b024ba01aba0e525f7fd03b9c5c0ed34e7c8 (patch) | |
tree | 54d169f5970ae2ec8b4aab796cc75fbfb04f9ed4 /src/gui/graphicsview | |
parent | 062a504010534d5e899f042b27c8ace82b556426 (diff) | |
parent | 6e2c3e7306883cd4618742e37861e326e9c91895 (diff) | |
download | Qt-17e7b024ba01aba0e525f7fd03b9c5c0ed34e7c8.zip Qt-17e7b024ba01aba0e525f7fd03b9c5c0ed34e7c8.tar.gz Qt-17e7b024ba01aba0e525f7fd03b9c5c0ed34e7c8.tar.bz2 |
Merge remote branch 'origin/4.7' into oslo-staging-1
Conflicts:
tools/qdoc3/htmlgenerator.cpp
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsgridlayout.cpp | 7 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicslinearlayout.cpp | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/gui/graphicsview/qgraphicsgridlayout.cpp b/src/gui/graphicsview/qgraphicsgridlayout.cpp index 83db3ec..062b5ac 100644 --- a/src/gui/graphicsview/qgraphicsgridlayout.cpp +++ b/src/gui/graphicsview/qgraphicsgridlayout.cpp @@ -94,14 +94,13 @@ public: #endif }; +Q_GLOBAL_STATIC(QWidget, globalStyleInfoWidget); + QLayoutStyleInfo QGraphicsGridLayoutPrivate::styleInfo() const { - static QWidget *wid = 0; - if (!wid) - wid = new QWidget; QGraphicsItem *item = parentItem(); QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style(); - return QLayoutStyleInfo(style, wid); + return QLayoutStyleInfo(style, globalStyleInfoWidget()); } /*! diff --git a/src/gui/graphicsview/qgraphicslinearlayout.cpp b/src/gui/graphicsview/qgraphicslinearlayout.cpp index b828722..37408ef 100644 --- a/src/gui/graphicsview/qgraphicslinearlayout.cpp +++ b/src/gui/graphicsview/qgraphicslinearlayout.cpp @@ -171,14 +171,13 @@ int QGraphicsLinearLayoutPrivate::gridColumn(int index) const return int(qMin(uint(index), uint(engine.columnCount()))); } +Q_GLOBAL_STATIC(QWidget, globalStyleInfoWidget) + QLayoutStyleInfo QGraphicsLinearLayoutPrivate::styleInfo() const { - static QWidget *wid = 0; - if (!wid) - wid = new QWidget; QGraphicsItem *item = parentItem(); QStyle *style = (item && item->isWidget()) ? static_cast<QGraphicsWidget*>(item)->style() : QApplication::style(); - return QLayoutStyleInfo(style, wid); + return QLayoutStyleInfo(style, globalStyleInfoWidget()); } /*! |