Combobox dropdown text not showing
-
wrote on 3 Dec 2024, 12:24 last edited by
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:
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 -
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:
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 -
wrote on 3 Dec 2024, 13:38 last edited by
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")] } } }
-
I don't see any issue with your code. It works. If you click on downArrow ComboBox, what do you get ?
-
wrote on 4 Dec 2024, 13:31 last edited by
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?
-
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?
wrote on 4 Dec 2024, 13:36 last edited by@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? -
wrote on 27 Mar 2025, 03:00 last edited by
Did you try removing the qsTr() from around the strings? Might work that way.... I think I had something like this....