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

QComboBox: Wrong popup position when switching to Fusion style

    XMLWordPrintable

Details

    • 8393922e7 (dev), 2aa031353 (6.5), 1b8665308 (6.6)

    Description

      Steps to reproduce

      1. Build and run the Widget Gallery Example (https://code.qt.io/cgit/qt/qtbase.git/tree/examples/widgets/gallery )
      2. Select each available "Style" from the combobox in turn.
      3. For each selected style, click on the combobox's down-arrow to bring up the popup and then click on the same spot again to dismiss the popup.

       

      Expected behaviour (most non-Fusion styles)

      After clicking on the down-arrow to bring up the popup, clicking on the same spot again should dismiss the popup and retain the existing selection.

      "windowsvista" style (correct):

       

      "windows" style (correct):

       

      Actual behaviour (Fusion style)

      When clicking on the down-arrow to bring up the popup, clicking on the same spot again changes the selection to the item above the existing selection.

       

      This issue occurs because the popup's position is wrong - the wrong item is overlaid onto the combobox's body on the first the first click. However, subsequent clicks do not exhibit this issue – if you dismiss the first Fusion popup by clicking elsewhere on the GUI, the 2nd click will produce a correctly-positioned popup.

       

      "fusion" style, 1st click (wrong):

      "fusion" style, subsequent clicks (correct):

       

      Notes

      This issue seems to be related to switching from a different style to the Fusion style. It does not seem to occur if the Fusion style is applied at startup:

      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          app.setStyle("Fusion");
      
          QComboBox box;
          box.addItems({"Alpha", "Bravo", "Charlie", "Delta"});
          box.setCurrentIndex(2); // Issue does not occur here
          box.show();
      
          return app.exec();
      }
      

      Attachments

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

        Activity

          People

            richard Richard Moe Gustavsen
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes