summaryrefslogtreecommitdiffstats
path: root/tests/manual/qtbug-8933
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/qtbug-8933')
-rw-r--r--tests/manual/qtbug-8933/README7
-rw-r--r--tests/manual/qtbug-8933/main.cpp51
-rw-r--r--tests/manual/qtbug-8933/qtbug-8933.pro16
-rw-r--r--tests/manual/qtbug-8933/widget.cpp99
-rw-r--r--tests/manual/qtbug-8933/widget.h73
-rw-r--r--tests/manual/qtbug-8933/widget.ui33
6 files changed, 279 insertions, 0 deletions
diff --git a/tests/manual/qtbug-8933/README b/tests/manual/qtbug-8933/README
new file mode 100644
index 0000000000..b3ce407ed3
--- /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 0000000000..be8610a297
--- /dev/null
+++ b/tests/manual/qtbug-8933/main.cpp
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#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 0000000000..8b87c8346d
--- /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 0000000000..95b6bfc59d
--- /dev/null
+++ b/tests/manual/qtbug-8933/widget.cpp
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#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 0000000000..88472e705d
--- /dev/null
+++ b/tests/manual/qtbug-8933/widget.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#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 0000000000..e0ded3faa4
--- /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>