Results 1 to 3 of 3

Thread: Using more than one QStyle

  1. #1
    Join Date
    Jan 2011
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Using more than one QStyle

    Hi.
    I wanted to write an application which uses two different styles. For both styles I have a QStyle based class. I know that I can use the QStyle via QApplication and I read that I can apply a style to a (single) widget. But is there a way that all childs will use this style, too?
    Can I apply a QStyle to the application and another QStyle to all widgets wich are childs (or childs of childs of childs ...) of a special widget?

    (I'm using Qt 4.8)

  2. #2
    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 more than one QStyle

    You can write a function that recursively applies the style to all children of a widget.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2011
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using more than one QStyle

    That would be a good idea, if the view would not change over time.
    My view is flexible. The visible pages change regarding to user input (so also the childs of the main window change).

Similar Threads

  1. Replies: 2
    Last Post: 14th July 2011, 12:28
  2. QStyle learning
    By lzpmail in forum Qt Programming
    Replies: 1
    Last Post: 30th May 2011, 13:44
  3. QStyle's question
    By aoo7wangyan in forum Qt Programming
    Replies: 1
    Last Post: 15th July 2009, 09:42
  4. how to rewrite QStyle
    By trytoremeber963 in forum Newbie
    Replies: 3
    Last Post: 28th April 2009, 08:18
  5. name of current QStyle
    By darksaga in forum Qt Programming
    Replies: 1
    Last Post: 31st August 2007, 20:02

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.