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 /src/gui/widgets/qtoolbar.cpp | |
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 'src/gui/widgets/qtoolbar.cpp')
-rw-r--r-- | src/gui/widgets/qtoolbar.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index fadccbc..d765794 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -274,9 +274,11 @@ void QToolBarPrivate::endDrag() bool QToolBarPrivate::mousePressEvent(QMouseEvent *event) { - if (layout->handleRect().contains(event->pos()) == false) { + Q_Q(QToolBar); + QStyleOptionToolBar opt; + q->initStyleOption(&opt); + if (q->style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, q).contains(event->pos()) == false) { #ifdef Q_WS_MAC - Q_Q(QToolBar); // When using the unified toolbar on Mac OS X the user can can click and // drag between toolbar contents to move the window. Make this work by // implementing the standard mouse-dragging code and then call @@ -1041,7 +1043,7 @@ void QToolBar::paintEvent(QPaintEvent *) style->drawControl(QStyle::CE_ToolBar, &opt, &p, this); } - opt.rect = d->layout->handleRect(); + opt.rect = style->subElementRect(QStyle::SE_ToolBarHandle, &opt, this); if (opt.rect.isValid()) style->drawPrimitive(QStyle::PE_IndicatorToolBarHandle, &opt, &p, this); } @@ -1142,7 +1144,9 @@ bool QToolBar::event(QEvent *event) case QEvent::HoverMove: { #ifndef QT_NO_CURSOR QHoverEvent *e = static_cast<QHoverEvent*>(event); - if (d->layout->handleRect().contains(e->pos())) + QStyleOptionToolBar opt; + initStyleOption(&opt); + if (style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, this).contains(e->pos())) setCursor(Qt::SizeAllCursor); else unsetCursor(); |