Results 1 to 8 of 8

Thread: Using kwm window caption bar color

  1. #1
    Join Date
    Jan 2006
    Location
    Victoria BC
    Posts
    6
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Using kwm window caption bar color

    I am writing an application using Qt on a Linux box running KDE. To limit the use of custom colors in the application I have tried to stick to the palette color that are easily accessed using Qt functions e.g. setPaletteBackgroundColor() and QColorGroup etc. However, I can't seem to find anyway to access the color used in the kwm caption decoration.

    I am running Fedora 4 and Qt3.3 KDE 3.5 that comes with it. I note that there is a KDE class KDecoration that is not included in my release but is there any other way that I can use the KDE theme colors in my application?

    OldJohnB

  2. #2
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Using kwm window caption bar color

    I think that you cannot check titlebar color with Qt, you'll have to use KDE libs for that. Maybe because Qt has nothing to do with kdm. Qt apps can be used with any standard window manager and hence providing a standard way for checking color is very difficult if not impossible.

    Correct me if I am wrong.

  3. #3
    Join Date
    Jan 2006
    Location
    Victoria BC
    Posts
    6
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Using kwm window caption bar color

    I am sure you are right in the sense that Qt will not be able to change the KDE color theme. However, I think Qt does use the colors used by whatever platform it is installed on since the widget background, foreground, highlight etc. colors are derived from the OS window colors? So why can't I get the window caption (title bar) color?

    OldJohnB

  4. #4
    Join Date
    Jan 2006
    Location
    India
    Posts
    115
    Thanks
    3
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Using kwm window caption bar color

    Quote Originally Posted by OldJohnB
    ...I think Qt does use the colors used by whatever platform it is installed on ...
    Then why Qt4 is not using colors from my current KDE configuration.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using kwm window caption bar color

    Because KDE3 uses Qt3 and not Qt4, thus Qt4 apps don't have any knowledge of KDE3 (including the styles and decorations).

  6. #6
    Join Date
    Jan 2006
    Location
    Minsk, Brest, Belarus
    Posts
    54
    Thanks
    3
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Red face Re: Using kwm window caption bar color

    Quote Originally Posted by OldJohnB
    I am writing an application using Qt on a Linux box running KDE. To limit the use of custom colors in the application I have tried to stick to the palette color that are easily accessed using Qt functions e.g. setPaletteBackgroundColor() and QColorGroup etc. However, I can't seem to find anyway to access the color used in the kwm caption decoration.

    I am running Fedora 4 and Qt3.3 KDE 3.5 that comes with it. I note that there is a KDE class KDecoration that is not included in my release but is there any other way that I can use the KDE theme colors in my application?

    OldJohnB
    As I understand you want to use your kwin(kde's wm) colors. There are no problem: take a look at $HOME/.kde/share/config/kdeglobals (or another kde config). Find there the setting you need and use in your own app.

    I used this method to create QIconThemeProvider (QT4). It's a class that automatically provides KDE's pixmaps for my application according to the KDE's settings, current icon theme and etc...

    But be careful - you should make a check if there is kde installed on the computer!

    If you want to know more - write to me:
    demogorgorn AT gmail.com

  7. #7
    Join Date
    Jan 2006
    Location
    Victoria BC
    Posts
    6
    Qt products
    Qt3
    Platforms
    Unix/X11

    Smile Re: Using kwm window caption bar color

    Thanks, looks like a promising approach but it would be nice if there was a ready made function for extracting the colors?

  8. #8
    Join Date
    Jan 2006
    Location
    Victoria BC
    Posts
    6
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Using kwm window caption bar color

    Hi Xagen, Tried to reach you by email but messages were returned. I wrote:

    Thanks for the suggestion. I've had a look in $HOME/.kde/share/config/kdeglobals and found the colors that look like my current kde color theme. My question now is how do I access these automatically from C++ code. Did you search the file and parse the appropriate line in kdeglobals or is there a function that does that for you?

Similar Threads

  1. Replies: 8
    Last Post: 2nd February 2009, 12:25
  2. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 09:30
  3. qtopia window decoration cannot show caption
    By qtopiahooo in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 13th March 2007, 08:09
  4. window decoration cannot show caption
    By qtopiahooo in forum Qt Programming
    Replies: 1
    Last Post: 31st January 2007, 08:17
  5. QPalette won't set QLabel's Window & Foreground color
    By koklim in forum Qt Programming
    Replies: 6
    Last Post: 23rd January 2006, 10:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.