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

Application crashes when setWindowFlags() is called with Qt::WindowCancelButtonHint

    XMLWordPrintable

Details

    Description

      After setWindowFlags() is called with flag Qt::WindowCancelButtonHint, and close button is clicked. Application crashes.

      This behavior is found in Qt 4.4 on Windows vista.

      #include <QtGui>

      class TMainWindow : public QMainWindow
      {
      public:
      TMainWindow(QWidget* parent = 0)
      :
      QMainWindow(parent) {}
      void mousePressEvent(QMouseEvent*)

      { setWindowFlags(windowFlags() ^ Qt::WindowCancelButtonHint ); qDebug() << windowFlags(); show(); }

      };

      int main (int argc, char** argv)
      {
      QApplication app(argc, argv);

      TMainWindow w ;
      w.show();
      return app.exec();
      }

      Attachments

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

        Activity

          People

            bhughes Bradley T. Hughes (closed Nokia Identity) (Inactive)
            smk smk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes