Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Everything is black and white!



  • Hi, I am completly new to QTQuick and trying to get a feel for things. I am contributing to a project that uses qtquick and want to fix some styling, so I thought I would do a simple app where I could test things out first. But the simple app doesn't appear to accept any of the colors I am applying everything is just shades of grey.
    Any suggestions?
    Thanks,
    Paul

    import QtQuick 2.9
    import QtQuick.Window 2.2
    import QtQuick.Controls 2.2
    import QtQuick.Layouts 1.3
    import QtQuick.Controls.Styles 1.4
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        ColumnLayout{
            spacing :2
            Label{
                text: qsTr("Hi")
                color:"#ff0000"
            }
            ComboBox{
                model:["Hi","hello"]
    
                ComboBoxStyle{
                    textColor: "#ff0000"
                    selectedTextColor: "#0000ff"
                    background: {
                    color:"#00ff00"
                    }
                }
    
            }
        }
    }
    
    

  • Moderators

    Hi @BuxtonPaul and welcome

    I tested your example,

    the Label (text)color is changed correctly to red however for my 5.12.4 Qt version I get reference errors for the ComboBoxStyle which will result in no color changes.

    To you have them too?
    8e3a6cce-17f6-4d6e-8058-17f67a3488ce-image.png



  • QtQuick.Controls.Styles can be applied only to QtQuick.Controls 1 (which are deprecated btw), while you are using QtQuick.Controls 2.2.


Log in to reply