PDA

View Full Version : Same Width of Qt's Bottom Drawer and its parent QMainWindow



santosh.kumar
31st July 2014, 10:37
Hi

I am using Qt 4.6.4 on MacOSX.

QDockWidget *m_pDockWidget = new QDockWidget(this,Qt::Drawer);
MyWdgt *m_pMyWdgt = new MyWdgt(this);

m_pDockWidget->setFixedWidth(750);
m_pDockWidget->setFixedHeight(220);

m_pDockWidget->setWidget(m_pMyWdgt);
this->addDockWidget(Qt::BottomDockWidgetArea,m_pDockWidg et);

It Start showing Drawer After Bottom of QMainWindow. But Drawer's width is not same as QMainWindow's width.

I want to set Same Width as QMainWindow. But it always some width less than QMainWindow.

I have attached sample Screen. Kindly tell me the solution for this.

Thanks
Santosh

d_stranz
1st August 2014, 23:41
Maybe this has something to do with it:



m_pDockWidget->setFixedWidth(750);
m_pDockWidget->setFixedHeight(220);


As far as I can tell from your screen shot, your dock widget is not docked at the bottom of your main window. It is floating in the area below it, which means it will take whatever size you have set it to or the size of its contents if you don't set a size.