Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.1.0, 6.2.0 Beta1
-
None
Description
[Code]
#include "mainwindow.h" #include <QScreen> #include <QGuiApplication> #include <QDebug> #include <QTime> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { #if 1 connect(QGuiApplication::primaryScreen(), &QScreen::virtualGeometryChanged, [=] () { qInfo() << QTime::currentTime().toString("hh:mm:ss:zzz"); }); #else QGuiApplication::primaryScreen()->setOrientationUpdateMask( Qt::LandscapeOrientation | Qt::PortraitOrientation); connect(QGuiApplication::primaryScreen(), &QScreen::orientationChanged, [=] () { qInfo() << QTime::currentTime().toString("hh:mm:ss:zzz"); }); #endif } MainWindow::~MainWindow() { }
[Steps]
- Run the sample program
- Rotate screen
- Then you'll see that the signal(virtualGeometryChanged) will be trigger multiple times(twice),but the other signal(orientationChanged) is normal.
[Hope]
- I don't understand why the signal named "virtualGeometryChanged" is triggered twice. Is there any special reason? What I think is that when the screen rotates, it only needs to trigger the signal once.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-95386 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
364461,3 | Only emit virtualGeometryChanged signal once per change in geometry | dev | qt/qtbase | Status: NEW | 0 | 0 |