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 410 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 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

    JonBJ 1 Reply Last reply
    0
    • L ltlnx

      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

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on 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 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
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on 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 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?

            JonBJ 1 Reply Last reply
            0
            • L ltlnx

              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?

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on 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 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