summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-03-17 11:15:59 (GMT)
committerCarlos Manuel Duclos Vergara <carlos.duclos@nokia.com>2010-03-17 11:16:49 (GMT)
commit7e9052cc1f16b3eeabb73ada9492d91620df796d (patch)
tree94337fc0e454e3dff97791b0430477ee9d896400
parentf8d5f2594a9b268b9eeecf95b24b23fc940c71ce (diff)
downloadQt-7e9052cc1f16b3eeabb73ada9492d91620df796d.zip
Qt-7e9052cc1f16b3eeabb73ada9492d91620df796d.tar.gz
Qt-7e9052cc1f16b3eeabb73ada9492d91620df796d.tar.bz2
Manual test for QTBUG-8933.
See the readme file. Reviewed-by: TrustMe
-rw-r--r--tests/manual/qtbug-8933/README7
-rw-r--r--tests/manual/qtbug-8933/main.cpp10
-rw-r--r--tests/manual/qtbug-8933/qtbug-8933.pro16
-rw-r--r--tests/manual/qtbug-8933/widget.cpp58
-rw-r--r--tests/manual/qtbug-8933/widget.h32
-rw-r--r--tests/manual/qtbug-8933/widget.ui33
6 files changed, 156 insertions, 0 deletions
diff --git a/tests/manual/qtbug-8933/README b/tests/manual/qtbug-8933/README
new file mode 100644
index 0000000..b3ce407
--- /dev/null
+++ b/tests/manual/qtbug-8933/README
@@ -0,0 +1,7 @@
+The purpose of this test is to check if the full screen mode in OSX is working properly or not.
+This test creates a widget and 5 seconds later enters full screen mode. If you hover over the area
+where the menubar should be you will get no menubar. After 5 more seconds (i.e. 10 seconds since
+start) a menubar is created. At that point, if you hover over the menubar area you will get the
+menubar. 5 seconds later the menubar is destroyed and if you hover over there will be no menubar.
+After 5 more seconds the widget goes back to normal mode and the test is finished.
+
diff --git a/tests/manual/qtbug-8933/main.cpp b/tests/manual/qtbug-8933/main.cpp
new file mode 100644
index 0000000..841b7c3
--- /dev/null
+++ b/tests/manual/qtbug-8933/main.cpp
@@ -0,0 +1,10 @@
+#include <QtGui/QApplication>
+#include "widget.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ Widget w;
+ w.show();
+ return a.exec();
+}
diff --git a/tests/manual/qtbug-8933/qtbug-8933.pro b/tests/manual/qtbug-8933/qtbug-8933.pro
new file mode 100644
index 0000000..8b87c83
--- /dev/null
+++ b/tests/manual/qtbug-8933/qtbug-8933.pro
@@ -0,0 +1,16 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2010-03-16T14:40:16
+#
+#-------------------------------------------------
+
+TARGET = qtbug-8933
+TEMPLATE = app
+
+
+SOURCES += main.cpp\
+ widget.cpp
+
+HEADERS += widget.h
+
+FORMS += widget.ui
diff --git a/tests/manual/qtbug-8933/widget.cpp b/tests/manual/qtbug-8933/widget.cpp
new file mode 100644
index 0000000..47a440b
--- /dev/null
+++ b/tests/manual/qtbug-8933/widget.cpp
@@ -0,0 +1,58 @@
+#include "widget.h"
+#include "ui_widget.h"
+
+#include <QTimer>
+#include <QDebug>
+
+Widget::Widget(QWidget *parent) :
+ QWidget(parent),
+ ui(new Ui::Widget)
+{
+ ui->setupUi(this);
+ QTimer::singleShot(5000, this, SLOT(switchToFullScreen()));
+ QTimer::singleShot(10000, this, SLOT(addMenuBar()));
+ QTimer::singleShot(15000, this, SLOT(removeMenuBar()));
+ QTimer::singleShot(20000, this, SLOT(switchToNormalScreen()));
+}
+
+Widget::~Widget()
+{
+ delete ui;
+}
+
+void Widget::changeEvent(QEvent *e)
+{
+ QWidget::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
+
+void Widget::switchToFullScreen()
+{
+ ui->label->setText("entering full screen");
+ showFullScreen();
+}
+
+void Widget::switchToNormalScreen()
+{
+ ui->label->setText("leaving full screen");
+ showNormal();
+}
+
+void Widget::addMenuBar()
+{
+ ui->label->setText("adding menu bar");
+ menuBar = new QMenuBar(this);
+ menuBar->setVisible(true);
+}
+
+void Widget::removeMenuBar()
+{
+ ui->label->setText("removing menu bar");
+ delete menuBar;
+}
diff --git a/tests/manual/qtbug-8933/widget.h b/tests/manual/qtbug-8933/widget.h
new file mode 100644
index 0000000..f6afa8f
--- /dev/null
+++ b/tests/manual/qtbug-8933/widget.h
@@ -0,0 +1,32 @@
+#ifndef WIDGET_H
+#define WIDGET_H
+
+#include <QWidget>
+#include <QMenuBar>
+#include <QMenu>
+
+namespace Ui {
+ class Widget;
+}
+
+class Widget : public QWidget {
+ Q_OBJECT
+public:
+ Widget(QWidget *parent = 0);
+ ~Widget();
+
+public slots:
+ void switchToFullScreen();
+ void switchToNormalScreen();
+ void addMenuBar();
+ void removeMenuBar();
+
+protected:
+ void changeEvent(QEvent *e);
+
+private:
+ Ui::Widget *ui;
+ QMenuBar *menuBar;
+};
+
+#endif // WIDGET_H
diff --git a/tests/manual/qtbug-8933/widget.ui b/tests/manual/qtbug-8933/widget.ui
new file mode 100644
index 0000000..e0ded3f
--- /dev/null
+++ b/tests/manual/qtbug-8933/widget.ui
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Widget</class>
+ <widget class="QWidget" name="Widget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>600</width>
+ <height>400</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Widget</string>
+ </property>
+ <widget class="QLabel" name="label">
+ <property name="geometry">
+ <rect>
+ <x>110</x>
+ <y>60</y>
+ <width>311</width>
+ <height>16</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>