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. How Do I add dockwidget in stackedwidget?
Forum Updated to NodeBB v4.3 + New Features

How Do I add dockwidget in stackedwidget?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 931 Views 2 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.
  • mit_cruzeM Offline
    mit_cruzeM Offline
    mit_cruze
    wrote on last edited by
    #1

    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 .

    1 Reply Last reply
    0
    • joeQJ Offline
      joeQJ Offline
      joeQ
      wrote on last edited by
      #2

      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!

      Just do it!

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

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

        QMainWindow already handles stacking of several QDockWidgets.

        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
        2

        • Login

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