To answer your question, just call the base class in your paintEvent:
//this will draw your widget, and therefore the label too
//then draw your point
Qpainter painter(this);
painter.drawPoint(x, y);
}
void Widget::paintEvent(QPaintEvent * event) {
//this will draw your widget, and therefore the label too
QWidget::paintEvent(event);
//then draw your point
Qpainter painter(this);
painter.drawPoint(x, y);
}
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.
Bookmarks