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. Adding central toolbar to QMainWindow with QDockWidgets

Adding central toolbar to QMainWindow with QDockWidgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
qdockwidgetqtoolbar
2 Posts 2 Posters 896 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.
  • j-b-mJ Offline
    j-b-mJ Offline
    j-b-m
    wrote on last edited by
    #1

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

      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
      0

      • Login

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