Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Movable semi transparent image on top of another widget

Movable semi transparent image on top of another widget

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 795 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    racerXali
    wrote on last edited by A Former User
    #1

    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.

    J.HilkJ 1 Reply Last reply
    0
    • R racerXali

      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.

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @racerXali
      hi,

      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

      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      1
      • R Offline
        R Offline
        racerXali
        wrote on last edited by
        #3

        @J.Hilk

        I think this is exactly the explanation i needed.
        Thanks a lot for explaining in such a nice way..:)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved