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

QDialog ignores FramelessWindowHint passed to constructor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 5.1.1
    • GUI: Window management
    • None
    • OSX 10.8

    Description

      QDialog ignores the FramelessWindowHint if passed to the constructor.

      #include <QApplication>
      #include <QDialog>
      #include <QComboBox>
      #include <QHBoxLayout>
      #include <QPushButton>
      
      struct Widget : public QDialog
      {
          // passing FramelessWindowHint to the constructor has no effect in Qt 5...
          Widget(QWidget *parent = 0) : QDialog(parent, Qt::FramelessWindowHint)
          {
              // ...but this seems to work
              setWindowFlags(Qt::FramelessWindowHint);
      
              QHBoxLayout *layout = new QHBoxLayout(this);
      
              QPushButton *quitButton = new QPushButton("Quit", this);
              layout->addWidget(quitButton);
      
              connect(quitButton, SIGNAL(pressed()), qApp, SLOT(quit()));
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          Widget w;
          w.show();
      
          return a.exec();
      }
      
      

      Strangely, this only seems to effect QDialog; QWidget works.

      This works as expected in Qt 4.8.4. Regression in Qt 5.

      Attachments

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

        Activity

          People

            tpochep Timur Pocheptsov
            danny77uk Daniel
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes