I have a map as a image in my Qlabel, now i want to draw a rectangle over the image how to i do it? Because at the end of the day i need the rect(which is my robot footprint to be able to move accordingly. i tried :
MainWindow::MainWindow(Tqt_interface* tqt, QWidget *parent ) : QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QPixmap pix("/home/liqi/Qt_robotino/src/image/ariccmap.png");
ui->labelmap->setPixmap(pix);

QRectF rectangle(10.0, 20.0, 200.0, 200.0);
QPainter painter(this);
painter.drawRect(rectangle); // drawing code
}
but the rectangle does not appear. Any helps is appreciated.