Results 1 to 2 of 2

Thread: Style sheet for QGraphicsItem?

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Style sheet for QGraphicsItem?

    Hi,

    I know I can use style sheet for QWidget, such as:

    Qt Code:
    1. QWidget#foo {
    2. font-family: Arial;
    3. font-weight: normal;
    4. font-size: 9px;
    5. }
    To copy to clipboard, switch view to plain text mode 

    Is there a way to use style sheet for QGraphicsItem or QGraphicsWidget? QGraphicsWidget has setStyle method...

    For instance, I need:

    Qt Code:
    1. QGraphicsWidget#widget1 {
    2. font-family: Arial;
    3. font-weight: normal;
    4. font-size: 20px;
    5. }
    To copy to clipboard, switch view to plain text mode 

    But this doesn't work.

    Any suggestion is appreciated.

  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: Style sheet for QGraphicsItem?

    No, you can't use stylesheets with graphics items.
    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.


Similar Threads

  1. Style Sheet Question
    By zgulser in forum Newbie
    Replies: 1
    Last Post: 26th April 2012, 19:27
  2. Qt Style Sheet Vs Code
    By Ashutosh2k1 in forum Qt Programming
    Replies: 4
    Last Post: 4th May 2011, 06:45
  3. Problems with Gradient style used through Style sheet on ARM platform
    By puneet.narsapur in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 25th January 2010, 12:48
  4. QToolButton and Style sheet
    By desch in forum Qt Programming
    Replies: 8
    Last Post: 1st December 2007, 08:38
  5. How to use style sheet
    By safknw in forum Qt Programming
    Replies: 1
    Last Post: 20th November 2006, 13:05

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.