void MainWindow::createDockWindows()
{
OneDisplay
= new QLabel("", OneDisplaySA
);
OneDisplay->setText("xxx");
OneDisplaySA
->setBackgroundRole
( QPalette::Dark );
OneDisplaySA->setWidget( OneDisplay );
OneDisplaySA->setMinimumSize( 600, 240 );
OneDisplaySA->setMaximumSize( 1500,1000 );
OneDisplaySA->ensureWidgetVisible( OneDisplay );
dock->setWidget( OneDisplaySA );
addDockWidget(Qt::BottomDockWidgetArea, dock);
viewMenu->addAction(dock->toggleViewAction());
TwoDisplay
= new QLabel("XXX", TwoDisplaySA
);
TwoDisplaySA
->setBackgroundRole
( QPalette::Dark );
TwoDisplaySA->setWidget( TwoDisplay );
TwoDisplaySA->setMinimumSize( 300,120 );
TwoDisplaySA->setMaximumSize( 500,240 );
TwoDisplaySA->ensureWidgetVisible( TwoDisplay );
dock->setWidget( TwoDisplaySA );
addDockWidget(Qt::BottomDockWidgetArea, dock);
viewMenu->addAction(dock->toggleViewAction());
ThreeDisplay
= new QLabel("XXX", ThreeDisplaySA
);
ThreeDisplaySA
->setBackgroundRole
( QPalette::Dark );
ThreeDisplaySA->setWidget( ThreeDisplay );
ThreeDisplaySA->setMinimumSize( 120,120 );
ThreeDisplaySA->ensureWidgetVisible( ThreeDisplay );
dock->setWidget( ThreeDisplaySA );
addDockWidget(Qt::BottomDockWidgetArea, dock);
viewMenu->addAction(dock->toggleViewAction());
}
void MainWindow::createDockWindows()
{
QDockWidget *dock = new QDockWidget(tr("One"), this);
dock->setFeatures( QDockWidget::DockWidgetMovable );
OneDisplaySA = new QScrollArea( dock );
OneDisplay = new QLabel("", OneDisplaySA);
OneDisplay->setText("xxx");
OneDisplaySA->setBackgroundRole( QPalette::Dark );
OneDisplaySA->setWidget( OneDisplay );
OneDisplaySA->setMinimumSize( 600, 240 );
OneDisplaySA->setMaximumSize( 1500,1000 );
OneDisplaySA->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
OneDisplaySA->ensureWidgetVisible( OneDisplay );
dock->setWidget( OneDisplaySA );
addDockWidget(Qt::BottomDockWidgetArea, dock);
viewMenu->addAction(dock->toggleViewAction());
dock = new QDockWidget(tr("Two"), this);
TwoDisplaySA = new QScrollArea( dock );
TwoDisplay = new QLabel("XXX", TwoDisplaySA);
TwoDisplaySA->setBackgroundRole( QPalette::Dark );
TwoDisplaySA->setWidget( TwoDisplay );
TwoDisplaySA->setMinimumSize( 300,120 );
TwoDisplaySA->setMaximumSize( 500,240 );
TwoDisplaySA->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
TwoDisplaySA->ensureWidgetVisible( TwoDisplay );
dock->setWidget( TwoDisplaySA );
addDockWidget(Qt::BottomDockWidgetArea, dock);
viewMenu->addAction(dock->toggleViewAction());
dock = new QDockWidget(tr("Three"), this);
ThreeDisplaySA = new QScrollArea( dock );
ThreeDisplay = new QLabel("XXX", ThreeDisplaySA);
ThreeDisplaySA->setBackgroundRole( QPalette::Dark );
ThreeDisplaySA->setWidget( ThreeDisplay );
ThreeDisplaySA->setMinimumSize( 120,120 );
ThreeDisplaySA->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
ThreeDisplaySA->ensureWidgetVisible( ThreeDisplay );
dock->setWidget( ThreeDisplaySA );
addDockWidget(Qt::BottomDockWidgetArea, dock);
viewMenu->addAction(dock->toggleViewAction());
}
To copy to clipboard, switch view to plain text mode
Regards
Bookmarks