summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-05-08 12:55:01 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-05-08 15:04:15 (GMT)
commitf0243e70e05a3368582fd0478d840096d6b60c3f (patch)
tree05308c419163be88d8080c86e9f981e260085494 /src/gui/styles
parent6fdff777765c93996b7de9fc36c0de7ff4928102 (diff)
downloadQt-f0243e70e05a3368582fd0478d840096d6b60c3f.zip
Qt-f0243e70e05a3368582fd0478d840096d6b60c3f.tar.gz
Qt-f0243e70e05a3368582fd0478d840096d6b60c3f.tar.bz2
QToolBarLayout and QDockWidgetLayout, which are private classes, are
no more exported designer was using QToolBarLayout members. We fixed that by using styles. Reviewed-by: Friedemann Kleint Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qcommonstyle.cpp19
-rw-r--r--src/gui/styles/qstyle.cpp2
-rw-r--r--src/gui/styles/qstyle.h2
3 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 1d12bed..c0899f8 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -3187,6 +3187,25 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
}
break;
#endif //QT_NO_ITEMVIEWS
+#ifndef QT_NO_TOOLBAR
+ case SE_ToolBarHandle:
+ if (const QStyleOptionToolBar *tbopt = qstyleoption_cast<const QStyleOptionToolBar *>(opt)) {
+ if (tbopt->features & QStyleOptionToolBar::Movable) {
+ ///we need to access the widget here because the style option doesn't
+ //have all the information we need (ie. the layout's margin)
+ const QToolBar *tb = qobject_cast<const QToolBar*>(widget);
+ const int margin = tb && tb->layout() ? tb->layout()->margin() : 2;
+ const int handleExtent = pixelMetric(QStyle::PM_ToolBarExtensionExtent, opt, tb);
+ if (tbopt->state & QStyle::State_Horizontal) {
+ r = QRect(margin, margin, handleExtent, tbopt->rect.height() - 2*margin);
+ r = QStyle::visualRect(tbopt->direction, tbopt->rect, r);
+ } else {
+ r = QRect(margin, margin, tbopt->rect.width() - 2*margin, handleExtent);
+ }
+ }
+ }
+ break;
+#endif //QT_NO_TOOLBAR
default:
break;
}
diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp
index 982f48f..b73332f 100644
--- a/src/gui/styles/qstyle.cpp
+++ b/src/gui/styles/qstyle.cpp
@@ -1048,6 +1048,8 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment,
\value SE_TabBarTabRightButton Area for a widget on the right side of a tab in a tab bar.
\value SE_TabBarTabText Area for the text on a tab in a tab bar.
+ \value SE_ToolBarHandle Area for the handle of a tool bar.
+
\sa subElementRect()
*/
diff --git a/src/gui/styles/qstyle.h b/src/gui/styles/qstyle.h
index c1cbbdd..cc92459 100644
--- a/src/gui/styles/qstyle.h
+++ b/src/gui/styles/qstyle.h
@@ -373,6 +373,8 @@ public:
SE_ShapedFrameContents,
+ SE_ToolBarHandle,
+
// do not add any values below/greater than this
SE_CustomBase = 0xf0000000
};