Results 1 to 2 of 2

Thread: drawing problem

  1. #1
    Join Date
    Jun 2006
    Posts
    34
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default drawing problem

    Hi all,
    Can some body explain how to draw a polygon in a Widget. I just want something
    like this,
    poly.png




    Thanks in advance,
    Boss

  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: drawing problem

    Qt Code:
    1. void myWidget::paintEvent(QPaintEvent *e){
    2. QPainter painter(this);
    3. QPoint points[] = { QPoint(100, 100), QPoint(150, 80), QPoint(200, 150), QPoint(140, 200) };
    4. painter.drawPolygon(points, 4); // you can use polyline instead of polygon too
    5. }
    To copy to clipboard, switch view to plain text mode 

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


Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.