5
votes

Is it possible to override only one property of style, for example, combobox?

ComboBox {
        id: comboBox

        anchors.fill: parent

        style: ComboBoxStyle {
            label: Component {
               Text {
                    text: "Players -> " + comboBox.currentText
                }
            }
        }
    }

In KDE this combobox looks ugly because it does not use kde theme style and uses default's one.

ComboBox with overriden styles and without style override: ComboBox with overriden styles and without style override

I need to have a combobox styled like last one on this image but with custom text.

1
Which property do you want to override? a label? - folibis
Yes, a label in this particular case. - Victor Polevoy

1 Answers

0
votes

I understand that you want native look and feel with custom behaviour.

You cannot acheive this out-of-the box with QtQuick Controls 1 or 2 as mentionned in this Qt mailing list post.

You may be able to get a native style with Qt Widgets, but in addition to the added work with Qt Widgets, I don't know if you can get a themed native style…

You can wait for Qt 6 CommonControls as mentionned here : http://blog.qt.io/blog/2017/02/06/native-look-feel/ but it won't allow you to customize much, as stated in the post.