Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1040001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:10:12+00:00 2026-05-16T15:10:12+00:00

We have a window with several components in QDockWidget s. Ideally, we’d like to

  • 0

We have a window with several components in QDockWidgets. Ideally, we’d like to have all components dockable, but there is one component that will likely always be visible. So we made that the central widget.

However, this does not allow us to create a tabbed stack of dockable widgets (as you can create by e.g. calling tabifyDockWidget) containing this central widget. So, we tried to create a UI without a central widget, but with several QDockWidgets.

I cannot find any indication in the manual of QDockWidget or QMainWindow that this is a situation that isn’t allowed. We create as much as possible in Qt Designer, and it seems to require that you have a central widget – as it shows by crashing after manually editing the XML.

The question is: is it legal to have a QMainWindow with only QDockWidgets and no central widget? Is Qt Designer just crashing because of a bug, or is it telling me that this is a bad idea and I need to stop doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:10:12+00:00Added an answer on May 16, 2026 at 3:10 pm

    Qt’s documentation says that:

    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.

    So you can just hide the empty central widget:

    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent), ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        ui->centralWidget->hide();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Window where I have put a Frame. I would like to
I have a Window with my user control and I would like to make
I have several .NET Windows Forms applications that I'm preparing to convert into a
I am currently using Windows Server 2008 Standard and have several Hyper V machines.
I have a small application to convert several file formats, with a main windows
I have a window that is set with NSBorderlessWindowMask, and also kCGDesktopWindowLevel. When a
I have a window (derived from JFrame) and I want to disable the close
I have a window with 2 column grid. Left column contains a browser control
I have a window in WPF which shows some media contents. This content contains
More particularly - I have a window handle of another running application. This application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.