Replace Q_WS_MAC with Q_OS_MAC in tests/auto/widgets
authorBradley T. Hughes <bradley.hughes@nokia.com>
Mon, 16 Jan 2012 10:49:53 +0000 (11:49 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 23 Jan 2012 08:32:43 +0000 (09:32 +0100)
tst_qwidget.cpp will not build/link without tst_qwidget_mac_helpers.mm,
so re-add it to the build as well.

Change-Id: I55130f62c215c4b82683d90456e31fdb09f833a8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
42 files changed:
tests/auto/widgets/dialogs/qcolordialog/tst_qcolordialog.cpp
tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp
tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
tests/auto/widgets/dialogs/qfontdialog/tst_qfontdialog.cpp
tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp
tests/auto/widgets/graphicsview/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
tests/auto/widgets/graphicsview/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp
tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
tests/auto/widgets/kernel/qlayout/tst_qlayout.cpp
tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
tests/auto/widgets/kernel/qwidget/qwidget.pro
tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.h
tests/auto/widgets/kernel/qwidget/tst_qwidget_mac_helpers.mm
tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
tests/auto/widgets/styles/qstyle/tst_qstyle.cpp
tests/auto/widgets/widgets/qabstractbutton/tst_qabstractbutton.cpp
tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp
tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp
tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp
tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp
tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
tests/auto/widgets/widgets/qsizegrip/tst_qsizegrip.cpp
tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
tests/auto/widgets/widgets/qstatusbar/tst_qstatusbar.cpp
tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp
tests/auto/widgets/widgets/qtoolbar/tst_qtoolbar.cpp
tests/auto/widgets/widgets/qworkspace/tst_qworkspace.cpp

index 604717a..3babddc 100644 (file)
@@ -53,7 +53,7 @@ public:
     tst_QColorDialog();
     virtual ~tst_QColorDialog();
 
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
 public slots:
     void postKeyReturn();
 private slots:
@@ -125,7 +125,7 @@ void tst_QColorDialog::cleanup()
 {
 }
 
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
 //copied from QFontDialogTest
 void tst_QColorDialog::postKeyReturn() {
     QWidgetList list = QApplication::topLevelWidgets();
index e9d3894..95a0f01 100644 (file)
@@ -440,7 +440,7 @@ public slots:
 
 void tst_QDialog::throwInExec()
 {
-#if defined(Q_WS_MAC) || (defined(Q_WS_WINCE) && defined(_ARM_))
+#if defined(Q_OS_MAC) || (defined(Q_WS_WINCE) && defined(_ARM_))
     QSKIP("Throwing exceptions in exec() is not supported on this platform.");
 #endif
 #if defined(Q_OS_LINUX)
index 19904f0..ebac2c7 100644 (file)
@@ -909,7 +909,7 @@ void tst_QFiledialog::selectFiles()
     QVERIFY(listView);
     for (int i = 0; i < list.count(); ++i) {
         fd.selectFile(fd.directory().path() + "/" + list.at(i));
-#if defined(Q_WS_MAC) || defined(Q_WS_WIN)
+#if defined(Q_OS_MAC) || defined(Q_WS_WIN)
     QEXPECT_FAIL("", "This test does not work on Mac or Windows", Abort);
 #endif
         QTRY_VERIFY(!listView->selectionModel()->selectedRows().isEmpty());
@@ -1223,7 +1223,7 @@ void tst_QFiledialog::clearLineEdit()
     list->setEditFocus(true);
 #endif
     QTest::keyClick(list, Qt::Key_Down);
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     QTest::keyClick(list, Qt::Key_Return);
 #else
     QTest::keyClick(list, Qt::Key_O, Qt::ControlModifier);
@@ -1240,7 +1240,7 @@ void tst_QFiledialog::clearLineEdit()
 
     QTest::qWait(1000);
     QTest::keyClick(list, Qt::Key_Down);
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     QTest::keyClick(list, Qt::Key_Return);
 #else
     QTest::keyClick(list, Qt::Key_O, Qt::ControlModifier);
index c8b1b1c..4c7efc1 100644 (file)
@@ -102,7 +102,6 @@ void tst_QFontDialog::cleanup()
 
 
 void tst_QFontDialog::postKeyReturn() {
-#ifndef Q_WS_MAC
     QWidgetList list = QApplication::topLevelWidgets();
     for (int i=0; i<list.count(); ++i) {
        QFontDialog *dialog = qobject_cast<QFontDialog*>(list[i]);
@@ -111,10 +110,6 @@ void tst_QFontDialog::postKeyReturn() {
            return;
        }
     }
-#else
-    extern void click_cocoa_button();
-    click_cocoa_button();
-#endif
 }
 
 void tst_QFontDialog::defaultOkButton()
index 8e2b188..b598c00 100644 (file)
@@ -48,7 +48,7 @@
 #include <QApplication>
 #include <QPushButton>
 #include <QDialogButtonBox>
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
 #include <QMacStyle>
 #endif
 #if !defined(QT_NO_STYLE_CLEANLOOKS)
@@ -363,7 +363,7 @@ void tst_QMessageBox::statics()
 
 void tst_QMessageBox::shortcut()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QSKIP("shortcuts are not used on MAC OS X");
 #endif
     QMessageBox msgBox;
@@ -380,7 +380,7 @@ void tst_QMessageBox::about()
     QMessageBox::about(0, "Caption", "This is an auto test");
     // On Mac, about and aboutQt are not modal, so we need to
     // explicitly run the event loop
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTRY_COMPARE(keyToSend, -1);
 #else
     QCOMPARE(keyToSend, -1);
@@ -393,7 +393,7 @@ void tst_QMessageBox::about()
 #endif
     sendKeySoon();
     QMessageBox::aboutQt(0, "Caption");
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTRY_COMPARE(keyToSend, -1);
 #else
     QCOMPARE(keyToSend, -1);
@@ -409,7 +409,7 @@ void tst_QMessageBox::staticSourceCompat()
     sendKeySoon();
     ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No);
     int expectedButton = int(QMessageBox::Yes);
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
     if (qobject_cast<QMacStyle *>(qApp->style()))
         expectedButton = int(QMessageBox::No);
 #elif !defined(QT_NO_STYLE_CLEANLOOKS)
@@ -481,7 +481,7 @@ void tst_QMessageBox::instanceSourceCompat()
 
     QCOMPARE(exec(&mb, Qt::Key_Enter), int(QMessageBox::Yes));
     QCOMPARE(exec(&mb, Qt::Key_Escape), int(QMessageBox::Cancel));
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     // mnemonics are not used on Mac OS X
     QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_R), 0);
     QCOMPARE(exec(&mb, Qt::ALT + Qt::Key_Z), 1);
index d6e810f..56b5aba 100644 (file)
@@ -441,7 +441,7 @@ void tst_QWizard::setPixmap()
     QVERIFY(wizard.pixmap(QWizard::BannerPixmap).isNull());
     QVERIFY(wizard.pixmap(QWizard::LogoPixmap).isNull());
     QVERIFY(wizard.pixmap(QWizard::WatermarkPixmap).isNull());
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_3)
         QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull() == false);
     else  // fall through since the image doesn't exist on a 10.3 system.
@@ -453,7 +453,7 @@ void tst_QWizard::setPixmap()
     QVERIFY(page->pixmap(QWizard::BannerPixmap).isNull());
     QVERIFY(page->pixmap(QWizard::LogoPixmap).isNull());
     QVERIFY(page->pixmap(QWizard::WatermarkPixmap).isNull());
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_3)
         QVERIFY(wizard.pixmap(QWizard::BackgroundPixmap).isNull() == false);
     else  // fall through since the image doesn't exist on a 10.3 system.
index 0c2ae32..1807bbe 100644 (file)
@@ -1091,7 +1091,7 @@ void tst_QGraphicsAnchorLayout::setSpacing()
     p->show();
 
     QApplication::processEvents();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::qWait(200);
 #endif
 
index 980474b..26356b3 100644 (file)
@@ -501,7 +501,7 @@ void tst_QGraphicsGridLayout::alignment_data()
 // public Qt::Alignment alignment(QGraphicsLayoutItem* item) const
 void tst_QGraphicsGridLayout::alignment()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QSKIP("Resizing a QGraphicsWidget to effectiveSizeHint(Qt::MaximumSize) is currently not supported on mac");
 #endif
     QFETCH(bool, hasHeightForWidth);
