Is it possible to make an image with buttons on it
-
Two questions.
I'm trying to make a map with buttons that can be clicked on it, curious if it's possible to put buttons on the image, like have the map as a background image with buttons on the image?
Also is it possible to show only a portion of an image that you could drag and drop to show more of the image? The image is 9600x6800 pixels, and I'd like a widget to show 1024x800 of it at a time but the image is draggable to reveal more of it
-
Hi
1:
Yes, say you use a QLabel to display the map/image. Then you
can just place the buttons on top of it.
2:
You can use a scrollArea or QGraphicsView ( which have drag panning pr default)
to show a section of the full image but it cant progressively load more of the image on demand.
For such feature, you must hand program that using some sort of tilesystem. -
i wouldnt want it to load more of the image per say, it would have the entire image loaded, just the parts that arent within the 1024x800 view arent visible until you drag or scroll the image in a way that would put that section of the image in the view
The blue box would be the visible region while the green box is the entire image, where you could only see the part of the image that is within the blue box
-
@SolaVitae
Ok then the default
classes will just work.Maybe you can try with
http://doc.qt.io/qt-5/qtwidgets-widgets-imageviewer-example.html