How to add QDockWidget to QTabWidget



  • 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


  • Lifetime Qt Champion

    Hi,

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

    Hope it helps



  • 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



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.