Results 1 to 4 of 4

Thread: How to apply stylesheet to all of my Qt applications ?

  1. #1
    Join Date
    Feb 2014
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default How to apply stylesheet to all of my Qt applications ?

    Hi,

    I'm a Qt applications' user, not (yet) a developper.

    In order to tune the look of my Qt apps', I wrote a small stylesheet. I tested it, with the command line option -stylesheet and it looks cool. Now I would like to apply it "permanently" to all of my Qt apps'.

    I thought I could do it with qtconfig or ~/.config/Trolltech.conf but I can't. I googled a lot and I can't find any tip or documentation. Actually, I'm not even sure if it's possible… I know that I can apply a home-made style or a built-in style, maybe a plugin but I wrote a stylesheet.

    So how to apply stylesheet to all of my Qt applications ?
    Any tip or documentation is welcome.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: How to apply stylesheet to all of my Qt applications ?

    Good question!

    I think there is no way to configure a stylesheet across applications, but there might be a style plugin that supports that.

    Cheers,
    _

  3. #3
    Join Date
    Feb 2014
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: How to apply stylesheet to all of my Qt applications ?

    Thank you for your fast reply !

    What do you mean by "a style plugin" ?
    Do I need to rewrite the style or can I embed the stylesheet in the "style plugin" ?
    Can you point me some documentation if you know some ?

    Thank you anyway.
    I will search this way.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: How to apply stylesheet to all of my Qt applications ?

    Basically all widget styles are plugins, loaded by the application at runtime.
    Which one usually depends on the platform or configuration but is sometimes hard coded by the application.

    There could be such a style that allows to customize its look through its own configuration, maybe even allow to do that using stylesheets.

    Cheers,
    _

Similar Threads

  1. Replies: 0
    Last Post: 13th January 2013, 00:20
  2. How to Apply stylesheet to QMessageBox?
    By sudhansu in forum Qt Programming
    Replies: 1
    Last Post: 7th January 2010, 08:32
  3. Replies: 4
    Last Post: 28th March 2008, 04:55
  4. Replies: 8
    Last Post: 17th March 2008, 14:04

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
  •  
Qt is a trademark of The Qt Company.