@@ -575,7 +575,7 @@ void tst_QGraphicsGridLayout::columnAlignment_data()
 // public Qt::Alignment columnAlignment(int column) const
 void tst_QGraphicsGridLayout::columnAlignment()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QSKIP("Resizing a QGraphicsWidget to effectiveSizeHint(Qt::MaximumSize) is currently not supported on mac");
 #endif
     QFETCH(bool, hasHeightForWidth);
index dfbe3c4..c94eca5 100644 (file)
@@ -81,7 +81,7 @@ Q_DECLARE_METATYPE(QRectF)
 #define Q_CHECK_PAINTEVENTS
 #endif
 
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
 // On mac (cocoa) we always get full update.
 // So check that the expected region is contained inside the actual
 #define COMPARE_REGIONS(ACTUAL, EXPECTED) QVERIFY((EXPECTED).subtracted(ACTUAL).isEmpty())
@@ -6095,7 +6095,7 @@ void tst_QGraphicsItem::untransformable()
 
 // Painting with the DiagCrossPattern is really slow on Mac
 // when zoomed out. (The test times out). Task to fix is 155567.
-#if !defined(Q_WS_MAC) || 1
+#if !defined(Q_OS_MAC) || 1
     view.setBackgroundBrush(QBrush(Qt::black, Qt::DiagCrossPattern));
 #endif
 
@@ -8120,7 +8120,7 @@ void tst_QGraphicsItem::sorting()
     _paintedItems.clear();
 
     view.viewport()->repaint();
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
     // There's no difference between repaint and update on the Mac,
     // so we have to process events here to make sure we get the event.
     QTest::qWait(100);
@@ -8155,7 +8155,7 @@ void tst_QGraphicsItem::itemHasNoContents()
     _paintedItems.clear();
 
     view.viewport()->repaint();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     // There's no difference between update() and repaint() on the Mac,
     // so we have to process events here to make sure we get the event.
     QTest::qWait(10);
index 85d8596..3eb9be9 100644 (file)
@@ -45,7 +45,7 @@
 #include <QtWidgets>
 #include <private/qgraphicsproxywidget_p.h>
 #include <private/qlayoutengine_p.h>    // qSmartMin functions...
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
 #include <QMacStyle>
 #endif
 #ifdef Q_WS_X11
@@ -2727,7 +2727,7 @@ void tst_QGraphicsProxyWidget::childPos()
         QVERIFY(proxyChild);
         QVERIFY(proxyChild->isVisible());
         qreal expectedXPosition = 0.0;
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
         // The Mac style wants the popup to show up at QPoint(4 - 11, 1).
         // See QMacStyle::subControlRect SC_ComboBoxListBoxPopup.
         if (qobject_cast<QMacStyle *>(QApplication::style()))
index 18236a7..5a7fe31 100644 (file)
@@ -83,7 +83,7 @@ Q_DECLARE_METATYPE(QPolygonF)
 Q_DECLARE_METATYPE(QRectF)
 Q_DECLARE_METATYPE(Qt::ScrollBarPolicy)
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 //On mac we get full update. So check that the expected region is contained inside the actual
 #define COMPARE_REGIONS(ACTUAL, EXPECTED) QVERIFY((EXPECTED).subtracted(ACTUAL).isEmpty())
 #else
@@ -2515,7 +2515,7 @@ void tst_QGraphicsView::optimizationFlags_dontSavePainterState()
     view.setOptimizationFlags(QGraphicsView::DontSavePainterState);
     view.viewport()->repaint();
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     // Repaint on Mac OS X actually does require spinning the event loop.
     QTest::qWait(100);
 #endif
index e965b04..ebbc40d 100644 (file)
@@ -122,7 +122,7 @@ private slots:
     void changeDataWithSorting();
     void itemData();
     void itemWidget();
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     void fastScroll();
 #endif
     void insertUnchanged();
@@ -1489,7 +1489,7 @@ void tst_QListWidget::itemWidget()
     QCOMPARE(list.itemWidget(item), static_cast<QWidget*>(0));
 }
 
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
 class MyListWidget : public QListWidget
 {
 public:
@@ -1537,7 +1537,7 @@ void tst_QListWidget::fastScroll()
     // only one item should be repainted, the rest should be scrolled in memory
     QCOMPARE(widget.painted.boundingRect().size(), itemSize);
 }
-#endif // Q_WS_MAC
+#endif // Q_OS_MAC
 
 void tst_QListWidget::insertUnchanged()
 {
index 45f06b9..821952c 100644 (file)
@@ -1575,7 +1575,7 @@ void tst_QApplication::focusChanged()
     QTestMouseEvent click(QTest::MouseClick, Qt::LeftButton, 0, QPoint(5, 5), 0);
 
     bool tabAllControls = true;
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     // Mac has two modes, one where you tab to everything, one where you can
     // only tab to input controls, here's what we get. Determine which ones we
     // should get.
index 1b591b6..a829af0 100644 (file)
@@ -56,8 +56,8 @@
 #include <QRadioButton>
 #include <private/qlayoutengine_p.h>
 
-#ifdef Q_WS_MAC
-# include <QtGui/QMacStyle>
+#ifdef Q_OS_MAC
+# include <QtWidgets/QMacStyle>
 #endif
 
 class tst_QLayout : public QObject
@@ -273,7 +273,7 @@ public:
 
 void tst_QLayout::layoutItemRect()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     if (qobject_cast<QMacStyle*>(QApplication::style())) {
         QWidget *window = new QWidget;
         QRadioButton *radio = new QRadioButton(window);
index f695283..3acc1ff 100644 (file)
@@ -90,7 +90,7 @@ void tst_QToolTip::task183679_data()
 {
     QTest::addColumn<Qt::Key>("key");
     QTest::addColumn<bool>("visible");
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     const bool visibleAfterNonModifier = false;
 #else
     const bool visibleAfterNonModifier = true;
index 33b95d7..23fd245 100644 (file)
@@ -11,9 +11,8 @@ aix-g++*:QMAKE_CXXFLAGS+=-fpermissive
 CONFIG += x11inc
 
 mac {
-# ### fixme
-# LIBS += -framework Security -framework AppKit -framework Carbon
-# OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm
+    LIBS += -framework Security -framework AppKit -framework Carbon
+    OBJECTIVE_SOURCES += tst_qwidget_mac_helpers.mm
 }
 
 x11 {
index 07a2332..4d0bd66 100644 (file)
 # include <qscreen_qws.h>
 #endif
 
-// I *MUST* have QtTest afterwards or this test won't work with newer headers
-#if defined(Q_WS_MAC)
-# include <private/qt_mac_p.h>
-#undef verify
+#if defined(Q_OS_MAC)
 #include "tst_qwidget_mac_helpers.h"  // Abstract the ObjC stuff out so not everyone must run an ObjC++ compile.
 #endif
 
@@ -139,7 +136,7 @@ bool qt_wince_is_smartphone() {
 }
 #endif
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <Security/AuthSession.h>
 bool macHasAccessToWindowsServer()
 {
@@ -224,7 +221,7 @@ private slots:
 #endif
 
     void widgetAt();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     void sheetOpacity();
     void setMask();
 #endif
@@ -255,7 +252,7 @@ private slots:
     void update();
     void isOpaque();
 
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     void scroll();
 #endif
 
@@ -340,10 +337,8 @@ private slots:
 #ifndef Q_OS_IRIX
     void doubleRepaint();
 #endif
-#ifndef Q_WS_MAC
     void resizeInPaintEvent();
     void opaqueChildren();
-#endif
 
     void setMaskInResizeEvent();
     void moveInResizeEvent();
@@ -410,7 +405,7 @@ private slots:
     void taskQTBUG_7532_tabOrderWithFocusProxy();
     void movedAndResizedAttributes();
     void childAt();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     void childAt_unifiedToolBar();
     void taskQTBUG_11373();
 #endif
@@ -2236,12 +2231,12 @@ void tst_QWidget::showMinimizedKeepsFocus()
         qApp->setActiveWindow(&window);
         QTest::qWaitForWindowShown(&window);
         QTest::qWait(30);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
         if (!macHasAccessToWindowsServer())
             QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
 #endif
         QTRY_COMPARE(window.focusWidget(), firstchild);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
         if (!macHasAccessToWindowsServer())
             QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
 #endif
@@ -2627,7 +2622,7 @@ public:
 
 void tst_QWidget::lostUpdatesOnHide()
 {
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     UpdateWidget widget;
     widget.setAttribute(Qt::WA_DontShowOnScreen);
     widget.show();
@@ -2851,7 +2846,7 @@ void tst_QWidget::stackUnder()
 
     foreach (UpdateWidget *child, allChildren) {
         int expectedPaintEvents = child == child4 ? 1 : 0;
-#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
+#if defined(Q_WS_WIN) || defined(Q_OS_MAC)
         if (expectedPaintEvents == 1 && child->numPaintEvents == 2)
             QEXPECT_FAIL(0, "Mac and Windows issues double repaints for Z-Order change", Continue);
 #endif
@@ -2890,7 +2885,7 @@ void tst_QWidget::stackUnder()
 #ifdef Q_OS_WINCE
             qApp->processEvents();
 #endif
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
             QEXPECT_FAIL(0, "See QTBUG-493", Continue);
 #endif
             QCOMPARE(child->numPaintEvents, 0);
@@ -3462,7 +3457,7 @@ void tst_QWidget::testDeletionInEventHandlers()
     delete w;
 }
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 void tst_QWidget::sheetOpacity()
 {
     QWidget tmpWindow;
@@ -3650,7 +3645,7 @@ void tst_QWidget::optimizedResizeMove()
 
 void tst_QWidget::optimizedResize_topLevel()
 {
-#if defined(Q_WS_MAC) || defined(Q_WS_QWS)
+#if defined(Q_OS_MAC) || defined(Q_WS_QWS)
     QSKIP("We do not yet have static contents support for *top-levels* on this platform");
 #endif
 
@@ -4268,7 +4263,7 @@ static inline bool isOpaque(QWidget *widget)
 
 void tst_QWidget::isOpaque()
 {
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     QWidget w;
     QVERIFY(::isOpaque(&w));
 
@@ -4340,7 +4335,7 @@ void tst_QWidget::isOpaque()
 #endif
 }
 
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
 /*
     Test that scrolling of a widget invalidates the correct regions
 */
@@ -4727,7 +4722,7 @@ void tst_QWidget::windowMoveResize()
             widget.move(r.topLeft());
             widget.resize(r.size());
             QApplication::processEvents();
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
             if (r.width() == 0 && r.height() > 0) {
                 widget.move(r.topLeft());
                 widget.resize(r.size());
@@ -4796,7 +4791,7 @@ void tst_QWidget::windowMoveResize()
             widget.move(r.topLeft());
             widget.resize(r.size());
             QApplication::processEvents();
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
             if (r.width() == 0 && r.height() > 0) {
                 widget.move(r.topLeft());
                 widget.resize(r.size());
@@ -4925,7 +4920,7 @@ void tst_QWidget::moveChild()
     QTRY_COMPARE(pos, child.pos());
 
     QCOMPARE(parent.r, QRegion(oldGeometry) - child.geometry());
-#if !defined(Q_WS_MAC)
+#if !defined(Q_OS_MAC)
     // should be scrolled in backingstore
     QCOMPARE(child.r, QRegion());
 #endif
@@ -6563,7 +6558,7 @@ void tst_QWidget::render_systemClip()
     // rrrrrrrrrr
     // ...
 
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     for (int i = 0; i < image.height(); ++i) {
         for (int j = 0; j < image.width(); ++j) {
             if (i < 50 && j < i)
@@ -7526,11 +7521,6 @@ void tst_QWidget::updateGeometry()
 
 void tst_QWidget::sendUpdateRequestImmediately()
 {
-#ifdef Q_WS_MAC
-    if (!QApplicationPrivate::graphicsSystem())
-        QSKIP("We only send update requests on the Mac when passing -graphicssystem");
-#endif
-
     UpdateWidget updateWidget;
     updateWidget.show();
 #ifdef Q_WS_X11
@@ -7552,7 +7542,7 @@ void tst_QWidget::sendUpdateRequestImmediately()
 #ifndef Q_OS_IRIX
 void tst_QWidget::doubleRepaint()
 {
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
     if (!macHasAccessToWindowsServer())
         QSKIP("Not having window server access causes the wrong number of repaints to be issues");
 #endif
@@ -7583,8 +7573,6 @@ void tst_QWidget::doubleRepaint()
 }
 #endif
 
-#ifndef Q_WS_MAC
-// This test only makes sense on the Mac when passing -graphicssystem.
 void tst_QWidget::resizeInPaintEvent()
 {
     QWidget window;
@@ -7648,7 +7636,6 @@ void tst_QWidget::opaqueChildren()
     greatGrandChild.setAutoFillBackground(false);
     QCOMPARE(qt_widget_private(&grandChild)->getOpaqueChildren(), QRegion());
 }
-#endif
 
 
 class MaskSetWidget : public QWidget
@@ -8250,7 +8237,7 @@ void tst_QWidget::setClearAndResizeMask()
     QTRY_COMPARE(child.mask(), childMask);
     QTest::qWait(50);
     // and ensure that the child widget doesn't get any update.
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
     if (child.internalWinId())
         QCOMPARE(child.numPaintEvents, 1);
@@ -8273,7 +8260,7 @@ void tst_QWidget::setClearAndResizeMask()
     // and ensure that that the child widget gets an update for the area outside the old mask.
     QTRY_COMPARE(child.numPaintEvents, 1);
     outsideOldMask = child.rect();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
     if (!child.internalWinId())
 #endif
@@ -8288,7 +8275,7 @@ void tst_QWidget::setClearAndResizeMask()
     // Mask child widget with a mask that is bigger than the rect
     child.setMask(QRegion(0, 0, 1000, 1000));
     QTest::qWait(100);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
     if (child.internalWinId())
         QTRY_COMPARE(child.numPaintEvents, 1);
@@ -8301,7 +8288,7 @@ void tst_QWidget::setClearAndResizeMask()
     // ...and the same applies when clearing the mask.
     child.clearMask();
     QTest::qWait(100);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
     if (child.internalWinId())
         QTRY_VERIFY(child.numPaintEvents > 0);
@@ -8331,7 +8318,7 @@ void tst_QWidget::setClearAndResizeMask()
 
     QTimer::singleShot(100, &resizeChild, SLOT(shrinkMask()));
     QTest::qWait(200);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
     if (child.internalWinId())
         QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask());
@@ -8343,7 +8330,7 @@ void tst_QWidget::setClearAndResizeMask()
     const QRegion oldMask = resizeChild.mask();
     QTimer::singleShot(0, &resizeChild, SLOT(enlargeMask()));
     QTest::qWait(100);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
     if (child.internalWinId())
         QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask());
@@ -9218,7 +9205,7 @@ void tst_QWidget::childAt()
     QCOMPARE(parent.childAt(120, 120), grandChild);
 }
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 void tst_QWidget::childAt_unifiedToolBar()
 {
     QLabel *label = new QLabel(QLatin1String("foo"));
index ee3b51a..23a308d 100644 (file)
@@ -40,7 +40,7 @@
 ****************************************************************************/
 #include <QtCore/QString>
 #include <QtCore/QPair>
-#include <QtGui/QWidget>
+#include <QtWidgets/QWidget>
 
 #pragma once // Yeah, it's deprecated in general, but it's standard practive for Mac OS X.
 
index e1aedb5..ae24735 100644 (file)
@@ -39,6 +39,9 @@
 **
 ****************************************************************************/
 
+// some versions of CALayer.h use 'slots' as an identifier
+#define QT_NO_KEYWORDS
+
 #include "tst_qwidget_mac_helpers.h"
 #include <QApplication>
 #include <QPlatformNativeInterface>
index 43ac7b3..17e0308 100644 (file)
@@ -198,7 +198,7 @@ void tst_QWidget_window::tst_windowFilePathAndwindowTitle_data()
     QTest::newRow("always set title, not appName") << true << true << validPath << QString() << windowTitle << windowTitle << windowTitle;
 
     QString platString =
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
         fileNameOnly;
 #else
         fileAndApp;
index 9c40c0c..7f503a5 100644 (file)
@@ -75,7 +75,7 @@
 
 #include <QCleanlooksStyle>
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <QMacStyle>
 #endif
 
@@ -561,7 +561,7 @@ qDebug("TEST PAINTING");
 
 void tst_QStyle::testMacStyle()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QMacStyle mstyle;
     QVERIFY(testAllFunctions(&mstyle));
 #endif
index df0e89f..c01a09e 100644 (file)
@@ -125,7 +125,7 @@ public:
             opt.palette = palette();
             opt.state = QStyle::State_None;
             style()->drawPrimitive(QStyle::PE_FrameFocusRect, &opt, &p, this);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
             p.setPen(Qt::red);
             p.drawRect(r);
 #endif
@@ -361,17 +361,17 @@ void tst_QAbstractButton::setText()
     QCOMPARE( testWidget->text(), QString("simple") );
     testWidget->setText("&ampersand");
     QCOMPARE( testWidget->text(), QString("&ampersand") );
-#ifndef Q_WS_MAC // no mneonics on Mac.
+#ifndef Q_OS_MAC // no mneonics on Mac.
     QCOMPARE( testWidget->shortcut(), QKeySequence("ALT+A"));
 #endif
     testWidget->setText("te&st");
     QCOMPARE( testWidget->text(), QString("te&st") );
-#ifndef Q_WS_MAC // no mneonics on Mac.
+#ifndef Q_OS_MAC // no mneonics on Mac.
     QCOMPARE( testWidget->shortcut(), QKeySequence("ALT+S"));
 #endif
     testWidget->setText("foo");
     QCOMPARE( testWidget->text(), QString("foo") );
-#ifndef Q_WS_MAC // no mneonics on Mac.
+#ifndef Q_OS_MAC // no mneonics on Mac.
     QCOMPARE( testWidget->shortcut(), QKeySequence());
 #endif
 }
index 1307be3..c046f9f 100644 (file)
@@ -732,7 +732,7 @@ void tst_QAbstractSlider::wheelEvent_data()
                                    << 1                                  // delta
                                    << int(Qt::Vertical)                  // orientation of slider
                                    << int(Qt::Vertical)                  // orientation of wheel
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
                                    << 1                                  // expected position after
 #else
                                    // We don't restrict scrolling to pageStep on Mac
@@ -750,7 +750,7 @@ void tst_QAbstractSlider::wheelEvent_data()
                                         << 1                             // delta
                                         << int(Qt::Horizontal)           // orientation of slider
                                         << int(Qt::Vertical)             // orientation of wheel
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
                                         << 1                             // expected position after
 #else
                                         // We don't restrict scrolling to pageStep on Mac
@@ -769,7 +769,7 @@ void tst_QAbstractSlider::wheelEvent_data()
                                         << 1                             // delta
                                         << int(Qt::Horizontal)           // orientation of slider
                                         << int(Qt::Vertical)             // orientation of wheel
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
                                         << 1                             // expected position after
 #else
                                         // We don't restrict scrolling to pageStep on Mac
index 322be4b..d5885dd 100644 (file)
@@ -53,7 +53,7 @@
 #include <qpushbutton.h>
 #include <qlineedit.h>
 #include <qtoolbutton.h>
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <qsettings.h>
 #endif
 
index 4695ac3..6e2d3e7 100644 (file)
@@ -58,7 +58,7 @@
 #include <qtablewidget.h>
 #include <qscrollbar.h>
 #include <qboxlayout.h>
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <qmacstyle_mac.h>
 #elif defined Q_WS_X11
 #include <private/qt_x11_p.h>
@@ -455,7 +455,7 @@ void tst_QComboBox::setEditable()
 
 void tst_QComboBox::setPalette()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     if (qobject_cast<QMacStyle *>(testWidget->style())) {
         QSKIP("This test doesn't make sense for pixmap-based styles");
     }
index efd7ac5..e6d07cb 100644 (file)
@@ -780,7 +780,7 @@ void tst_QDateTimeEdit::selectAndScrollWithKeys()
     testWidget->setDate(QDate(2004, 05, 11));
     testWidget->setDisplayFormat("dd/MM/yyyy");
     testWidget->show();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -819,7 +819,7 @@ void tst_QDateTimeEdit::selectAndScrollWithKeys()
     QCOMPARE(testWidget->lineEdit()->selectedText(), QString("2004"));
 
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_End);
@@ -846,7 +846,7 @@ void tst_QDateTimeEdit::selectAndScrollWithKeys()
     QCOMPARE(testWidget->lineEdit()->selectedText(), QString("11/05/2004"));
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ShiftModifier);
     QCOMPARE(testWidget->lineEdit()->selectedText(), QString("11/05/2004"));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -862,7 +862,7 @@ void tst_QDateTimeEdit::selectAndScrollWithKeys()
     QCOMPARE(testWidget->currentSection(), QDateTimeEdit::DaySection);
     QCOMPARE(testWidget->lineEdit()->selectedText(), QString("11"));
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -882,7 +882,7 @@ void tst_QDateTimeEdit::backspaceKey()
     testWidget->setDate(QDate(2004, 05, 11));
     testWidget->setDisplayFormat("d/MM/yyyy");
     testWidget->show();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_End);
@@ -896,7 +896,7 @@ void tst_QDateTimeEdit::backspaceKey()
     for (int i=0;i<3;i++)
        QTest::keyClick(testWidget, Qt::Key_Left);
     QCOMPARE(testWidget->text(), QString("11/05/2004"));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_End);
@@ -911,7 +911,7 @@ void tst_QDateTimeEdit::backspaceKey()
     QTest::keyClick(testWidget, Qt::Key_Backspace);
     QCOMPARE(testWidget->text(), QString("11/0/2004"));
     testWidget->interpretText();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_End);
@@ -945,7 +945,7 @@ void tst_QDateTimeEdit::deleteKey()
     qApp->setActiveWindow(testWidget);
     testWidget->setDate(QDate(2004, 05, 11));
     testWidget->setDisplayFormat("d/MM/yyyy");
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -1019,21 +1019,21 @@ void tst_QDateTimeEdit::enterKey()
     testWidget->setDisplayFormat("prefix d/MM/yyyy 'suffix'");
     testWidget->lineEdit()->setFocus();
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
 #endif
     QTest::keyClick(testWidget, Qt::Key_Enter);
     QVERIFY(!testWidget->lineEdit()->hasSelectedText());
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_End);
 #endif
     QTest::keyClick(testWidget, Qt::Key_Enter);
     QVERIFY(!testWidget->lineEdit()->hasSelectedText());
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -1096,7 +1096,7 @@ void tst_QDateTimeEdit::specialValueText()
     QCOMPARE(testWidget->date(), QDate(2000, 1, 1));
     QCOMPARE(testWidget->text(), QString("fOo"));
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_End);
@@ -1107,7 +1107,7 @@ void tst_QDateTimeEdit::specialValueText()
     QTest::keyClick(testWidget, Qt::Key_Down);
     QCOMPARE(testWidget->text(), QString("fOo"));
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_End);
@@ -2538,7 +2538,7 @@ void tst_QDateTimeEdit::newCase()
     testWidget->setDisplayFormat("MMMM'a'MbMMMcMM");
     testWidget->setDate(QDate(2005, 6, 1));
     QCOMPARE(testWidget->text(), QString("Junea6bJunc06"));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -2546,7 +2546,7 @@ void tst_QDateTimeEdit::newCase()
     QTest::keyClick(testWidget, Qt::Key_Up);
     QCOMPARE(testWidget->text(), QString("Julya7bJulc07"));
     QCOMPARE(testWidget->lineEdit()->selectedText(), QString("July"));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -2619,7 +2619,7 @@ void tst_QDateTimeEdit::cursorPos()
     //l.exec();
     QTest::keyClick(testWidget, Qt::Key_Y);
     QCOMPARE(testWidget->lineEdit()->cursorPosition(), 11);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -2649,7 +2649,7 @@ void tst_QDateTimeEdit::newCase5()
     testWidget->setDateTime(QDateTime(QDate(2005, 10, 7), QTime(17, 44, 13, 100)));
     testWidget->show();
     QCOMPARE(testWidget->lineEdit()->displayText(), QString("2005-10-07 17:44:13 100 ms"));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_End);
@@ -2672,7 +2672,7 @@ void tst_QDateTimeEdit::newCase6()
     testWidget->setDate(QDate(2005, 10, 7));
     testWidget->show();
     QCOMPARE(testWidget->lineEdit()->displayText(), QString("7-2005-10-07"));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -2745,7 +2745,7 @@ void tst_QDateTimeEdit::setCurrentSection()
     QCOMPARE(setCurrentSections.size(), expectedCursorPositions.size());
     testWidget->setDisplayFormat(format);
     testWidget->setDateTime(dateTime);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -2765,7 +2765,7 @@ void tst_QDateTimeEdit::setSelectedSection()
     testWidget->setDisplayFormat("mm.ss.zzz('ms') m");
     testWidget->setTime(QTime(0, 0, 9));
     testWidget->show();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_Home);
