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. When a dock widget is floating, how to reset it back to its initial area when a button is pressed?
QtWS25 Last Chance

When a dock widget is floating, how to reset it back to its initial area when a button is pressed?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 292 Views
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on 9 Jul 2021, 14:35 last edited by
    #1

    Hello everyone, hope all is well! Currently I want to create a function that moves all dock widgets back to their initials places if a certain button is pressed. I am currently using the isFloating method to detect if the dock is not in its initial area. However, I am still trying to figure out how to have the program place the dock back in its initial dockWidgetArea when the button is pressed. Any advice on how to do this?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 9 Jul 2021, 20:36 last edited by
      #2

      Hi,

      One way would be to store that information when your application starts or ends for the next usage and then reload that configuration.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      ? 1 Reply Last reply 9 Jul 2021, 23:25
      1
      • S SGaist
        9 Jul 2021, 20:36

        Hi,

        One way would be to store that information when your application starts or ends for the next usage and then reload that configuration.

        ? Offline
        ? Offline
        A Former User
        wrote on 9 Jul 2021, 23:25 last edited by
        #3

        @SGaist Would I be able to save multiple configurations?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 10 Jul 2021, 19:03 last edited by
          #4

          Well, I don't see a reason why you couldn't. Implement the saving part in such a way. You can use a key value approach with the name of the "layout configuration" as a key and your widgets configuration as the value.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          1/4

          9 Jul 2021, 14:35

          • Login

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