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. How to change SystemPalette globally in linux
Forum Updated to NodeBB v4.3 + New Features

How to change SystemPalette globally in linux

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 376 Views 1 Watching
  • 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.
  • A Offline
    A Offline
    alex_jeff
    wrote on last edited by alex_jeff
    #1

    in the following example, when I change my system theme in KDE plasma, the rectangle color changes since SystemPalette is changed (on runtime without restarting the application):

    import QtQuick 2.15
    import QtQuick.Window 2.15
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    
        SystemPalette {
            id: palette
            colorGroup: SystemPalette.Active
        }
    
        Rectangle{
            anchors.centerIn: parent
            width: 200
            height: width
    
            color: palette.base
    
        }
    }
    

    it's not using any IPC mechanism, it's not watching any config files( like plasmarc or kdeglobals), and it's not using any KDE plugins or libraries, but still, it can understand changes in the color system.
    how can I change SystemPalette globally so that it can be affected in all qt based applications without explicitly using the IPC mechanism or watching changes in settings files? (I'm familiar with XDG standards and tried to study KDE plasma source code, still can't understand how this can be done )
    thanks.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alex_jeff
      wrote on last edited by
      #2

      I'm still struggling with this, any help is appreciated.

      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