@@ -2882,7 +2882,7 @@ void tst_QDateTimeEdit::reverseTest()
     testWidget->setDisplayFormat("dd/MM/yyyy");
     testWidget->setDate(QDate(2001, 3, 30));
     QCOMPARE(testWidget->lineEdit()->displayText(), QString("2001/03/30"));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_End);
@@ -3033,7 +3033,7 @@ void tst_QDateTimeEdit::ddMMMMyyyy()
     testWidget->setCurrentSection(QDateTimeEdit::YearSection);
     QTest::keyClick(testWidget, Qt::Key_Enter);
     QCOMPARE(testWidget->lineEdit()->selectedText(), QString("2000"));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(testWidget, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(testWidget, Qt::Key_End);
@@ -3322,7 +3322,7 @@ void tst_QDateTimeEdit::potentialYYValueBug()
     edit.setDate(edit.minimumDate());
     edit.lineEdit()->setFocus();
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(&edit, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(&edit, Qt::Key_End);
@@ -3337,7 +3337,7 @@ void tst_QDateTimeEdit::textSectionAtEnd()
     edit.setDisplayFormat("MMMM");
     edit.setDate(QDate(2000, 1, 1));
     edit.lineEdit()->setFocus();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(&edit, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(&edit, Qt::Key_End);
@@ -3363,7 +3363,7 @@ void tst_QDateTimeEdit::keypadAutoAdvance()
     EditorDateEdit edit;
     edit.setDate(QDate(2000, 2, 1));
     edit.setDisplayFormat("dd/MM");
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(&edit, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(&edit, Qt::Key_Home);
index 597ec80..fc393c6 100644 (file)
@@ -268,7 +268,7 @@ void tst_QDoubleSpinBox::setTracking_data()
     QTestEventList keys;
     QStringList texts1;
     QStringList texts2;
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     keys.addKeyClick(Qt::Key_Right, Qt::ControlModifier);
 #else
     keys.addKeyClick(Qt::Key_End);
@@ -343,7 +343,7 @@ void tst_QDoubleSpinBox::setWrapping_data()
 
     keys.clear();
     values.clear();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     keys.addKeyClick(Qt::Key_Right, Qt::ControlModifier);
 #else
     keys.addKeyClick(Qt::Key_End);
@@ -358,7 +358,7 @@ void tst_QDoubleSpinBox::setWrapping_data()
 
     keys.clear();
     values.clear();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     keys.addKeyClick(Qt::Key_Left, Qt::ControlModifier);
 #else
     keys.addKeyClick(Qt::Key_Home);
@@ -625,7 +625,7 @@ void tst_QDoubleSpinBox::setDecimals()
         QCOMPARE(spin.text(), expected);
 
     if (spin.decimals() > 0) {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
         QTest::keyClick(&spin, Qt::Key_Right, Qt::ControlModifier);
 #else
         QTest::keyClick(&spin, Qt::Key_End);
@@ -830,13 +830,13 @@ void tst_QDoubleSpinBox::removeAll()
     spin.setValue(0.2);
     spin.setDecimals(1);
     spin.show();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(&spin, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(&spin, Qt::Key_Home);
 #endif
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(&spin, Qt::Key_Right, Qt::ControlModifier|Qt::ShiftModifier);
 #else
     QTest::keyClick(&spin, Qt::Key_End, Qt::ShiftModifier);
@@ -883,7 +883,7 @@ void tst_QDoubleSpinBox::germanTest()
     DoubleSpinBox spin;
     spin.show();
     spin.setValue(2.12);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(&spin, Qt::Key_Right, Qt::ControlModifier);
 #else
     QTest::keyClick(&spin, Qt::Key_End);
@@ -901,7 +901,7 @@ void tst_QDoubleSpinBox::doubleDot()
     spin.setValue(2.12);
     QTest::keyClick(&spin, Qt::Key_Backspace);
     QCOMPARE(spin.text(), QString("2.12"));
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(&spin, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(&spin, Qt::Key_Home);
index 8366f61..e94fd18 100644 (file)
@@ -53,7 +53,7 @@
 #include "qclipboard.h"
 #endif
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <Carbon/Carbon.h> // For the random function.
 #include <cstdlib> // For the random function.
 #endif
@@ -1408,7 +1408,7 @@ void tst_QLineEdit::undo_keypressevents()
 #ifndef QT_NO_CLIPBOARD
 static bool nativeClipboardWorking()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     PasteboardRef pasteboard;
     OSStatus status = PasteboardCreate(0, &pasteboard);
     if (status == noErr)
@@ -1811,7 +1811,7 @@ void tst_QLineEdit::isReadOnly()
 
 static void figureOutProperKey(Qt::Key &key, Qt::KeyboardModifiers &pressState)
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     static bool tst_lineedit_randomized = false;
     // Mac has 3 different ways of accomplishing this (same for moving to the back)
     // So I guess we should just randomly do this for now. Which may get people mad, but if
@@ -2015,14 +2015,14 @@ void tst_QLineEdit::cursorPositionChanged_data()
     keys.addKeyClick(Qt::Key_Home);
     keys.addKeyClick(Qt::Key_Right, Qt::ControlModifier);
     QTest::newRow("abc efg<home><ctrl-right>") << keys
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
         << 0 << 4;
 #else
         << 6 << 7;
 #endif
     keys.clear();
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     keys.addKeyClick(Qt::Key_A);
     keys.addKeyClick(Qt::Key_B);
     keys.addKeyClick(Qt::Key_C);
@@ -2045,13 +2045,13 @@ void tst_QLineEdit::cursorPositionChanged_data()
     keys.addKeyClick(Qt::Key_F);
     keys.addKeyClick(Qt::Key_Left, Qt::ControlModifier);
     QTest::newRow("abc efg<ctrl-left>") << keys << 7
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
         << 4;
 #else
         << 0;
 #endif
     keys.clear();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     keys.addKeyClick(Qt::Key_A);
     keys.addKeyClick(Qt::Key_B);
     keys.addKeyClick(Qt::Key_C);
@@ -2793,7 +2793,7 @@ void tst_QLineEdit::setSelection()
 #ifndef QT_NO_CLIPBOARD
 void tst_QLineEdit::cut()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     {
         PasteboardRef pasteboard;
         OSStatus status = PasteboardCreate(0, &pasteboard);
@@ -3123,7 +3123,7 @@ void tst_QLineEdit::inlineCompletion()
     QCOMPARE(testWidget->selectedText(), QString("tem1"));
 
     Qt::KeyboardModifiers keyboardModifiers = Qt::ControlModifier;
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     keyboardModifiers |= Qt::AltModifier;
 #endif
     QTest::keyClick(testWidget, Qt::Key_Down, keyboardModifiers);
index 6e1524c..1b373fe 100644 (file)
@@ -101,7 +101,7 @@ static bool tabBetweenSubWindowsIn(QMdiArea *mdiArea, int tabCount = -1, bool re
 
     Qt::KeyboardModifiers modifiers = reverse ? Qt::ShiftModifier : Qt::NoModifier;
     Qt::Key key;
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     key = Qt::Key_Meta;
     modifiers |= Qt::MetaModifier;
 #else
@@ -194,7 +194,7 @@ static bool verifyArrangement(QMdiArea *mdiArea, Arrangement arrangement, const
         QStyleOptionTitleBar options;
         options.initFrom(firstSubWindow);
         int titleBarHeight = firstSubWindow->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
         // ### Remove this after the mac style has been fixed
         if (qobject_cast<QMacStyle *>(firstSubWindow->style()))
             titleBarHeight -= 4;
@@ -444,7 +444,7 @@ void tst_QMdiArea::subWindowActivated()
     }
 }
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <Security/AuthSession.h>
 bool macHasAccessToWindowsServer()
 {
@@ -519,7 +519,7 @@ void tst_QMdiArea::subWindowActivated2()
     mdiArea.showMinimized();
 #ifdef Q_WS_X11
     qt_x11_wait_for_window_manager(&mdiArea);
-#elif defined (Q_WS_MAC)
+#elif defined (Q_OS_MAC)
     if (!macHasAccessToWindowsServer())
         QEXPECT_FAIL("", "showMinimized doesn't really minimize if you don't have access to the server", Abort);
 #endif
@@ -657,7 +657,7 @@ void tst_QMdiArea::changeWindowTitle()
 #else
     widget->setWindowState(Qt::WindowMaximized);
 #endif
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
 #endif
 
@@ -667,7 +667,7 @@ void tst_QMdiArea::changeWindowTitle()
     qApp->processEvents();
     QTest::qWaitForWindowShown(mw);
 
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
 #endif
 
@@ -685,7 +685,7 @@ void tst_QMdiArea::changeWindowTitle()
     widget->setWindowState(Qt::WindowMaximized);
 #endif
     qApp->processEvents();
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
     widget->setWindowTitle( wc2 );
     QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc2) );
@@ -703,7 +703,7 @@ void tst_QMdiArea::changeWindowTitle()
 #endif
 
     qApp->processEvents();
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc2).arg(wc2) );
 #endif
 #ifdef USE_SHOW
@@ -712,7 +712,7 @@ void tst_QMdiArea::changeWindowTitle()
     widget->setWindowState(Qt::WindowNoState);
 #endif
     qApp->processEvents();
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE)
     QCOMPARE(mw->windowTitle(), mwc);
 #else
     QCOMPARE( mw->windowTitle(), mwc2 );
@@ -724,7 +724,7 @@ void tst_QMdiArea::changeWindowTitle()
     widget->setWindowState(Qt::WindowMaximized);
 #endif
     qApp->processEvents();
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     QCOMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc2).arg(wc2) );
 #endif
 
@@ -773,7 +773,7 @@ void tst_QMdiArea::changeModified()
     QCOMPARE( mw->isWindowModified(), false);
     QCOMPARE( widget->isWindowModified(), true);
     widget->setWindowState(Qt::WindowMaximized);
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     QCOMPARE( mw->isWindowModified(), true);
 #endif
     QCOMPARE( widget->isWindowModified(), true);
@@ -783,7 +783,7 @@ void tst_QMdiArea::changeModified()
     QCOMPARE( widget->isWindowModified(), true);
 
     widget->setWindowState(Qt::WindowMaximized);
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     QCOMPARE( mw->isWindowModified(), true);
 #endif
     QCOMPARE( widget->isWindowModified(), true);
@@ -793,7 +793,7 @@ void tst_QMdiArea::changeModified()
     QCOMPARE( widget->isWindowModified(), false);
 
     widget->setWindowModified(true);
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     QCOMPARE( mw->isWindowModified(), true);
 #endif
     QCOMPARE( widget->isWindowModified(), true);
@@ -1029,7 +1029,7 @@ void tst_QMdiArea::activeSubWindow()
     qApp->setActiveWindow(&mainWindow);
     QCOMPARE(mdiArea->activeSubWindow(), subWindow);
 
-#if !defined(Q_WS_MAC) && !defined(Q_WS_WIN)
+#if !defined(Q_OS_MAC) && !defined(Q_WS_WIN)
     qApp->setActiveWindow(0);
     QVERIFY(!mdiArea->activeSubWindow());
 #endif
@@ -1114,7 +1114,7 @@ void tst_QMdiArea::currentSubWindow()
     QVERIFY(mdiArea.activeSubWindow());
     QVERIFY(mdiArea.currentSubWindow());
 
-#if !defined(Q_WS_MAC) && !defined(Q_WS_WIN)
+#if !defined(Q_OS_MAC) && !defined(Q_WS_WIN)
     qApp->setActiveWindow(0);
     QVERIFY(!mdiArea.activeSubWindow());
     QVERIFY(mdiArea.currentSubWindow());
@@ -2042,7 +2042,7 @@ void tst_QMdiArea::delayedPlacement()
 
 void tst_QMdiArea::iconGeometryInMenuBar()
 {
-#if !defined (Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined (Q_OS_MAC) && !defined(Q_OS_WINCE)
     QMainWindow mainWindow;
     QMenuBar *menuBar = mainWindow.menuBar();
     QMdiArea *mdiArea = new QMdiArea;
index 8f4c2a9..5f799e1 100644 (file)
@@ -59,7 +59,7 @@
 #include <QStyleOptionTitleBar>
 #include <QPushButton>
 #include <QSizeGrip>
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
 #include <QMacStyle>
 #endif
 
@@ -189,7 +189,7 @@ private slots:
     void setWindowTitle();
     void resizeEvents_data();
     void resizeEvents();
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
     void defaultSizeGrip();
 #endif
     void hideAndShow();
@@ -197,7 +197,7 @@ private slots:
     void explicitlyHiddenWidget();
     void resizeTimer();
     void fixedMinMaxSize();
-#if !defined (Q_WS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
     void replaceMenuBarWhileMaximized();
     void closeOnDoubleClick();
 #endif
@@ -374,7 +374,7 @@ void tst_QMdiSubWindow::mainWindowSupport()
     qApp->setActiveWindow(&mainWindow);
 
     // QMainWindow's window title is empty
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     {
     QCOMPARE(mainWindow.windowTitle(), QString());
     QMdiSubWindow *window = workspace->addSubWindow(new QPushButton(QLatin1String("Test")));
@@ -426,7 +426,7 @@ void tst_QMdiSubWindow::mainWindowSupport()
         window->showMaximized();
         qApp->processEvents();
         QVERIFY(window->isMaximized());
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
         QVERIFY(window->maximizedButtonsWidget());
         QCOMPARE(window->maximizedButtonsWidget(), mainWindow.menuBar()->cornerWidget(Qt::TopRightCorner));
         QVERIFY(window->maximizedSystemMenuIconWidget());
@@ -448,13 +448,13 @@ void tst_QMdiSubWindow::mainWindowSupport()
         QVERIFY(!nestedWindow->maximizedButtonsWidget());
         QVERIFY(!nestedWindow->maximizedSystemMenuIconWidget());
 
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
         QCOMPARE(mainWindow.windowTitle(), QString::fromLatin1("%1 - [%2]")
                                            .arg(originalWindowTitle, window->widget()->windowTitle()));
 #endif
     }
 
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE)
     return;
 #endif
 
@@ -605,7 +605,7 @@ void tst_QMdiSubWindow::showShaded()
     int offset = window->style()->pixelMetric(QStyle::PM_MDIFrameWidth) / 2;
     QPoint mousePosition(window->width() - qMax(offset, 2), window->height() - qMax(offset, 2));
     QWidget *mouseReceiver = 0;
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     if (qobject_cast<QMacStyle*>(window->style()))
         mouseReceiver = qFindChild<QSizeGrip *>(window);
     else
@@ -789,7 +789,7 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove()
     QStyleOptionTitleBar options;
     options.initFrom(window);
     int height = window->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options);
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
     // ### Remove this after mac style has been fixed
     height -= 4;
 #endif
@@ -1039,7 +1039,7 @@ void tst_QMdiSubWindow::setSystemMenu()
     systemMenu->hide();
     QVERIFY(!qApp->activePopupWidget());
 
-#if !defined (Q_WS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
     // System menu in menu bar.
     subWindow->showMaximized();
     QVERIFY(subWindow->isMaximized());
@@ -1072,7 +1072,7 @@ void tst_QMdiSubWindow::setSystemMenu()
     systemMenu->hide();
     QVERIFY(!qApp->activePopupWidget());
 
-#if !defined (Q_WS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
     // System menu in menu bar in reverse mode.
     subWindow->showMaximized();
     QVERIFY(subWindow->isMaximized());
@@ -1422,7 +1422,7 @@ void tst_QMdiSubWindow::resizeEvents()
     QCOMPARE(widgetResizeEventSpy.count(), expectedWidgetResizeEvents);
 }
 
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
 void tst_QMdiSubWindow::defaultSizeGrip()
 {
     if (!qApp->style()->inherits("QMacStyle"))
@@ -1463,7 +1463,7 @@ void tst_QMdiSubWindow::hideAndShow()
     QVERIFY(!menuBar->cornerWidget(Qt::TopRightCorner));
     QMdiSubWindow *subWindow = mdiArea->addSubWindow(new QTextEdit);
     subWindow->showMaximized();
-#if !defined (Q_WS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
     QVERIFY(menuBar->cornerWidget(Qt::TopRightCorner));
     QCOMPARE(menuBar->cornerWidget(Qt::TopRightCorner), subWindow->maximizedButtonsWidget());
 #endif
@@ -1478,7 +1478,7 @@ void tst_QMdiSubWindow::hideAndShow()
     // Show QMdiArea.
     tabWidget->setCurrentIndex(0);
 
-#if !defined (Q_WS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
     QVERIFY(menuBar->cornerWidget(Qt::TopRightCorner));
     QVERIFY(subWindow->maximizedButtonsWidget());
     QVERIFY(subWindow->maximizedSystemMenuIconWidget());
@@ -1500,7 +1500,7 @@ void tst_QMdiSubWindow::hideAndShow()
     QVERIFY(subWindow);
     QCOMPARE(mdiArea->activeSubWindow(), subWindow);
 
-#if !defined (Q_WS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
     QVERIFY(menuBar->cornerWidget(Qt::TopRightCorner));
     QVERIFY(subWindow->maximizedButtonsWidget());
     QVERIFY(subWindow->maximizedSystemMenuIconWidget());
@@ -1515,7 +1515,7 @@ void tst_QMdiSubWindow::hideAndShow()
         QCOMPARE(window->size(), window->sizeHint());
 
     subWindow->showMaximized();
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     QCOMPARE(menuBar->cornerWidget(Qt::TopRightCorner), subWindow->maximizedButtonsWidget());
 #endif
 
@@ -1525,7 +1525,7 @@ void tst_QMdiSubWindow::hideAndShow()
     QVERIFY(!menuBar->cornerWidget(Qt::TopRightCorner));
 
     subWindow->show();
-#if !defined (Q_WS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
     QVERIFY(subWindow->maximizedButtonsWidget());
     QVERIFY(subWindow->maximizedSystemMenuIconWidget());
     QCOMPARE(menuBar->cornerWidget(Qt::TopRightCorner), subWindow->maximizedButtonsWidget());
@@ -1539,7 +1539,7 @@ void tst_QMdiSubWindow::hideAndShow()
 
     // Show QMainWindow.
     mainWindow.show();
-#if !defined (Q_WS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
     QVERIFY(subWindow->maximizedButtonsWidget());
     QVERIFY(subWindow->maximizedSystemMenuIconWidget());
     QCOMPARE(menuBar->cornerWidget(Qt::TopRightCorner), subWindow->maximizedButtonsWidget());
@@ -1686,7 +1686,7 @@ void tst_QMdiSubWindow::fixedMinMaxSize()
     QStyleOptionTitleBar options;
     options.initFrom(subWindow);
     int minimizedHeight = subWindow->style()->pixelMetric(QStyle::PM_TitleBarHeight, &options);
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
     // ### Remove this after mac style has been fixed
     if (qobject_cast<QMacStyle *>(subWindow->style()))
         minimizedHeight -= 4;
@@ -1720,7 +1720,7 @@ void tst_QMdiSubWindow::fixedMinMaxSize()
     QCOMPARE(subWindow->size(), minimumSize);
 }
 
