I'm developing an image viewer, based on a QScrollArea and a QLabel that contains the image to show.
Now, I need to show text over the l开发者_如何学Pythonabel, like the current mouse (x,y) position, image size, etc., in a specific point, but it can't be affected by the scrolling.
How can I do this?
The first thing I would try is:
container = new QWidget();
scrollArea = new QScrollArea(container);
pic = new QLabel();
pic->setPixmap(...);
scrollArea->setWidget(pic);
infoLabel = new QLabel("mouse is at 0, 0", container);
infoLabel->move(20, 20); // the desired non-scrolling position
精彩评论