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. Nested QToolBar state restore not working

Nested QToolBar state restore not working

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 793 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.
  • F Offline
    F Offline
    FlawedLogic
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      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
      0
      • SGaistS SGaist

        Hi,

        Did you give all your toolbars object names ?

        F Offline
        F Offline
        FlawedLogic
        wrote on last edited by
        #3

        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
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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
          0

          • Login

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