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

Change the window flag to the Widget from the Window at the focusOutEvent() will crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.4.0 Beta
    • GUI: OpenGL
    • None
    • Windows 8.1 64bit, Visual Studio 2013(v120)

    Description

      I practiced the qt example opengl\hellogl2.
      I created a focusOutEvent() in the Window class for closing a full screen window.
      When I use setWindowFlags( Qt::Widget ),
      the program will crash at "return app.exec();"

      void Window::focusOutEvent( QFocusEvent * event )
      {
          setWindowFlags( Qt::Widget ); // Crash when pressing tab key under full screen
          //showNormal();
      }
      void Window::keyPressEvent(QKeyEvent *e)
      {
          if (e->key() == Qt::Key_0)
          {
              setWindowFlags( Qt::Window );
              showFullScreen();
              setFocus();
          }
          else
              QWidget::keyPressEvent(e);
      }
      

      Attachments

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

        Activity

          People

            sletta Gunnar Sletta
            milojan milojan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes