Re: setLayout to QDockWidget
You cannot install a layout on QDockWidget. You must install the layout on another widget and call QDockWidget::setWidget().
Re: setLayout to QDockWidget
Hi jpn,
i created another widget and setlayout to that widget, using the dockwidget object i set widget.
but still it not visible.
here my code:
Code:
newWidget.setLayout(mainLayout);
dwidget->setWidget(&newWidget);
dwidget->show();
addDockWidget(Qt::RightDockWidgetArea, dwidget);
Regards,
hemraj
Re: setLayout to QDockWidget
If you create the widget on the stack, it will go out of scope according to normal C++ rules.
PS. Please start using code-tags. I already sent you instructions. Thank you.
Re: setLayout to QDockWidget
and you will get nothing :)
try this
Code:
newWidget->setLayout(mainLayout);
dwidget->setWidget(newWidget);
dwidget->show();
addDockWidget(Qt::RightDockWidgetArea, dwidget);