Results 1 to 5 of 5

Thread: How can I draw on Qlabel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    36
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default How can I draw on Qlabel

    I want to draw a shape on Qlabel but I can not draw anything in below code
    .How can I do it



    Qt Code:
    1. void MyPainter::paintEvent(QPaintEvent *event)
    2. {
    3. QPainter painter(ui.label);
    4. painter.setRenderHint(QPainter::Antialiasing, true);
    5. painter.setPen(QPen(Qt::black, 15, Qt::SolidLine, Qt::RoundCap,
    6. Qt::MiterJoin));
    7. painter.setBrush(QBrush(Qt::blue, Qt::DiagCrossPattern));
    8. painter.drawPie(80, 80, 400, 240, 60 * 16, 270 * 16);
    9.  
    10. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 4th August 2008 at 07:25. Reason: missing [code] tags

Similar Threads

  1. Replies: 3
    Last Post: 17th July 2008, 07:43
  2. want to draw points in QGraphicsScene
    By ntp in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2008, 18:14
  3. QLabel ScaledContents ignored by style sheet?
    By WinchellChung in forum Newbie
    Replies: 3
    Last Post: 27th February 2008, 14:50
  4. QLabel size policy
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2007, 17:57
  5. QScrollArea display custom QLabel
    By spawnwj in forum Qt Programming
    Replies: 6
    Last Post: 6th December 2006, 03:38

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.