Results 1 to 3 of 3

Thread: want to draw points in QGraphicsScene

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question want to draw points in QGraphicsScene

    I have a QGraphicsScene object where I would like to draw a series of points. I know that I can add a QPainterPath to draw more complex objects but I don't see how I can draw points. The only way that I can see is to draw them using QPainter::drawPoints but I don't really see a way to get that into the scene.

    Is there a way to do this that I am missing?

    Thanks,
    ntp

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: want to draw points in QGraphicsScene

    You can draw small circles instead of points or you can create a custom item that represents a set of points.

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

    ntp (10th April 2008)

  4. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: want to draw points in QGraphicsScene

    If ur points are constant, u can draw them in background or foreground

    These might help you -
    QGraphicsScene::drawForeground ( QPainter * painter, const QRectF & rect )
    QGraphicsScene::drawBackground ( QPainter * painter, const QRectF & rect )

Similar Threads

  1. How to draw some points and lines?
    By luffy27 in forum Qt Programming
    Replies: 1
    Last Post: 24th November 2006, 17:47

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.