summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-02-05 10:06:51 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-19 08:53:55 +0100
commit73d32873cf307a60bbe83f2c9e973236bccb4162 (patch)
tree3477ae2951d9f5c34282f447848f05a8ea72a93b
parent4b42c91821b913aec32ab82d2d5e29ffa2f2a8ad (diff)
Cocoa: Add QMdiSubWindow size grip back.
Change all Q_WS_MAC -> Q_OS_MAC in qmdisubwindow.cpp Remove QEXPECT_FAIL from tst_qmdisubwindow.cpp. Task-number: QTBUG-29434, QTBUG-25297 Change-Id: I299b87ab994e2d5ba93d5bbae48de0df1ac1c9d6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp28
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp12
2 files changed, 14 insertions, 26 deletions
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index 13d0b180cc..02b3cc7ba2 100644
--- a/src/widgets/widgets/qmdisubwindow.cpp
+++ b/src/widgets/widgets/qmdisubwindow.cpp
@@ -160,7 +160,7 @@
#include <QMainWindow>
#include <QScrollBar>
#include <QDebug>
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
#include <private/qmacstyle_mac_p.h>
#endif
#include <QMdiArea>
@@ -304,7 +304,7 @@ static void showToolTip(QHelpEvent *helpEvent, QWidget *widget, const QStyleOpti
Q_ASSERT(helpEvent->type() == QEvent::ToolTip);
Q_ASSERT(widget);
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
// Native Mac windows don't show tool tip.
if (qobject_cast<QMacStyle *>(widget->style()))
return;
@@ -1079,7 +1079,7 @@ void QMdiSubWindowPrivate::updateCursor()
{
#ifndef QT_NO_CURSOR
Q_Q(QMdiSubWindow);
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(q->style()))
return;
#endif
@@ -1499,7 +1499,7 @@ void QMdiSubWindowPrivate::processClickedSubControl()
q->showNormal();
break;
case QStyle::SC_TitleBarMinButton:
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(q->style())) {
if (q->isMinimized())
q->showNormal();
@@ -1516,7 +1516,7 @@ void QMdiSubWindowPrivate::processClickedSubControl()
q->showNormal();
break;
case QStyle::SC_TitleBarMaxButton:
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(q->style())) {
if (q->isMaximized())
q->showNormal();
@@ -1563,7 +1563,7 @@ QRegion QMdiSubWindowPrivate::getRegion(Operation operation) const
}
QRegion region;
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(q->style()))
return region;
#endif
@@ -1717,7 +1717,7 @@ int QMdiSubWindowPrivate::titleBarHeight(const QStyleOptionTitleBar &options) co
}
int height = q->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options, q);
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
// ### Fix mac style, the +4 pixels hack is not necessary anymore
if (qobject_cast<QMacStyle *>(q->style()))
height -= 4;
@@ -1772,7 +1772,7 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const
if (isChildOfTabbedQMdiArea(q))
return false;
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC) || defined(Q_OS_WINCE_WM)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC) || defined(Q_OS_WINCE_WM)
return true;
#else
if (q->style()->styleHint(QStyle::SH_Workspace_FillSpaceOnMaximize, 0, q))
@@ -2180,7 +2180,7 @@ void QMdiSubWindowPrivate::setSizeGrip(QSizeGrip *newSizeGrip)
return;
newSizeGrip->setFixedSize(newSizeGrip->sizeHint());
bool putSizeGripInLayout = layout ? true : false;
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(q->style()))
putSizeGripInLayout = false;
#endif
@@ -2263,7 +2263,7 @@ QMdiSubWindow::QMdiSubWindow(QWidget *parent, Qt::WindowFlags flags)
d->titleBarPalette = d->desktopPalette();
d->font = QApplication::font("QMdiSubWindowTitleBar");
// We don't want the menu icon by default on mac.
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
if (windowIcon().isNull())
d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, 0, this);
else
@@ -2831,7 +2831,7 @@ bool QMdiSubWindow::event(QEvent *event)
d->isMaximizeMode = false;
d->isWidgetHiddenByUs = false;
if (!parent()) {
-#if !defined(QT_NO_SIZEGRIP) && defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if !defined(QT_NO_SIZEGRIP) && defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(style()))
delete d->sizeGrip;
#endif
@@ -2926,7 +2926,7 @@ void QMdiSubWindow::showEvent(QShowEvent *showEvent)
return;
}
-#if !defined(QT_NO_SIZEGRIP) && defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if !defined(QT_NO_SIZEGRIP) && defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(style()) && !d->sizeGrip
&& !(windowFlags() & Qt::FramelessWindowHint)) {
d->setSizeGrip(new QSizeGrip(0));
@@ -3320,7 +3320,7 @@ void QMdiSubWindow::mouseMoveEvent(QMouseEvent *mouseEvent)
hoverRegion += style()->subControlRect(QStyle::CC_TitleBar, &options,
d->hoveredSubControl, this);
}
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
if (qobject_cast<QMacStyle *>(style()) && !hoverRegion.isEmpty())
hoverRegion += QRegion(0, 0, width(), d->titleBarHeight(options));
#endif
@@ -3530,7 +3530,7 @@ QSize QMdiSubWindow::minimumSizeHint() const
int sizeGripHeight = 0;
if (d->sizeGrip && d->sizeGrip->isVisibleTo(const_cast<QMdiSubWindow *>(this)))
sizeGripHeight = d->sizeGrip->height();
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
else if (parent() && qobject_cast<QMacStyle *>(style()) && !d->sizeGrip)
sizeGripHeight = style()->pixelMetric(QStyle::PM_SizeGripSize, 0, this);
#endif
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
index 6198aa8668..2163426cac 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -600,9 +600,6 @@ void tst_QMdiSubWindow::showShaded()
else
#endif
mouseReceiver = window;
-#ifdef Q_OS_MAC
- QEXPECT_FAIL("", "QTBUG-25297", Abort);
-#endif
QVERIFY(mouseReceiver);
sendMouseMove(mouseReceiver, mousePosition, Qt::NoButton);
sendMousePress(mouseReceiver, mousePosition);
@@ -711,9 +708,6 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove()
mouseReceiver = qFindChild<QSizeGrip *>(window);
else
mouseReceiver = window;
-#ifdef Q_OS_MAC
- QEXPECT_FAIL("", "QTBUG-25297", Abort);
-#endif
QVERIFY(mouseReceiver);
// ----------------------------- resize -----------------------------
@@ -1451,9 +1445,6 @@ void tst_QMdiSubWindow::defaultSizeGrip()
// QSizeGrip on windows with decoration.
QMdiSubWindow *windowWithDecoration = mdiArea.addSubWindow(new QWidget);
windowWithDecoration->show();
-#ifdef Q_OS_MAC
- QEXPECT_FAIL("", "QTBUG-25297", Abort);
-#endif
QVERIFY(qFindChild<QSizeGrip *>(windowWithDecoration));
// ...but not on windows without decoration (Qt::FramelessWindowHint).
@@ -1713,9 +1704,6 @@ void tst_QMdiSubWindow::fixedMinMaxSize()
// to minimize the window.
subWindow->showMinimized();
QVERIFY(subWindow->isMinimized());
-#ifdef Q_OS_MAC
- QEXPECT_FAIL("", "QTBUG-25297", Abort);
-#endif
QCOMPARE(subWindow->size(), minimizedSize);
QCOMPARE(subWindow->minimumSize(), minimizedSize);