From 7e9052cc1f16b3eeabb73ada9492d91620df796d Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Wed, 17 Mar 2010 12:15:59 +0100 Subject: Manual test for QTBUG-8933. See the readme file. Reviewed-by: TrustMe --- tests/manual/qtbug-8933/README | 7 ++++ tests/manual/qtbug-8933/main.cpp | 10 ++++++ tests/manual/qtbug-8933/qtbug-8933.pro | 16 ++++++++++ tests/manual/qtbug-8933/widget.cpp | 58 ++++++++++++++++++++++++++++++++++ tests/manual/qtbug-8933/widget.h | 32 +++++++++++++++++++ tests/manual/qtbug-8933/widget.ui | 33 +++++++++++++++++++ 6 files changed, 156 insertions(+) create mode 100644 tests/manual/qtbug-8933/README create mode 100644 tests/manual/qtbug-8933/main.cpp create mode 100644 tests/manual/qtbug-8933/qtbug-8933.pro create mode 100644 tests/manual/qtbug-8933/widget.cpp create mode 100644 tests/manual/qtbug-8933/widget.h create mode 100644 tests/manual/qtbug-8933/widget.ui 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 +#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 +#include + +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 +#include +#include + +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 @@ + + + Widget + + + + 0 + 0 + 600 + 400 + + + + Widget + + + + + 110 + 60 + 311 + 16 + + + + TextLabel + + + + + + + -- cgit v0.12