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

  • SEARCH
  • Home
  • 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 an editing window with several fields, all bound to the 'content' controller
I have a window that contains several rather complex views. Right now, I'm using
I have several windows machines identified by ip address. I would like to write
I have several child windows, all with the same parent. I want to cascade/tile
I have a WPF application with several windows. I would like to define GLOBAL
I have a cell editor that is composed of several components on a JPanel.
I have several custom components in my uses list of a unit. For some
I know there are several threads on this already, but I've hit a brick
I have an SVN repository containing several components: LibraryA LibraryB - depends on LibraryA
I have an InstallScript installer that utilizes dynamic file links for several components. These

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.