-#if !defined( Q_WS_MAC) && !defined( Q_OS_WINCE)
+#if !defined( Q_OS_MAC) && !defined( Q_OS_WINCE)
 void tst_QMdiSubWindow::replaceMenuBarWhileMaximized()
 {
 
@@ -1894,7 +1894,7 @@ void tst_QMdiSubWindow::mdiArea()
 
 void tst_QMdiSubWindow::task_182852()
 {
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
 
     QMdiArea *workspace = new QMdiArea;
     QMainWindow mainWindow;
index b61398a..9263ad0 100644 (file)
@@ -365,7 +365,7 @@ void tst_QMenu::keyboardNavigation()
         QCOMPARE(highlighted, (QAction *)0);
 }
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 QT_BEGIN_NAMESPACE
     extern bool qt_tab_all_widgets; // from qapplication.cpp
 QT_END_NAMESPACE
@@ -378,7 +378,7 @@ void tst_QMenu::focus()
     menu.addAction("Two");
     menu.addAction("Three");
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     if (!qt_tab_all_widgets)
         QSKIP("Computer is currently set up to NOT tab to all widgets,"
              " this test assumes you can tab to all widgets");
@@ -418,7 +418,7 @@ void tst_QMenu::overrideMenuAction()
 
     // On Mac and Windows CE, we need to create native key events to test menu
     // action activation, so skip this part of the test.
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     QAction *aQuit = new QAction("Quit", &w);
     aQuit->setShortcut(QKeySequence("Ctrl+X"));
     m->addAction(aQuit);
index 5747f0b..ff8da6e 100644 (file)
@@ -330,7 +330,7 @@ void tst_QMenuBar::onActivated( QAction* action )
 
 void tst_QMenuBar::accel()
 {
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE_WM)
     QSKIP("On Mac/WinCE, native key events are needed to test menu action activation");
 #endif
 
@@ -348,7 +348,7 @@ void tst_QMenuBar::accel()
 
 void tst_QMenuBar::activatedCount()
 {
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE_WM)
     QSKIP("On Mac/WinCE, native key events are needed to test menu action activation");
 #endif
     // create a popup menu with menu items set the accelerators later...
@@ -562,7 +562,7 @@ void tst_QMenuBar::insertItem_QString_QObject()
 
 void tst_QMenuBar::check_accelKeys()
 {
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE_WM)
     QSKIP("On Mac/WinCE, native key events are needed to test menu action activation");
 #endif
     initComplexMenubar();
@@ -631,7 +631,7 @@ void tst_QMenuBar::check_accelKeys()
 
 void tst_QMenuBar::check_cursorKeys1()
 {
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE_WM)
     QSKIP("Qt/Mac,WinCE does not use the native popups/menubar");
 #endif
 
@@ -662,7 +662,7 @@ void tst_QMenuBar::check_cursorKeys1()
 
 void tst_QMenuBar::check_cursorKeys2()
 {
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE_WM)
     QSKIP("Qt/Mac,WinCE does not use the native popups/menubar");
 #endif
 
@@ -692,7 +692,7 @@ void tst_QMenuBar::check_cursorKeys2()
 */
 void tst_QMenuBar::check_cursorKeys3()
 {
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE_WM)
     QSKIP("Qt/Mac,WinCE does not use the native popups/menubar");
 #endif
 
@@ -796,7 +796,7 @@ void tst_QMenuBar::check_endKey()
 
 void tst_QMenuBar::check_escKey()
 {
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE_WM)
     QSKIP("Qt/Mac,WinCE does not use the native popups/menubar");
 #endif
 
@@ -939,7 +939,7 @@ void tst_QMenuBar::check_escKey()
 void
 tst_QMenuBar::allowActiveAndDisabled()
 {
-#if !defined(Q_WS_MAC) && !defined(Q_OS_WINCE_WM)
+#if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE_WM)
     mb->hide();
     mb->clear();
 
@@ -977,7 +977,7 @@ tst_QMenuBar::allowActiveAndDisabled()
         QCOMPARE(mb->activeAction()->text(), fileMenu.title());
 
     mb->hide();
-#endif //Q_WS_MAC
+#endif //Q_OS_MAC
 }
 
 void tst_QMenuBar::check_altPress()
@@ -999,7 +999,7 @@ void tst_QMenuBar::check_altPress()
 
 void tst_QMenuBar::check_shortcutPress()
 {
-#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
+#if defined(Q_OS_MAC) || defined(Q_OS_WINCE_WM)
     QSKIP("Qt/Mac,WinCE does not use the native popups/menubar");
 #endif
 
@@ -1020,7 +1020,7 @@ void tst_QMenuBar::check_shortcutPress()
 
 void tst_QMenuBar::check_menuPosition()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QSKIP("Qt/Mac does not use the native popups/menubar");
 #endif
 #ifdef Q_OS_WINCE_WM
@@ -1234,7 +1234,7 @@ void tst_QMenuBar::menubarSizeHint()
 
 void tst_QMenuBar::taskQTBUG4965_escapeEaten()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QSKIP("On Mac, do not test the menubar with escape key");
 #endif
     QMenuBar menubar;
index ae00a9c..87eaa44 100644 (file)
@@ -66,7 +66,7 @@ Q_DECLARE_METATYPE(pairListType);
 Q_DECLARE_METATYPE(keyPairType);
 Q_DECLARE_METATYPE(QList<bool>);
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <Carbon/Carbon.h>
 #endif
 
@@ -161,7 +161,7 @@ private:
 
 bool tst_QPlainTextEdit::nativeClipboardWorking()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     PasteboardRef pasteboard;
     OSStatus status = PasteboardCreate(0, &pasteboard);
     if (status == noErr)
@@ -286,14 +286,14 @@ void tst_QPlainTextEdit::createSelection()
 {
     QTest::keyClicks(ed, "Hello World");
     /* go to start */
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     QTest::keyClick(ed, Qt::Key_Home, Qt::ControlModifier);
 #else
     QTest::keyClick(ed, Qt::Key_Home);
 #endif
     QCOMPARE(ed->textCursor().position(), 0);
     /* select until end of text */
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     QTest::keyClick(ed, Qt::Key_End, Qt::ControlModifier | Qt::ShiftModifier);
 #else
     QTest::keyClick(ed, Qt::Key_End, Qt::ShiftModifier);
@@ -1008,7 +1008,7 @@ void tst_QPlainTextEdit::copyAvailable()
     QFETCH(QList<bool>, copyAvailable);
     QFETCH(QString, function);
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QSKIP("QTBUG-22283: copyAvailable has never passed on Mac");
 #endif
     ed->clear();
index a5f5162..da63157 100644 (file)
@@ -176,7 +176,7 @@ void tst_QProgressBar::format()
     bar.setFormat("%v of %m (%p%)");
     qApp->processEvents();
 
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     // Animated scroll bars get paint events all the time
 #ifdef Q_OS_WIN
     if (QSysInfo::WindowsVersion < QSysInfo::WV_VISTA)
index c9150cb..c888f63 100644 (file)
@@ -136,7 +136,7 @@ void tst_QScrollBar::task_209492()
     QApplication::sendEvent(verticalScrollBar, &mouseReleaseEvent);
 
     // Check that the action was triggered once.
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QEXPECT_FAIL("", "Fix does does not work on Mac due to paint architechure differences.", Abort);
 #endif
     QCOMPARE(scrollArea.scrollCount, 1);
index 87067ac..eedc5ce 100644 (file)
@@ -137,7 +137,7 @@ void tst_QSizeGrip::hideAndShowOnWindowStateChange()
     QVERIFY(sizeGrip->isVisible());
 
     widget->showMaximized();
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     QVERIFY(!sizeGrip->isVisible());
 #else
     QVERIFY(sizeGrip->isVisible());
index a58705f..9fef691 100644 (file)
@@ -378,7 +378,7 @@ void tst_QSpinBox::setTracking_data()
     QStringList texts1;
     QStringList texts2;
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     keys.addKeyClick(Qt::Key_Right, Qt::ControlModifier);
 #else
     keys.addKeyClick(Qt::Key_End);
@@ -824,13 +824,13 @@ void tst_QSpinBox::removeAll()
     spin.setSuffix("bar");
     spin.setValue(2);
     spin.show();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(&spin, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(&spin, Qt::Key_Home);
 #endif
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(&spin, Qt::Key_Right, Qt::ControlModifier|Qt::ShiftModifier);
 #else
     QTest::keyClick(&spin, Qt::Key_End, Qt::ShiftModifier);
@@ -845,7 +845,7 @@ void tst_QSpinBox::startWithDash()
 {
     SpinBox spin(0);
     spin.show();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QTest::keyClick(&spin, Qt::Key_Left, Qt::ControlModifier);
 #else
     QTest::keyClick(&spin, Qt::Key_Home);
index 76ff4e1..9471f9c 100644 (file)
@@ -261,7 +261,7 @@ void tst_QStatusBar::QTBUG4334_hiddenOnMaximizedWindow()
     main.setStatusBar(&statusbar);
     main.showMaximized();
     QTest::qWaitForWindowShown(&main);
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     QVERIFY(!statusbar.findChild<QSizeGrip*>()->isVisible());
 #endif
     main.showNormal();
index b857af6..5278ff7 100644 (file)
@@ -579,7 +579,7 @@ void tst_QTabWidget::paintEventCount()
         4;
 #elif defined(Q_WS_WIN)
         2;
-#elif defined(Q_WS_MAC)
+#elif defined(Q_OS_MAC)
         5;
 #else
         2;
index c16f39a..afa0d84 100644 (file)
@@ -70,13 +70,13 @@ Q_DECLARE_METATYPE(keyPairType);
 Q_DECLARE_METATYPE(QList<bool>);
 Q_DECLARE_METATYPE(QList<int>);
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 #include <Carbon/Carbon.h>
 #endif
 
 bool nativeClipboardWorking()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     PasteboardRef pasteboard;
     OSStatus status = PasteboardCreate(0, &pasteboard);
     if (status == noErr)
@@ -215,7 +215,7 @@ private:
 
 bool tst_QTextEdit::nativeClipboardWorking()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     PasteboardRef pasteboard;
     OSStatus status = PasteboardCreate(0, &pasteboard);
     if (status == noErr)
@@ -475,14 +475,14 @@ void tst_QTextEdit::createSelection()
 {
     QTest::keyClicks(ed, "Hello World");
     /* go to start */
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     QTest::keyClick(ed, Qt::Key_Home, Qt::ControlModifier);
 #else
     QTest::keyClick(ed, Qt::Key_Home);
 #endif
     QCOMPARE(ed->textCursor().position(), 0);
     /* select until end of text */
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
     QTest::keyClick(ed, Qt::Key_End, Qt::ControlModifier | Qt::ShiftModifier);
 #else
     QTest::keyClick(ed, Qt::Key_End, Qt::ShiftModifier);
@@ -1355,7 +1355,7 @@ void tst_QTextEdit::copyAvailable()
     QFETCH(QList<bool>, copyAvailable);
     QFETCH(QString, function);
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     QSKIP("QTBUG-22283: copyAvailable has never passed on Mac");
 #endif
     ed->clear();
index d06ac59..c99309f 100644 (file)
@@ -1020,7 +1020,7 @@ void tst_QToolBar::widgetAction()
 
 void tst_QToolBar::accel()
 {
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     extern void qt_set_sequence_auto_mnemonic(bool b);
     qt_set_sequence_auto_mnemonic(true);
 #endif
@@ -1040,7 +1040,7 @@ void tst_QToolBar::accel()
     QTest::qWait(300);
 
     QTRY_COMPARE(spy.count(), 1);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
     qt_set_sequence_auto_mnemonic(false);
 #endif
 }
index 5ba6066..7dcc6a9 100644 (file)
@@ -230,7 +230,7 @@ void tst_QWorkspace::windowActivated()
         workspace->addWindow(widget);
         widget->showMaximized();
         qApp->sendPostedEvents();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
         QEXPECT_FAIL("", "This test has never passed on Mac. QWorkspace is obsoleted -> won't fix", Abort);
 #endif
         QCOMPARE(spy.count(), 0);