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

Duplicate context menus when using custom context Menus in text controls

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • 6.9.1, 6.10.0 FF
    • 6.10
    • Quick: Controls 2
    • None
    • 64063946d (dev), 9ac0e70cd (dev), 4fc898246 (6.9), e5824ea91 (6.9), d1457b0d7 (dev), c5e36d2c9 (6.9)

    Description

      To reproduce:

      1. Open e.g. texteditor example
      2. Right click; our text editing context menu will be shown, but once it's closed, another native one will still be visible

      Windows isn't affected as it opens context menus on release.

      The workaround is to only open context menus on press on non-Windows systems:

          TapHandler {
              acceptedButtons: Qt.RightButton
              onPressedChanged: {
                  if (pressed == (Application.styleHints.contextMenuTrigger === Qt.ContextMenuTrigger.Press))
                      contextMenu.popup()
              }
          }
      

      If you don't want to use ContextMenu at all, you can avoid this with the following code in e.g. TextArea and reuse that TextArea throughout the app:

      ContextMenu.menu: null
      

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-134903
          # Subject Branch Project Status CR V

          Activity

            People

              mitch_curtis Mitch Curtis
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: