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

Extra Behaviour of MousePressEvent+RightButtonPressed+Exit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.15.2, 6.4.1
    • Widgets: Main Window
    • None
    • os:Win7 x64 and Win10 x64

      complier:MSVC2019 x64

      Qt:6.4.1 and 5.15.2LTS
    • Windows

    Description

      /*

      os:Win7 x64 and Win10 x64

      complier:MSVC2019 x64

      Qt:6.4.1 and 5.15.2LTS

      Bug Description:when you put close() or QApplication::quit() in mousePressEvent and use RightButton pressed to emit this event,Qt will act close() or QApplication::quit() and extraly active the system right buttton menu as well,which is unexpected.

      This bug appears when QtCreator is minimize in debug mode,at this time the background of the application is system desktop,but when you debug with QtCreator Maximization,it's normal as usual.

      And in release this bug is no limitation ,which happens everytime you click rightbutton.

      */

      //MainWindow directly inherits from QMainWindow,

      //It's a newly built Qt Widgets Application defaultly with mousePressEvent overrided

      void MainWindow::mousePressEvent(QMouseEvent *e)
      {
          if(e->button()==Qt::RightButton)

      {         //close();//same as quit(),when Qt execute close(),System RightButton Menu was activated         QApplication::quit();         e->accept();     }

      }

      Attachments

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            xiaobao666 浩恺 保
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: