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
Forum Updated to NodeBB v4.3 + New Features

Adding central toolbar to QMainWindow with QDockWidgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
qdockwidgetqtoolbar
2 Posts 2 Posters 926 Views 1 Watching
  • 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 Offline
    J Offline
    j-b-m
    wrote on 22 May 2016, 08:39 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
    • C Offline
      C Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on 22 May 2016, 08:53 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

      1/2

      22 May 2016, 08:39

      • Login

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