diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/auto.pro | 3 | ||||
-rw-r--r-- | tests/auto/macfunctions/tst_qmacfunctions.mm | 30 |
2 files changed, 3 insertions, 30 deletions
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 915b01e..bfa2c7c 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -1,5 +1,6 @@ TEMPLATE = subdirs SUBDIRS = \ - cmake \ headersclean \ macfunctions +### FIXME Mac native toolbar is now private in this module +#SUBDIRS += cmake diff --git a/tests/auto/macfunctions/tst_qmacfunctions.mm b/tests/auto/macfunctions/tst_qmacfunctions.mm index f34ed25..591d1dd 100644 --- a/tests/auto/macfunctions/tst_qmacfunctions.mm +++ b/tests/auto/macfunctions/tst_qmacfunctions.mm @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#import <AppKit/AppKit.h> #include <QString> #include <QtTest> @@ -47,47 +48,18 @@ #include <QtWidgets/QMainWindow> #include <qmacfunctions.h> -#import <AppKit/AppKit.h> - class tst_QMacFunctions : public QObject { Q_OBJECT public: tst_QMacFunctions(); - -private slots: - void testToNSMenu(); }; tst_QMacFunctions::tst_QMacFunctions() { } -void tst_QMacFunctions::testToNSMenu() -{ - QMainWindow window; - QMenu *qMenu = new QMenu("Menu", &window); - QAction *action = new QAction("&Item", &window); - qMenu->addAction(action); - window.menuBar()->addMenu(qMenu); - - NSMenu *nsMenu = QtMac::toNSMenu(qMenu); - QVERIFY(nsMenu != NULL); - QCOMPARE([[nsMenu title] UTF8String], "Menu"); - - NSMenuItem *item = [nsMenu itemAtIndex:0]; - QCOMPARE([[item title] UTF8String], "Item"); - - // get NSMenu from QMenuBar - nsMenu = QtMac::toNSMenu(window.menuBar()); - QVERIFY(nsMenu != NULL); - - // the first item should be our menu - item = [nsMenu itemAtIndex:0]; - QCOMPARE([[item title] UTF8String], "Menu"); -} - QTEST_MAIN(tst_QMacFunctions) #include "tst_qmacfunctions.moc" |