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. The doc says "null central widget is not supported", but it's actually possible

The doc says "null central widget is not supported", but it's actually possible

Scheduled Pinned Locked Moved Unsolved General and Desktop
dockwidgetmainwindowdocumentationcentral widget
2 Posts 2 Posters 1.1k 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.
  • Z Offline
    Z Offline
    Zylann
    wrote on 12 Nov 2015, 13:54 last edited by Zylann 11 Dec 2015, 13:58
    #1

    Hello,

    for my project I need a docking system behaving like Unity3D: no central widget, everything is a DockWindow and can be layout freely by the user.

    I noticed this behaviour was possible by simply never setting a central widget in the MainWindow (not even a placeholder, because it would create a useless area with a sizer), and enabling nested docks.

    However, the doc says:
    "Note: Creating a main window without a central widget is not supported. You must have a central widget even if it is just a placeholder."

    I also noticed there is a takeCentralWidget() method since 5.2, that internally calls d->layout->setCentralWidget(0);, and the comments on setCentralWidget() don't mentions that the parameter should never be null.

    Is there an error in the documentation?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 12 Nov 2015, 22:47 last edited by
      #2

      Hi,

      That might be something that have changed between Qt versions. You should go to the bug report system and see if there's already something about it. If not please consider opening a bug for the documentation to be updated on that aspect.

      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

      1/2

      12 Nov 2015, 13:54

      • 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