diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-11 08:34:37 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-11 08:34:37 (GMT) |
commit | 789c045bfd25eb7921030c4d109e3a2ef27a12a9 (patch) | |
tree | b9201a5e73d4e663e1670875eca219ff8e7bf681 /tools | |
parent | 771e18e96d86f09bb047e5cf45cc33568e259a5d (diff) | |
parent | b7f84c44ae723a77ed34246949e49438491f54e9 (diff) | |
download | Qt-789c045bfd25eb7921030c4d109e3a2ef27a12a9.zip Qt-789c045bfd25eb7921030c4d109e3a2ef27a12a9.tar.gz Qt-789c045bfd25eb7921030c4d109e3a2ef27a12a9.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into windows-7-multitouch
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) |