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 to add QDockWidget to QTabWidget
Forum Updated to NodeBB v4.3 + New Features

How to add QDockWidget to QTabWidget

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 4.8k Views 1 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.
  • K Offline
    K Offline
    karim24
    wrote on last edited by
    #1

    hi,how to add QDockWidget to QTabWidget and make it moveable and dockable in the QTabWidget
    here is what i tried

    @QDockWidget * dockWidget1=new QDockWidget ;
    dockWidget1->setFeatures(QDockWidget::AllDockWidgetFeatures);
    ui->tabWidget->insertTab(0,dockWidget1,"newtab");@

    but it just gets stuck in one palce and doesn't want to move
    and is it even possible to do what i 'm willing to do

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

      Hi,

      QDockWidget is designed to be used with a QMainWindow. With it, you'll be able to "tabify" your dock widgets.

      Hope it helps

      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
      • K Offline
        K Offline
        karim24
        wrote on last edited by
        #3

        hi thanks, i know that i can tabify the dockwidgets
        but what i wanted to do seems impossible
        i digged the internet and found nothing

        1 Reply Last reply
        0
        • T Offline
          T Offline
          thEClaw
          wrote on last edited by
          #4

          Well, what is it you want to do?

          Using a QMainWindow as the QTabWidgets widget might be an idea, it enables you to use QDockWidgets on every tab of the tabwidget. But since you never stated what you're trying to achieve, this might not help you at all. (I hope it does, though. ;) )

          Or, you just don't use a QTabWidget at all and go for the dockwidgets feature to form tabs of their own. If neither of these two possibilities are of any help, you need to give us more information.

          1 Reply Last reply
          0

          • Login

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