diff options
author | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2009-04-30 13:31:55 (GMT) |
---|---|---|
committer | Thomas Hartmann <Thomas.Hartmann@nokia.com> | 2009-04-30 13:40:54 (GMT) |
commit | ea80a3dc8acdb95c0c217b3574718c88c7a36e9f (patch) | |
tree | a8016cd9cf096d4cf56f864bb9ca40b43c4c912d /tests/auto/windowsmobile/testQMenuBar/main.cpp | |
parent | 9cb0419bd9559b5c9e0a95711a81391556306e51 (diff) | |
download | Qt-ea80a3dc8acdb95c0c217b3574718c88c7a36e9f.zip Qt-ea80a3dc8acdb95c0c217b3574718c88c7a36e9f.tar.gz Qt-ea80a3dc8acdb95c0c217b3574718c88c7a36e9f.tar.bz2 |
New autotest for Windows Mobile: tst_windowsmobile
This autotest tests some Windows Mobile 5.0 specific thing like the
native menubar and the integration into the window manager by taking and
comparing screenshots. This should prevent nasty regressions we had.
This autotest makes only sense on Windows Mobile 5.0 in 480x640
Reviewed-by: maurice
Diffstat (limited to 'tests/auto/windowsmobile/testQMenuBar/main.cpp')
-rw-r--r-- | tests/auto/windowsmobile/testQMenuBar/main.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/tests/auto/windowsmobile/testQMenuBar/main.cpp b/tests/auto/windowsmobile/testQMenuBar/main.cpp new file mode 100644 index 0000000..4a3b3b2 --- /dev/null +++ b/tests/auto/windowsmobile/testQMenuBar/main.cpp @@ -0,0 +1,72 @@ +#include <QtTest/QtTest> +#include <QtCore/QDate> +#include <QtCore/QDebug> +#include <QtCore/QObject> +#include <QtGui> +#include <windows.h> + +int main(int argc, char * argv[]) +{ + int widgetNum = 20; + + QList<QWidget*> widgets; + QApplication app(argc, argv); + + QMainWindow mainWindow; + mainWindow.setWindowTitle("Test"); + QMenu *fileMenu = mainWindow.menuBar()->addMenu("File"); + QMenu *editMenu = mainWindow.menuBar()->addMenu("Edit"); + QMenu *viewMenu = mainWindow.menuBar()->addMenu("View"); + QMenu *toolsMenu = mainWindow.menuBar()->addMenu("Tools"); + QMenu *optionsMenu = mainWindow.menuBar()->addMenu("Options"); + QMenu *helpMenu = mainWindow.menuBar()->addMenu("Help"); + + qApp->processEvents(); + + fileMenu->addAction("Open"); + QAction *close = fileMenu->addAction("Close"); + fileMenu->addSeparator(); + fileMenu->addAction("Exit"); + + close->setEnabled(false); + + editMenu->addAction("Cut"); + editMenu->addAction("Pase"); + editMenu->addAction("Copy"); + editMenu->addSeparator(); + editMenu->addAction("Find"); + + viewMenu->addAction("Hide"); + viewMenu->addAction("Show"); + viewMenu->addAction("Explore"); + QAction *visible = viewMenu->addAction("Visible"); + visible->setCheckable(true); + visible->setChecked(true); + + toolsMenu->addMenu("Hammer"); + toolsMenu->addMenu("Caliper"); + toolsMenu->addMenu("Helm"); + + optionsMenu->addMenu("Settings"); + optionsMenu->addMenu("Standard"); + optionsMenu->addMenu("Extended"); + + QMenu *subMenu = helpMenu->addMenu("Help"); + subMenu->addAction("Index"); + subMenu->addSeparator(); + subMenu->addAction("Vodoo Help"); + helpMenu->addAction("Contens"); + helpMenu->addSeparator(); + helpMenu->addAction("About"); + + QToolBar toolbar; + mainWindow.addToolBar(&toolbar); + toolbar.addAction(QIcon(qApp->style()->standardPixmap(QStyle::SP_FileIcon)), QString("textAction")); + + QTextEdit textEdit; + mainWindow.setCentralWidget(&textEdit); + + mainWindow.showMaximized(); + + app.exec(); +} |