Results 1 to 4 of 4

Thread: QtCanvasPolygon does not paint

  1. #1
    Join Date
    Apr 2006
    Location
    Saint-Petersburg, Russia
    Posts
    63
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default QtCanvasPolygon does not paint

    Hello, All !

    I want to draw polygon on QtCanvasView. I make
    Qt Code:
    1. QtCanvasView *view;
    2. QtCanvasPolygon scrPol (view->canvas());
    3. scrPol.setPoints (scrPts);
    4. QPen selPen (Qt::red);
    5. scrPol.setPen (selPen);
    6.  
    7. QBrush selBrush (Qt::red, Qt::DiagCrossPattern);
    8. scrPol.setBrush (selBrush);
    9. view->repaint ();
    To copy to clipboard, switch view to plain text mode 
    But my polygon doesn't paint, I check coordinates of vertexes, all are correct.

    Thanks in advance.
    Best regards,
    Yuriy Rusinov.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QtCanvasPolygon does not paint

    Are you sure you are not drawing off screen?

    BTW, the code you posted is not exactly valid. Is that what you really use, or is it something you just gave as an example?

    Regards

  3. #3
    Join Date
    Apr 2006
    Location
    Saint-Petersburg, Russia
    Posts
    63
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QtCanvasPolygon does not paint

    something you just gave as an example?
    I put this view on frame and another objects draws successfully.
    Best regards,
    Yuriy Rusinov.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QtCanvasPolygon does not paint

    Have you tried setting a width for the pen?

Similar Threads

  1. Drawing standard widgets using a custom paint engine
    By Waywocket in forum Qt Programming
    Replies: 26
    Last Post: 21st October 2010, 20:40
  2. cairo4qt 0.9 - a cairo based paint engine for Qt4
    By dragchan in forum Qt-based Software
    Replies: 0
    Last Post: 18th May 2007, 05:07
  3. Using QGLWidget paint engine to draw regular widgtes?
    By high_flyer in forum Qt Programming
    Replies: 11
    Last Post: 9th October 2006, 12:06
  4. How to paint across/over multiple widgets?
    By richy in forum Qt Programming
    Replies: 3
    Last Post: 31st August 2006, 10:57
  5. paint QTreeView item !!
    By mcenatie in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2006, 14:24

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
  •  
Qt is a trademark of The Qt Company.