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

Windows11 style: wrong size hint for (editable) QComboBox

    XMLWordPrintable

Details

    • Windows
    • b6ca35f65 (dev), b63615ca6 (6.8), dc1ae86ba (dev), 7c34903e4 (6.8)

    Description

      This simple reproducer shows that the size hint is to small:

      int main(int argc, char* argv[])
      {
          QApplication a(argc, argv);
          QPixmap pm(16, 16);
          pm.fill(Qt::red);
          QIcon ico(pm);
          QWidget w;
          QHBoxLayout* lay = new QHBoxLayout(&w);
          QComboBox* cbx1 = new QComboBox;
          cbx1->addItems({ "12345678901234567890", "2345678901234567890", "345678901234567890" });
          lay->addWidget(cbx1);
          QComboBox* cbx2 = new QComboBox;
          cbx2->addItems({ "12345678901234567890", "2345678901234567890", "345678901234567890" });
          cbx2->setEditable(true);
          lay->addWidget(cbx2);
          QComboBox* cbx3 = new QComboBox;
          cbx3->addItem(ico, "12345678901234567890");
          lay->addWidget(cbx3);
          QComboBox* cbx4 = new QComboBox;
          cbx4->addItem(ico, "12345678901234567890");
          cbx4->setEditable(true);
          lay->addWidget(cbx4);
          QComboBox* cbx5 = new QComboBox;
          cbx5->addItem("12345678901234567890");
          cbx5->setFrame(false);
          lay->addWidget(cbx5);
          w.show();
      }
      

      Result:

      Attachments

        Issue Links

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

          Activity

            People

              chehrlic Christian Ehrlicher
              chehrlic Christian Ehrlicher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes