Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.7.1
-
None
-
Mac OS 10.6.5, Qt 4.7.1 Cocoa
-
-
e32f432127bd049c6c11431055360c536e259114
Description
A Qt::Sheet dialog permanently loses its focus after moving the parent window. All widgets inside the dialog are still clickable and functional, but they permanently become greyed out and look like disabled.
#include <QtGui> class Dialog : public QDialog { public: Dialog(QWidget *parent=0); }; Dialog::Dialog(QWidget* parent) : QDialog(parent) { setWindowMoXXXXty(Qt::WindowModal); setWindowFlags((windowFlags() & ~Qt::WindowType_Mask) | Qt::Sheet); QGridLayout* grid = new QGridLayout(this); grid->addWidget(new QLineEdit("Click Me"), 0,0); grid->addWidget(new QLabel("Click insite the QLineEdit - it should get a blue border (focused). \n\n" "Now click the parent window's header, for example to move it. \n\n" "Now click the QLineEdit again - it does not get the blue border anymore. \n" "You can type inside, but it looks like inactive. \n\n" "The same will happen to all widgets in the dialog - they will be greyed out, \n" "like they do not receive the focus anymore."), 1,0); QPushButton *btnClose = new QPushButton("Close"); connect(btnClose, SIGNAL(clicked()), this, SLOT(close())); grid->addWidget(btnClose, 2,0); } int main(int argc, char **argv) { QApplication app(argc, argv); QWidget w; Dialog* d = new Dialog(&w); w.show(); d->show(); return app.exec(); }