Results 1 to 3 of 3

Thread: Rendering SVG on a paint event

  1. #1
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Rendering SVG on a paint event

    Hi! I'm trying to paint a SVG in a QGraphicsItem in the paint event. I did it this way:
    Qt Code:
    1. QSvgRenderer svg(QString("SCD_shadow.svg"), this);
    2. svg.render(painter);
    To copy to clipboard, switch view to plain text mode 
    Unfortunately nothing is rendered. I also tried with a specific rect, but still nothing is rendered. Any idea why? I tried to build a QSvgWidget and it works fine.
    Thanks for any advice!

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

    Default Re: Rendering SVG on a paint event

    Make sure your path is valid!

  3. The following user says thank you to Lykurg for this useful post:

    Luc4 (31st March 2010)

  4. #3
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Rendering SVG on a paint event

    Seems it was some kind of problem with separators with different OSes. The code on SVG is ok. Sorry for the question. Thanks!

Similar Threads

  1. setPixmap and Paint Event
    By Magu in forum Newbie
    Replies: 7
    Last Post: 11th March 2010, 10:32
  2. Timer event & paint event, priority
    By Teuniz in forum Qt Programming
    Replies: 0
    Last Post: 2nd February 2010, 13:33
  3. Paint event function in key press event
    By soumya in forum Qt Programming
    Replies: 6
    Last Post: 2nd February 2010, 12:40
  4. Reimplementig paint event
    By ale301168 in forum Newbie
    Replies: 4
    Last Post: 13th November 2009, 11:11
  5. Drag the paint event
    By jsmith in forum Qt Programming
    Replies: 2
    Last Post: 22nd July 2009, 14:51

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.