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

QToolButton::setPopupMode() has no effect if set before setting the menu

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P1: Critical P1: Critical
    • None
    • 6.10
    • Widgets: Main Window
    • None
    • All

      After the commit 0f6135ae6d97f77c1a737a26f67bf3242940e11c in qtbase,

      code that relied to set the popupmode of a QToolButton prior to the QMenu creation (for lazy loading) and menu set are now ignored and always set to MenuButtonPopup

      This breaks toolbuttons of applications that are supposed to have toolbar buttons that are purely a menu without a main action to be triggered which wish to create the popup menu only on trigger as it might be an expensive action.

       

      Attached example creates a split button with te down arrow on click, while it should just open the menu and nothing else.

       

      In KDE, this breaks all applications using KHamburgerMenu, in the attached screenshot, the hamburger menu shouldn't have a down arrow

        1. menuBug.tar.gz
          5 kB
          Marco Martin
        2. image-2025-10-02-11-43-50-977.png
          43 kB
          Marco Martin
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            notmart Marco Martin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes