Qt World Summit: Submit your Presentation

How Do I add dockwidget in stackedwidget?

  • As we know only QMainWindow supports dockwidget.

    I want to add this whole widget or window in stackedwidget. But as I am not able to .

  • Hi, friend. Are you try addWidget ?

    int QStackedWidget::addWidget(QWidget *widget)
    Appends the given widget to the QStackedWidget and returns the index position. Ownership of widget is passed on to the QStackedWidget.
    If the QStackedWidget is empty before this function is called, widget becomes the current widget.
    See also insertWidget(), removeWidget(), and setCurrentWidget().

    From the Qt Help manual.
    Also, you can show some code for here!

  • Lifetime Qt Champion


    Why do you want to put a QDockWidget in a QStackedWidget ?

    QMainWindow already handles stacking of several QDockWidgets.

Log in to reply