summaryrefslogtreecommitdiff
path: root/tools/designer/src/lib
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-05-08 14:55:01 +0200
committerThierry Bastian <thierry.bastian@nokia.com>2009-05-08 17:04:15 +0200
commitf0243e70e05a3368582fd0478d840096d6b60c3f (patch)
tree05308c419163be88d8080c86e9f981e260085494 /tools/designer/src/lib
parent6fdff777765c93996b7de9fc36c0de7ff4928102 (diff)
downloadqt4-tools-f0243e70e05a3368582fd0478d840096d6b60c3f.tar.gz
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/designer/src/lib')
-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 1c465da457..012b4982cb 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)