Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Can I override / fix a dock widget's position while it is being dragged?
Qt 6.12 LTS is out! See what's new in the release blog

Can I override / fix a dock widget's position while it is being dragged?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 509 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.
  • K Offline
    K Offline
    Kirinyale
    wrote on last edited by
    #1

    I have a dock widget which switches between horizontal and vertical layouts depending on where it is docked (basically, it's a container for toolbars). Since Qt doesn't know about this logic and makes calculations based on the last known layout, sometimes it prevented me from docking the widget where I want on smaller screens - which I solved by switching it to an "orientation-neutral" layout (which adds a linebreak between each pair of toolbars) as soon as I get topLevelChanged(true) signal.

    All of this works great, but, unfortunately, changing widget's size while it is being dragged can cause it to jump very far away from mouse cursor (e.g. if you undock a horizontal toolbar block by dragging it by the right part of its titlebar). I tried fixing it by calling move() or setGeometry() on the dock widget after changing its layout, but it does nothing. Is there any way to fix it? (i.e. make it jump back to cursor)

    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
    • Unsolved