PDA

View Full Version : how to make the QDockWidget float



fly542
28th July 2011, 10:00
please help me!
I want to make the QDockWidget object to float all the time , but when i use the property Qt::NoDockWidgetArea in the QMainWindow::addDockWidget() the object can also be docked at the four place ,how to forbid it to dock at anywhere?

code like this:

m_dock = new QDockWidget(tr("test"), this);
m_dock->setFloating(true);
QWdiget*dlg = new QWdiget;
m_dock->setWidget(dlg);
this->addDockWidget(Qt::LeftDockWidgetArea, m_dock);

FelixB
28th July 2011, 10:21
Why do you need a QDockWidget when you don't want it to be docked? Use a QDialog instead :)