summaryrefslogtreecommitdiffstats
path: root/tests/manual/qtbug-8933/widget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/qtbug-8933/widget.cpp')
-rw-r--r--tests/manual/qtbug-8933/widget.cpp58
1 files changed, 58 insertions, 0 deletions
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;
+}