Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Incorrect ComboBox height

Incorrect ComboBox height

Scheduled Pinned Locked Moved Unsolved Qt 6
4 Posts 2 Posters 473 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dmitriano
    wrote on last edited by
    #1

    After migrating to QT6.2 the height of a ComboBox in my app become incorrect. With Fusion style it looks like this:

    alt text

    With Default style on Windows 10 the font is smaller and height is correct:

    alt text

    1 Reply Last reply
    0
    • AxelViennaA Offline
      AxelViennaA Offline
      AxelVienna
      wrote on last edited by
      #2

      @Dmitriano
      You need to check two factors.
      (1) Set the size policy to "resize to contents"

      yourComboBox->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy AdjustToContents);
      

      (2) Make sure that the layout where the box is located provides enough space for it to resize properly.

      C++ and Python walk into a bar. C++ reuses the first glass.

      D 1 Reply Last reply
      1
      • AxelViennaA AxelVienna

        @Dmitriano
        You need to check two factors.
        (1) Set the size policy to "resize to contents"

        yourComboBox->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy AdjustToContents);
        

        (2) Make sure that the layout where the box is located provides enough space for it to resize properly.

        D Offline
        D Offline
        Dmitriano
        wrote on last edited by
        #3

        @AxelVienna said in Incorrect ComboBox height:

        Set the size policy to "resize to contents"

        It is Quick but not Widgets. As far as I see there is no sizeAdjustPolicy property, see https://doc-snapshots.qt.io/qt6-dev/qml-qtquick-controls2-combobox.html

        D 1 Reply Last reply
        0
        • D Dmitriano

          @AxelVienna said in Incorrect ComboBox height:

          Set the size policy to "resize to contents"

          It is Quick but not Widgets. As far as I see there is no sizeAdjustPolicy property, see https://doc-snapshots.qt.io/qt6-dev/qml-qtquick-controls2-combobox.html

          D Offline
          D Offline
          Dmitriano
          wrote on last edited by
          #4

          @Dmitriano The same effect on both Windows and Android.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved