Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ComboBoxStyle Custom Popup/Drop-down List
Forum Updated to NodeBB v4.3 + New Features

ComboBoxStyle Custom Popup/Drop-down List

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 1.9k Views 1 Watching
  • 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.
  • O Offline
    O Offline
    onek24
    wrote on last edited by
    #1

    Hello,

    i want to size my drop-down list based on the content width. That means undependen from the component-width. The documentation for the ComboBoxStyle is very thin. Is there any good and working ComboBoxStyle example or is there any way i could solve this?

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      If i get you correctly you want the drop down list of combobox to be adjusted as per its contents. If that's the case then it is already working.

      For. eg.
      @
      ComboBox {
      model: ["Paris", "Oslo", "New York", "This is a long string", "This is a very very .............. long string"]
      style: ComboBoxStyle{}
      }
      @

      Here the drop down list width is adjusted as per longest string in the model.

      157

      1 Reply Last reply
      0
      • O Offline
        O Offline
        onek24
        wrote on last edited by
        #3

        Hello p3c0,

        thank you for your help, i didn't see that it is already implemented... I have got 2 more questions:

        • Is it possible to increase the spacing between the popup/drop-down list items?
        • Is it possible to change the font of the popup/drop-down list items?
        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          Hi,

          I think both are not possbile currently.

          157

          1 Reply Last reply
          0
          • O Offline
            O Offline
            onek24
            wrote on last edited by
            #5

            Hey,

            it should be possible if you overwrite the internal component properties. Currently searching for the right ones, but i can't find them.

            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