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

Error when detaching QToolBar on wayland

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.1
    • None
    • Linux/Wayland

    Description

      When dragging a main window toolbar in wayland, error message appears on terminal:

      This plugin supports grabbing the mouse only for popup windows
      

      It's not possible to move the detached toolbar and some effort is required to reattach it in the right place. A non-deterministic segmentation fault also happened once, while trying to drag it.

      The problem disappears when the QPA plugin is switched to "xcb".

      Example code showing the bug:

      #!/usr/bin/env python3
      from PySide6 import QtCore, QtWidgets, QtGui
      from __feature__ import snake_case, true_property
      
      import sys
      
      class MainWindow(QtWidgets.QMainWindow):
          def __init__(self):
              super().__init__()
              self.window_title = 'Hello'
              self.text = QtWidgets.QLabel('Hello World', alignment=QtCore.Qt.AlignCenter)
              self.set_central_widget(self.text)
              self.create_actions()
              self.create_menus()
              self.create_tool_bars()
              self.create_status_bar()
      
          def create_actions(self):
              self.new_game_action = QtGui.QAction('New Game', self)
              self.new_game_action.set_shortcuts(QtGui.QKeySequence.New)
              self.new_game_action.status_tip = 'Let\'s play!'
              self.new_game_action.triggered.connect(self.new_game)
      
              self.quit_action = QtGui.QAction('Quit', self)
              self.quit_action.set_shortcuts(QtGui.QKeySequence.Quit)
              self.quit_action.status_tip = 'Quit'
              self.quit_action.triggered.connect(self.close)
      
      
          def create_menus(self):
              self.file_menu = self.menu_bar().add_menu('File')
              self.file_menu.add_action(self.new_game_action)
              self.file_menu.add_separator()
              self.file_menu.add_action(self.quit_action)
      
          def new_game(self):
              pass
      
          def create_tool_bars(self):
              self.tool_bar = self.add_tool_bar('Tool Bar')
              self.tool_bar.add_action(self.new_game_action)
      
          def create_status_bar(self):
              self.status_bar_ = self.status_bar()
      
      def main():
          app = QtWidgets.QApplication(sys.argv)
          widget = MainWindow()
          widget.resize(800, 600)
          widget.show()
          sys.exit(app.exec())
      
      if __name__ == '__main__': main()
      
      

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              hdante Henrique Dante de Almeida
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes