Results 1 to 7 of 7

Thread: how to mark a point on image.Image is already draw on QLabel and set using setPixmap

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to mark a point on image.Image is already draw on QLabel and set using setPix

    To answer your question, just call the base class in your paintEvent:

    Qt Code:
    1. void Widget::paintEvent(QPaintEvent * event) {
    2. //this will draw your widget, and therefore the label too
    3. QWidget::paintEvent(event);
    4.  
    5. //then draw your point
    6. Qpainter painter(this);
    7. painter.drawPoint(x, y);
    8. }
    To copy to clipboard, switch view to plain text mode 

    But to answer your problem, if you are trying to implement a GIS engine with QLabeland painting points, maybe you should better read the documentation about about QGraphicsViewand QGraphicsPixmapItem.
    Last edited by scascio; 20th September 2009 at 15:35.

  2. The following user says thank you to scascio for this useful post:

    bpatel (21st September 2009)

  3. #2
    Join Date
    Sep 2009
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how to mark a point on image.Image is already draw on QLabel and set using setPix

    @above
    tbahks yaar for reply

Tags for this Thread

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.