PDA

View Full Version : Dock Widgets Example Question



webphone
1st June 2011, 16:12
I read http://doc.qt.nokia.com/latest/mainwindows-dockwidgets.html and would like to create an UI exactly like it.

Except:
1. centralWidget “Letter” put on right hand side, 2 DockWidgets “Customers” and “Paragraphs” put on left hand side.
2. There is a bottom DockWidget.

However, the following code put “Customers” on left hand side, “Letter” on the central, “Paragraphs” on the right hand side.

How should I change the code to fix the layout problem?



QFrame *frame = new QFrame( this );
QLayout *layout = new QVBoxLayout( frame );
frame->setLayout( layout );
layout->addWidget( &m_Main );
setCentralWidget( frame );

m_A = new A( this );
addDockWidget( Qt::LeftDockWidgetArea, m_A );

m_B = new B( this );
addDockWidget( Qt::LeftDockWidgetArea, m_B );

m_C = new C( this );
addDockWidget( Qt::BottomDockWidgetArea, m_C );

Santosh Reddy
1st June 2011, 22:56
Coud you post a screen shot of how you want, what u are getting.

ChrisW67
2nd June 2011, 02:32
Check the allowed dock areas for each widget.