Results 1 to 5 of 5

Thread: Change Stylesheet Using Dynamic Property

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Change Stylesheet Using Dynamic Property

    I ran into the same problem. The documentation somehow suggests to use dynamic properties to style your widgets but this only works at initialization time or when you call setStyleSheet explicitly after you have altered the property's value. I'm actually doing a

    Qt Code:
    1. button->setStyleSheet(button->styleSheet())
    To copy to clipboard, switch view to plain text mode 

    after each property change.

  2. #2
    Join Date
    Feb 2010
    Location
    Sydney, Australia
    Posts
    111
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    18
    Thanked 5 Times in 5 Posts

    Default Re: Change Stylesheet Using Dynamic Property

    This is exactly what I found. It does somewhat defeat the purpose of dynamic style properties, but it's still better than having to recreate the stylesheet every time!

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: Change Stylesheet Using Dynamic Property

    It's just a wild guess: Does it help if you define a NOTIFY signal for your property?

Similar Threads

  1. Replies: 5
    Last Post: 10th October 2012, 22:05
  2. How to mark Property name in Q_PROPERTY for language change??
    By Ankitha Varsha in forum Qt Programming
    Replies: 7
    Last Post: 14th April 2010, 14:22
  3. Dynamic property and stylesheets
    By aamer4yu in forum Qt Programming
    Replies: 10
    Last Post: 18th November 2009, 19:26
  4. Replies: 1
    Last Post: 18th February 2009, 09:34
  5. Difficult:Dynamic Icon size change?!?
    By nupul in forum Qt Programming
    Replies: 4
    Last Post: 10th April 2006, 10:39

Tags for this Thread

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.