From f0243e70e05a3368582fd0478d840096d6b60c3f Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Fri, 8 May 2009 14:55:01 +0200 Subject: 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 --- tools/designer/src/lib/shared/qdesigner_toolbar.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'tools/designer/src/lib') 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 #include #include -#include #include 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(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(tb)->initStyleOption(&opt); + return tb->style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, tb); } bool ToolBarEventFilter::withinHandleArea(const QToolBar *tb, const QPoint &pos) -- cgit v1.2.1