Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Nested QToolBar state restore not working

    General and Desktop
    2
    4
    597
    Loading More Posts
    • 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.
    • F
      FlawedLogic last edited by

      Hi,

      I have an application based on QMainWindow which has toolbars in it that the user can dock as they please.

      I want to save and restore this state (along with some QDockWidgets) when the programme exits/starts.

      Most of this I have working OK using the saveState/restoreState functions, but with one major problem.

      If the user has more than one row of toolbars the restoreState function puts all the toolbars back in a single row, not in the multiple rows I started with and there doesn't appear to be any way of programmatically creating more than one row to fix it after the event.

      Any ideas how I can get this working (short of throwing away all the QMainWindow functionality and writing my own)?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by SGaist

        Hi,

        Did you give all your toolbars object names ?

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

        F 1 Reply Last reply Reply Quote 0
        • F
          FlawedLogic @SGaist last edited by

          I thought I was, I'm allocating UUIDs for the names and then reasserting them when I recreate the toolbars.

          I took a closer look after your response, turns out I had forgotten two that aren't optional for the user and it was these two stopping the others from correct placement.

          Thanks very much, problem solved.

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            Glad you found !

            Since you have it working now, please mark the thread as solved using the "Topic Tool" 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 Reply Quote 0
            • First post
              Last post