summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-07-16 00:57:01 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-07-16 00:57:01 (GMT)
commit17e7b024ba01aba0e525f7fd03b9c5c0ed34e7c8 (patch)
tree54d169f5970ae2ec8b4aab796cc75fbfb04f9ed4 /src/gui/graphicsview
parent062a504010534d5e899f042b27c8ace82b556426 (diff)
parent6e2c3e7306883cd4618742e37861e326e9c91895 (diff)
downloadQt-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.cpp7
-rw-r--r--src/gui/graphicsview/qgraphicslinearlayout.cpp7
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());
}
/*!