Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-58095

Unable to restore position/state of hidden/removed floating QToolBar

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.7.0
    • Widgets: Main Window
    • None
    • Windows 10, Qt 5.7.0. MSVC 2015

    Description

      tl;dr - Question: Why isn't there a restoreToolBar akin to restoreDockWidget?

      Steps to Reproduce:

      • Compile and run attached main.cpp
      • Undock/Float Toolbar 2 (TB2 buttons) (& for comparison, undock Dock 2)
      • Use toolbar context menu to "hide" Toolbar 2 (& for comparison, Dock 2)
      • Click 'View 2' to switch to a view where Toolbar 2 (& Dock 2) don't/shouldn't exist
      • Quit the program
      • Re-run the program

      Expected Results: Toolbar 2 (& Dock 2) hidden. On 'show' from the context menu, they're correctly placed and floating.

      Actual Results: Toolbar 2 is visible, when it shouldn't be. (Dock 2 works as expected)

      I have tried many attempts to have View-specific display of toolbars, akin to dockwidgets, which works fine. By "View-specific display" I mean, that a given view only has certain widgets available to the user, but we save/maintain the location of all of them for when they are visible. DockWidgets does this fine via restoreDockWidgets. Attempt 2 - currently uncommented and demonstrated above - is clearly poorly written (setHidden(true) forces visible), but there doesn't seem to be a clear solution with toolbars as there is with dock widgets. Happy to solicit alternatives/suggestions for handling this.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            erika Erika
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes