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?
Forum Updated to NodeBB v4.3 + New Features

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 375 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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
      1
      • SGaistS SGaist

        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 last edited by
        #3

        @SGaist Would I be able to save multiple configurations?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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

          • Login

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