Results 1 to 4 of 4

Thread: QPainter Question

  1. #1
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Red face QPainter Question

    Hi
    I would like to add a industry-specific primitive to QPainter. So when I use QGraphicsScene or write to a PDF device, this primitive can be used. How would I archive this?

    thanks in advance
    Andrew

  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: QPainter Question

    Could you provide more details? Why would you want to add such a primitive?

  3. #3
    Join Date
    Jan 2008
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPainter Question

    Hi
    I wanted to do this to pass a file through the painting system into a QGraphicScene with the primitives from the file. This would allow the industry-specific primitives to be edited instead of the basic painter primitives

    The way I found to do this is to use QPaintPath.

    Thanks for your post
    Andrew

  4. #4
    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: QPainter Question

    From what you say it probably means you want to implement a custom QGraphicsItem. You don't need to modify the painter object, simply reimplement QGraphicsItem::paint().

  5. The following user says thank you to wysota for this useful post:

    atb (19th March 2008)

Similar Threads

  1. QPainter bounds question
    By Micawber in forum Qt Programming
    Replies: 3
    Last Post: 23rd October 2007, 14:09
  2. QPainter, setWindow, setViewport question
    By Micawber in forum Qt Programming
    Replies: 4
    Last Post: 3rd September 2007, 18:33
  3. Question on QPainter setWindow use
    By impeteperry in forum Qt Programming
    Replies: 14
    Last Post: 8th August 2006, 13:26
  4. Replies: 7
    Last Post: 20th March 2006, 20:03

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.