Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Notify app style change
Qt 6.11 is out! See what's new in the release blog

Notify app style change

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.1k Views 2 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.
  • D Offline
    D Offline
    dextermagnific
    wrote on last edited by
    #1

    Hi all,

    I'm writing a themable style engine (QStyle derived). This style comes with a custom app that allows to tweak it. I'd like to notify all Qt apps of style/config changes when I press "apply" button on my app.

    I searched a lot and all I can find is the following code from KDE that does not work:

    void ThemeManagerUI::notifyConfigurationChange()
    {
      qDebug() << "notifyConfigurationChange()";
    
      QByteArray stamp;
      QDataStream s(&stamp, QIODevice::WriteOnly);
      s << QDateTime::currentDateTime();
    
      QByteArray settings_atom_name("_QT_SETTINGS_TIMESTAMP_");
      settings_atom_name += XDisplayString(QX11Info::display());
    
      xcb_connection_t *xcb_conn = QX11Info::connection();
      xcb_intern_atom_cookie_t cookie = xcb_intern_atom(xcb_conn, false, settings_atom_name.size(), settings_atom_name.constData());
      xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(xcb_conn, cookie, 0);
      xcb_atom_t atom = reply->atom;
      free(reply);
    
      xcb_change_property(xcb_conn, XCB_PROP_MODE_REPLACE, QX11Info::appRootWindow(), atom, XCB_ATOM_ATOM,
                          8, stamp.size(), (const void *)stamp.constData());
    
      //XChangeProperty(QX11Info::display(), QX11Info::appRootWindow(0),
                      //ATOM(_QT_SETTINGS_TIMESTAMP), ATOM(_QT_SETTINGS_TIMESTAMP), 8,
                      //PropModeReplace, (unsigned char *)stamp.data(), stamp.size());
    }
    

    This code is from KDE KStyle KCM module but I have no luck. Do you have any idea ?

    Thank you

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      I'd recommend contacting the KDE folks directly about that matter.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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