Results 1 to 2 of 2

Thread: StyleSheet and paintEvent()

  1. #1
    Join Date
    Feb 2007
    Location
    Wroclaw, Poland
    Posts
    72
    Thanks
    6
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default StyleSheet and paintEvent()

    Hi.
    My widget has his own paintEvent where, depending on some variable I draw different figures (ellipse or rect).
    So I though that I'll configure drawing params and colors from styleSheet. But somehow it doesn't won't to work. Heres my css.
    Qt Code:
    1. RP3DevicePaint {
    2. border-width: 2px;
    3. border-style: solid;
    4. border-color: black;
    5. background: white;
    6. }
    To copy to clipboard, switch view to plain text mode 

    PS. Is there possibility to set widget figure (like circle or rectangle) from within css?

  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: StyleSheet and paintEvent()

    You can't use stylesheets with custom widgets. Unless of course you call QStyle to do the base class work.
    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.


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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.