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. Combobox dropdown text not showing
QtWS25 Last Chance

Combobox dropdown text not showing

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
7 Posts 4 Posters 409 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.
  • L Offline
    L Offline
    ltlnx
    wrote on 3 Dec 2024, 12:24 last edited by
    #1

    Hi,

    I'm really new to Qt, and as I was prototyping with QML, I met a problem with the ComboBox, which looks like this:

    螢幕截圖_20241203_201224.png

    but has 3 items in it. After some searching the only way I found to subvert this problem is to customize it completely, is there another easier way to make the text show? I'm on Linux, Qt6.8, with the KDE desktop.

    Cheers,
    ltlnx

    J 1 Reply Last reply 3 Dec 2024, 12:30
    0
    • L ltlnx
      3 Dec 2024, 12:24

      Hi,

      I'm really new to Qt, and as I was prototyping with QML, I met a problem with the ComboBox, which looks like this:

      螢幕截圖_20241203_201224.png

      but has 3 items in it. After some searching the only way I found to subvert this problem is to customize it completely, is there another easier way to make the text show? I'm on Linux, Qt6.8, with the KDE desktop.

      Cheers,
      ltlnx

      J Offline
      J Offline
      JonB
      wrote on 3 Dec 2024, 12:30 last edited by
      #2

      @ltlnx
      I don't do QML, but since I imagine a ComboBox should work fine you might show the (minimal) QML code you have written which produces a problem.

      1 Reply Last reply
      1
      • L Offline
        L Offline
        ltlnx
        wrote on 3 Dec 2024, 13:38 last edited by
        #3

        The minimal code that produces this:

        import QtQuick
        import QtQuick.Controls
        
        ApplicationWindow {
            minimumWidth: 260
            minimumHeight: 380
            visible: true
            title: qsTr("Show Me The Key")
        
            Column {
                anchors.fill: parent
                ComboBox { model: [qsTr("Composed"), qsTr("Raw"), qsTr("Compact")] }
            }
        }
        
        1 Reply Last reply
        0
        • D Offline
          D Offline
          dheerendra
          Qt Champions 2022
          wrote on 3 Dec 2024, 17:10 last edited by
          #4

          I don't see any issue with your code. It works. If you click on downArrow ComboBox, what do you get ?

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          1 Reply Last reply
          0
          • L Offline
            L Offline
            ltlnx
            wrote on 4 Dec 2024, 13:31 last edited by
            #5

            The pic in the first post is what I get - could it be some kind of issue with the theming? Though the theme doesn't seem to change when I tried the environment variables listed in the docs. Is there something that I need to install?

            J 1 Reply Last reply 4 Dec 2024, 13:36
            0
            • L ltlnx
              4 Dec 2024, 13:31

              The pic in the first post is what I get - could it be some kind of issue with the theming? Though the theme doesn't seem to change when I tried the environment variables listed in the docs. Is there something that I need to install?

              J Offline
              J Offline
              JonB
              wrote on 4 Dec 2024, 13:36 last edited by
              #6

              @ltlnx
              Me again, who knows nothing about QML :) Wouldn't have thought that theme would go as far as suppressing display of combo dropdown items completely. Are you able to quickly try your thing in something other than your "KDE desktop", like GNOME or whatever?

              1 Reply Last reply
              0
              • T Offline
                T Offline
                Tullhead
                wrote on 27 Mar 2025, 03:00 last edited by
                #7

                Did you try removing the qsTr() from around the strings? Might work that way.... I think I had something like this....

                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