Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Movable semi transparent image on top of another widget
racerXali last edited by A Former User
I need to put a small image logo on top of another widget that can be moved anywhere on that widget on mouse drag.
Please tell me if its possible and how should i implement this.
Yes, this is possible and relatively easy.
I'll write a short summery on how I would approach this:
- I would use QLabel to load and display the img
- Subclass QLabel so that you can overwrite/access Mouse-Events
- Make sure the parent of your custom label is the widget you want as border
- Wenn mouse pressed and moved, use
move()of your custom QLabel to change the position
- Check if the new Position is still inside the bounds of the parent, of course, or do not move
racerXali last edited by
I think this is exactly the explanation i needed.
Thanks a lot for explaining in such a nice way..:)