diff options
Diffstat (limited to 'src/widgets/widgets/qdockwidget.cpp')
-rw-r--r-- | src/widgets/widgets/qdockwidget.cpp | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp index 28a7cee2a0..05ec3aface 100644 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -381,11 +381,10 @@ QSize QDockWidgetLayout::sizeFromContent(const QSize &content, bool floating) co if (content.height() < 0) result.setHeight(-1); - int left, top, right, bottom; - w->getContentsMargins(&left, &top, &right, &bottom); + const QMargins margins = w->contentsMargins(); //we need to subtract the contents margin (it will be added by the caller) - QSize min = w->minimumSize() - QSize(left + right, top + bottom); - QSize max = w->maximumSize() - QSize(left + right, top + bottom); + QSize min = w->minimumSize().shrunkBy(margins); + QSize max = w->maximumSize().shrunkBy(margins); /* A floating dockwidget will automatically get its minimumSize set to the layout's minimum size + deco. We're *not* interested in this, we only take minimumSize() @@ -977,11 +976,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event) && (event->pos() - state->pressPos).manhattanLength() > QApplication::startDragDistance()) { startDrag(); -#if 0 // Used to be included in Qt4 for Q_WS_WIN - grabMouseWhileInWindow(); -#else q->grabMouse(); -#endif ret = true; } } @@ -1029,13 +1024,6 @@ void QDockWidgetPrivate::nonClientAreaMouseEvent(QMouseEvent *event) QWidget *tl = q->topLevelWidget(); QRect geo = tl->geometry(); QRect titleRect = tl->frameGeometry(); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - if ((features & QDockWidget::DockWidgetVerticalTitleBar)) { - titleRect.setTop(geo.top()); - titleRect.setBottom(geo.bottom()); - titleRect.setRight(geo.left() - 1); - } else -#endif { titleRect.setLeft(geo.left()); titleRect.setRight(geo.right()); @@ -1588,17 +1576,6 @@ bool QDockWidget::event(QEvent *event) if (d->mouseMoveEvent(static_cast<QMouseEvent *>(event))) return true; break; -#if 0 // Used to be included in Qt4 for Q_WS_WIN - case QEvent::Leave: - if (d->state != 0 && d->state->dragging && !d->state->nca) { - // This is a workaround for loosing the mouse on Vista. - QPoint pos = QCursor::pos(); - QMouseEvent fake(QEvent::MouseMove, mapFromGlobal(pos), pos, Qt::NoButton, - QGuiApplication::mouseButtons(), QGuiApplication::keyboardModifiers()); - d->mouseMoveEvent(&fake); - } - break; -#endif case QEvent::MouseButtonRelease: if (d->mouseReleaseEvent(static_cast<QMouseEvent *>(event))) return true; |