mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-02 23:35:28 +08:00
qt 6.5.1 original
This commit is contained in:
18
tests/manual/qtbug-8933/CMakeLists.txt
Normal file
18
tests/manual/qtbug-8933/CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
#####################################################################
|
||||
## qtbug-8933 Binary:
|
||||
#####################################################################
|
||||
|
||||
qt_internal_add_manual_test(qtbug-8933
|
||||
GUI
|
||||
SOURCES
|
||||
main.cpp
|
||||
widget.cpp widget.h widget.ui
|
||||
LIBRARIES
|
||||
Qt::Gui
|
||||
Qt::Widgets
|
||||
ENABLE_AUTOGEN_TOOLS
|
||||
uic
|
||||
)
|
7
tests/manual/qtbug-8933/README
Normal file
7
tests/manual/qtbug-8933/README
Normal file
@ -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.
|
||||
|
13
tests/manual/qtbug-8933/main.cpp
Normal file
13
tests/manual/qtbug-8933/main.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QApplication>
|
||||
#include "widget.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
Widget w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
10
tests/manual/qtbug-8933/qtbug-8933.pro
Normal file
10
tests/manual/qtbug-8933/qtbug-8933.pro
Normal file
@ -0,0 +1,10 @@
|
||||
TARGET = qtbug-8933
|
||||
TEMPLATE = app
|
||||
QT += widgets
|
||||
|
||||
SOURCES += main.cpp\
|
||||
widget.cpp
|
||||
|
||||
HEADERS += widget.h
|
||||
|
||||
FORMS += widget.ui
|
61
tests/manual/qtbug-8933/widget.cpp
Normal file
61
tests/manual/qtbug-8933/widget.cpp
Normal file
@ -0,0 +1,61 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#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;
|
||||
}
|
35
tests/manual/qtbug-8933/widget.h
Normal file
35
tests/manual/qtbug-8933/widget.h
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#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 = nullptr);
|
||||
~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
|
33
tests/manual/qtbug-8933/widget.ui
Normal file
33
tests/manual/qtbug-8933/widget.ui
Normal file
@ -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>
|
Reference in New Issue
Block a user