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
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    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: how to mark a point on image.Image is already draw on QLabel and set using setPix

    Did you try compiling this code? IMO it won't compile.

    You need to call the base class implementation in the paint event, that's for sure.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    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.

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

    bpatel (21st September 2009)

  4. #3
    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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.