summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qtoolbar.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-05-08 12:55:01 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-05-08 15:04:15 (GMT)
commitf0243e70e05a3368582fd0478d840096d6b60c3f (patch)
tree05308c419163be88d8080c86e9f981e260085494 /src/gui/widgets/qtoolbar.cpp
parent6fdff777765c93996b7de9fc36c0de7ff4928102 (diff)
downloadQt-f0243e70e05a3368582fd0478d840096d6b60c3f.zip
Qt-f0243e70e05a3368582fd0478d840096d6b60c3f.tar.gz
Qt-f0243e70e05a3368582fd0478d840096d6b60c3f.tar.bz2
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 'src/gui/widgets/qtoolbar.cpp')
-rw-r--r--src/gui/widgets/qtoolbar.cpp12
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();