summaryrefslogtreecommitdiffstats
path: root/tools
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 /tools
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 'tools')
-rw-r--r--tools/designer/src/lib/shared/qdesigner_toolbar.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/designer/src/lib/shared/qdesigner_toolbar.cpp b/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
index 1c465da..012b498 100644
--- a/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
+++ b/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
@@ -61,7 +61,6 @@
#include <QtGui/QMenu>
#include <QtGui/qevent.h>
#include <QtGui/QApplication>
-#include <QtGui/private/qtoolbarlayout_p.h>
#include <QtCore/QDebug>
Q_DECLARE_METATYPE(QAction*)
@@ -443,9 +442,14 @@ QAction *ToolBarEventFilter::actionAt(const QToolBar *tb, const QPoint &pos)
QRect ToolBarEventFilter::handleArea(const QToolBar *tb)
{
- const QToolBarLayout *tbl = qobject_cast<QToolBarLayout *>(tb->layout());
- Q_ASSERT(tbl);
- return tbl->handleRect();
+ //that's a trick to get acces to the initStyleOption which is a protected member
+ class ToolBar : public QToolBar
+ {
+ friend class ToolBarEventFilter;
+ };
+ QStyleOptionToolBar opt;
+ static_cast<const ToolBar*>(tb)->initStyleOption(&opt);
+ return tb->style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, tb);
}
bool ToolBarEventFilter::withinHandleArea(const QToolBar *tb, const QPoint &pos)