aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-09-18 12:07:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-26 10:24:54 +0200
commit24d45304aa363c9a08f7157d549cb37c07212108 (patch)
treef50b6e671f19d663dcd5ce4b18a57479a760b2d8 /tests
parent1ef71fcdb15ac0b93751142629b4a2d1ab1e73c8 (diff)
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 <gabriel.dedietrich@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/auto.pro3
-rw-r--r--tests/auto/macfunctions/tst_qmacfunctions.mm30
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"