Qt Forum

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

    Unsolved Adding central toolbar to QMainWindow with QDockWidgets

    General and Desktop
    qdockwidget qtoolbar
    2
    2
    690
    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.
    • j-b-m
      j-b-m last edited by

      In my app (video editor), I have a bottom Central Widget with QDockWidgets above. Now I would like to have a toolbar at the center of the app (below dockwidgets but above central widget). Qt only allows the 4 QDockWidgetArea (top, bottom, left, right) for toolbar docking. Is there a way to customize this and allow a toolbars to be docked at the center of the app just above central widget ?

      I know I can create a custom toolbar and add it as widget to the layout but then I loose the nice QMainWindow toolbar features (customizing, moving toolbar)

      I want something like this:

      | Main Toolbar                  |
      ---------------------------------
      | Dock Widget 1 | Dock Widget 2 |
      ---------------------------------
      | Central Toolbar               | 
      ---------------------------------
      | Central Widget                | 
      

      Any help appreciated.

      1 Reply Last reply Reply Quote 0
      • Chris Kawa
        Chris Kawa Moderators last edited by Chris Kawa

        Hi and welcome to the forum.

        This isn't directly supported, but you can achieve similar result if you make your central widget another QMainWindow. This has the downside that you can't move the toolbars between the two QMainWindows, unless you manage to reparent them dynamically while dragging (should be possible but I haven't tried it).

        1 Reply Last reply Reply Quote 0
        • First post
          Last post