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. Everything is black and white!
Qt 6.11 is out! See what's new in the release blog

Everything is black and white!

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 476 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.
  • B Offline
    B Offline
    BuxtonPaul
    wrote on last edited by
    #1

    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"
                    }
                }
    
            }
        }
    }
    
    
    J.HilkJ 1 Reply Last reply
    0
    • B BuxtonPaul

      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"
                      }
                  }
      
              }
          }
      }
      
      
      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      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


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      0
      • IntruderExcluderI Offline
        IntruderExcluderI Offline
        IntruderExcluder
        wrote on last edited by IntruderExcluder
        #3

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

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved