diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/designer/src/lib/shared/qdesigner_toolbar.cpp | 12 |
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) |