Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to save / restore dynamic toolbar state
Qt 6.12 LTS is out! See what's new in the release blog

How to save / restore dynamic toolbar state

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.3k 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.
  • Roy44R Offline
    Roy44R Offline
    Roy44
    wrote on last edited by
    #1

    Hi,

    I develop an application with modules. These modules can be loaded or released
    by user. When a module is loaded a toolbar is created (by the module) and added in main window.
    User can arrange the tool bars positions.
    I would like to save the position of these toolbars.
    QMainWindow::restoreState do not what I want
    (tool bar order is not correct)
    before save state the toolbar profile is on bottom
    after restore state the toolbar profile is on top and an other toolbar is on bottom.
    Followin Qt doc I can retrieve visibility / area of toolbar but Idon't know how to retrieve it's position.

    Do you have any idea ?
    thanks.

    sorry for my bad english

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you set the object name of your toolbars ?

      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
      0
      • Roy44R Offline
        Roy44R Offline
        Roy44
        wrote on last edited by
        #3

        I found the solution just after written my question.
        I did not set object name, that's why it did not works.
        thanks for your answer, You're faster than me.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          Since you have it working, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

          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
          0

          • Login

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