From 24d45304aa363c9a08f7157d549cb37c07212108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 18 Sep 2013 12:07:45 +0200 Subject: Remove QtWidgets dependencies from QtMacExtras. This makes it possible to use QtMacExtras from other modules without adding a QtWidgets dependency. It also makes it possible to use QtMacExtras from QtWidgets. Widget-related classes and functions will be added to QtWidgets. Specifics: Make QMacNativeToolBar private, for use by QMainWindow:: setUnifiedTitleAndToolBarOnMac(). Remove the QAction based APIs. Remove the example. We can make QMacNativeToolBar public again when the API is ready and documented. Remove misc functions: toNSMenu, setDockMenu, isMainWindow. Make toCfSTring/Url private pending inclusion into QtCore. Change-Id: Ic55e78d8ef923149c23884f6589732f7dfb94153 Reviewed-by: Gabriel de Dietrich --- tests/auto/auto.pro | 3 ++- tests/auto/macfunctions/tst_qmacfunctions.mm | 30 +--------------------------- 2 files changed, 3 insertions(+), 30 deletions(-) (limited to 'tests') 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 #include #include @@ -47,47 +48,18 @@ #include #include -#import - 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" -- cgit v1.2.3