Qt-interest Archive, March 2007
tabifyDockWidget
Message 1 in thread
Hi.
If you build this code you can see: if you click button, which signal
connected to the createDocks slot, then dockwidgets are shown
incorrectly (one of docks appears on top left corner of main window).
But if you call this slot directly, for example from MainWindow
constructor, docks are shown correctly. Bug? Or something wrong in code?
(WinXP Pro SP2 Qt 4.2.2)
MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
QPushButton *btn = new QPushButton("Create docks", this);
setCentralWidget(btn);
connect(btn, SIGNAL(clicked()), this, SLOT(createDocks()));
// createDocks();
}
void MainWindow::createDocks() {
QDockWidget *dw1 = new QDockWidget("1", this);
QDockWidget *dw2 = new QDockWidget("2", this);
addDockWidget(Qt::RightDockWidgetArea, dw1);
addDockWidget(Qt::RightDockWidgetArea, dw2);
this->tabifyDockWidget(dw1, dw2);
}
Thanks in advance.
Anton I Alferov.
--
[ signature omitted ]