tst_QColorDialog();
virtual ~tst_QColorDialog();
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
public slots:
void postKeyReturn();
private slots:
{
}
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
//copied from QFontDialogTest
void tst_QColorDialog::postKeyReturn() {
QWidgetList list = QApplication::topLevelWidgets();
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)
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());
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);
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);
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]);
return;
}
}
-#else
- extern void click_cocoa_button();
- click_cocoa_button();
-#endif
}
void tst_QFontDialog::defaultOkButton()
#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)
void tst_QMessageBox::shortcut()
{
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
QSKIP("shortcuts are not used on MAC OS X");
#endif
QMessageBox msgBox;
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);
#endif
sendKeySoon();
QMessageBox::aboutQt(0, "Caption");
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
QTRY_COMPARE(keyToSend, -1);
#else
QCOMPARE(keyToSend, -1);
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)
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);
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.
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.
p->show();
QApplication::processEvents();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
QTest::qWait(200);
#endif
// 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);
// 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);
#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())
// 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
_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);
_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);
#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
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()))
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
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
void changeDataWithSorting();
void itemData();
void itemWidget();
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
void fastScroll();
#endif
void insertUnchanged();
QCOMPARE(list.itemWidget(item), static_cast<QWidget*>(0));
}
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
class MyListWidget : public QListWidget
{
public:
// 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()
{
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.
#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
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);
{
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;
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 {
# 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
}
#endif
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
#include <Security/AuthSession.h>
bool macHasAccessToWindowsServer()
{
#endif
void widgetAt();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
void sheetOpacity();
void setMask();
#endif
void update();
void isOpaque();
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
void scroll();
#endif
#ifndef Q_OS_IRIX
void doubleRepaint();
#endif
-#ifndef Q_WS_MAC
void resizeInPaintEvent();
void opaqueChildren();
-#endif
void setMaskInResizeEvent();
void moveInResizeEvent();
void taskQTBUG_7532_tabOrderWithFocusProxy();
void movedAndResizedAttributes();
void childAt();
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
void childAt_unifiedToolBar();
void taskQTBUG_11373();
#endif
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
void tst_QWidget::lostUpdatesOnHide()
{
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
UpdateWidget widget;
widget.setAttribute(Qt::WA_DontShowOnScreen);
widget.show();
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
#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);
delete w;
}
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
void tst_QWidget::sheetOpacity()
{
QWidget tmpWindow;
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
void tst_QWidget::isOpaque()
{
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
QWidget w;
QVERIFY(::isOpaque(&w));
#endif
}
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
/*
Test that scrolling of a widget invalidates the correct regions
*/
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());
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());
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
// 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)
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
#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
}
#endif
-#ifndef Q_WS_MAC
-// This test only makes sense on the Mac when passing -graphicssystem.
void tst_QWidget::resizeInPaintEvent()
{
QWidget window;
greatGrandChild.setAutoFillBackground(false);
QCOMPARE(qt_widget_private(&grandChild)->getOpaqueChildren(), QRegion());
}
-#endif
class MaskSetWidget : public QWidget
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);
// 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
// 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);
// ...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);
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());
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());
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"));
****************************************************************************/
#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.
**
****************************************************************************/
+// some versions of CALayer.h use 'slots' as an identifier
+#define QT_NO_KEYWORDS
+
#include "tst_qwidget_mac_helpers.h"
#include <QApplication>
#include <QPlatformNativeInterface>
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;
#include <QCleanlooksStyle>
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
#include <QMacStyle>
#endif
void tst_QStyle::testMacStyle()
{
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
QMacStyle mstyle;
QVERIFY(testAllFunctions(&mstyle));
#endif
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
QCOMPARE( testWidget->text(), QString("simple") );
testWidget->setText("&ersand");
QCOMPARE( testWidget->text(), QString("&ersand") );
-#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
}
<< 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
<< 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
<< 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
#include <qpushbutton.h>
#include <qlineedit.h>
#include <qtoolbutton.h>
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
#include <qsettings.h>
#endif
#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>
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");
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
//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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
#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
#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)
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
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);
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);
#ifndef QT_NO_CLIPBOARD
void tst_QLineEdit::cut()
{
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
{
PasteboardRef pasteboard;
OSStatus status = PasteboardCreate(0, &pasteboard);
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);
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
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;
}
}
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
#include <Security/AuthSession.h>
bool macHasAccessToWindowsServer()
{
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
#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
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
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) );
#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
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 );
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
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);
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);
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);
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
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());
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;
#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
void setWindowTitle();
void resizeEvents_data();
void resizeEvents();
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
void defaultSizeGrip();
#endif
void hideAndShow();
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
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")));
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());
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
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
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
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());
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());
QCOMPARE(widgetResizeEventSpy.count(), expectedWidgetResizeEvents);
}
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
void tst_QMdiSubWindow::defaultSizeGrip()
{
if (!qApp->style()->inherits("QMacStyle"))
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
// 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());
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());
QCOMPARE(window->size(), window->sizeHint());
subWindow->showMaximized();
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
QCOMPARE(menuBar->cornerWidget(Qt::TopRightCorner), subWindow->maximizedButtonsWidget());
#endif
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());
// 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());
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;
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()
{
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;
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
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");
// 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);
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
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...
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();
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
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
*/
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
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
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();
QCOMPARE(mb->activeAction()->text(), fileMenu.title());
mb->hide();
-#endif //Q_WS_MAC
+#endif //Q_OS_MAC
}
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
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
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;
Q_DECLARE_METATYPE(keyPairType);
Q_DECLARE_METATYPE(QList<bool>);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
#include <Carbon/Carbon.h>
#endif
bool tst_QPlainTextEdit::nativeClipboardWorking()
{
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
PasteboardRef pasteboard;
OSStatus status = PasteboardCreate(0, &pasteboard);
if (status == noErr)
{
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);
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();
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)
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);
QVERIFY(sizeGrip->isVisible());
widget->showMaximized();
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
QVERIFY(!sizeGrip->isVisible());
#else
QVERIFY(sizeGrip->isVisible());
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);
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);
{
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);
main.setStatusBar(&statusbar);
main.showMaximized();
QTest::qWaitForWindowShown(&main);
-#ifndef Q_WS_MAC
+#ifndef Q_OS_MAC
QVERIFY(!statusbar.findChild<QSizeGrip*>()->isVisible());
#endif
main.showNormal();
4;
#elif defined(Q_WS_WIN)
2;
-#elif defined(Q_WS_MAC)
+#elif defined(Q_OS_MAC)
5;
#else
2;
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)
bool tst_QTextEdit::nativeClipboardWorking()
{
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
PasteboardRef pasteboard;
OSStatus status = PasteboardCreate(0, &pasteboard);
if (status == noErr)
{
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);
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();
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
QTest::qWait(300);
QTRY_COMPARE(spy.count(), 1);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
qt_set_sequence_auto_mnemonic(false);
#endif
}
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);