QDialog loses OSX sheet style once QComboBox is activated
-
In my application I have a QDialog which contains a QComboBox. Whenever this QComboBox is triggered, the QDialog title bar appears and it turns into a window which can be moved around. When I hit ESC the dialog performs the closing animation of an OSX Sheet. Is there something I can do to prevent this? Is this a bug? This did not happen in Qt 4.x.
Code for screenshots below:
@#include <QtWidgets/qapplication.h>
#include <QtWidgets/qmainwindow.h>
#include <QtWidgets/qdialog.h>
#include <QtWidgets/qgridlayout.h>
#include <QtWidgets/qcombobox.h>int main(int argc, char** argv){
QApplication app(argc, argv);QMainWindow* mainWindow = new QMainWindow(); mainWindow->setWindowTitle("This is the main window"); QDialog* dialog = new QDialog(mainWindow); mainWindow->setFixedSize(QSize(300, 100)); mainWindow->show(); dialog->setWindowFlags(Qt::Sheet); dialog->setWindowTitle("This is the dialog"); dialog->setFixedSize(QSize(200, 70)); QGridLayout* layout = new QGridLayout(dialog); dialog->setLayout(layout); QComboBox* combo = new QComboBox(dialog); combo->addItem("Item 1"); combo->addItem("Item 2"); combo->addItem("Item 3"); combo->addItem("Item 4"); layout->addWidget(combo); dialog->open(); return app.exec();
}@
Screenshots:
Before clicking the QComboBox
!http://i.stack.imgur.com/EYHPX.png(Before clicking the QComboBox)!
After clicking the QComboBox
!http://i.stack.imgur.com/WfnJ0.png(After clicking the QComboBox)!
The QDialog can now be moved around
!http://i.stack.imgur.com/pioer.png(The QDialog can now be moved around)!Thank you!
-
Hi and welcome to devnet,
This sounds like a bug, you should have a look at the "bug report system":http://bugreports.qt-project.org/issues/ to check whether it has already been reported. If not, you could open a new bug report.
Bug reported on this forum are likely to not get noticed as only few Qt developers follows it (it's more user oriented)
-
[quote author="SGaist" date="1377199446"]Hi and welcome to devnet,
This sounds like a bug, you should have a look at the "bug report system":http://bugreports.qt-project.org/issues/ to check whether it has already been reported. If not, you could open a new bug report.
Bug reported on this forum are likely to not get noticed as only few Qt developers follows it (it's more user oriented)[/quote]
Ah ok, I'll do that right away. -
Thank you :)
Don't forget to update this thread with a link to the bug report
-
Here is the bug report - "https://bugreports.qt-project.org/browse/QTBUG-33126":https://bugreports.qt-project.org/browse/QTBUG-33126