Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-15474

Mac: Qt::Sheet dialog permanently loses focus after moving the parent window

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.7.4
    • 4.7.1
    • GUI: Window management
    • None
    • Mac OS 10.6.5, Qt 4.7.1 Cocoa
    • macOS
    • 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();
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richard Richard Moe Gustavsen
            serkol Sergiy Kolokolkin
            Votes:
            6 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes