本文整理汇总了C++中QDockWidget::adjustSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QDockWidget::adjustSize方法的具体用法?C++ QDockWidget::adjustSize怎么用?C++ QDockWidget::adjustSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDockWidget
的用法示例。
在下文中一共展示了QDockWidget::adjustSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMainWindow
Window::Window () : QMainWindow (NULL) {
try {
viewer = new GLViewer;
} catch (GLViewer::Exception e) {
cerr << e.getMessage () << endl;
exit (1);
}
setCentralWidget (viewer);
#if DEBUG
cout << "/ ! \\ Building in Debug mode. Performance will be impacted" << endl;
#else
viewer->setBaseSize(500, 500);
#endif
initControlWidget ();
QDockWidget * controlDockWidget = new QDockWidget (this);
controlDockWidget->setWidget (controlWidget);
controlDockWidget->adjustSize ();
addDockWidget (Qt::RightDockWidgetArea, controlDockWidget);
controlDockWidget->setFloating(true);
controlDockWidget->setFeatures (QDockWidget::AllDockWidgetFeatures);
controlDockWidget->adjustSize();
controlDockWidget->move(0, 0);
QDockWidget * focalDockWidget = new QDockWidget (this);
focalDockWidget->setWidget(focalWidget);
focalDockWidget->adjustSize ();
addDockWidget (Qt::LeftDockWidgetArea, focalDockWidget);
focalDockWidget->setFloating(true);
focalDockWidget->setFeatures (QDockWidget::AllDockWidgetFeatures);
focalDockWidget->adjustSize();
focalDockWidget->move(200, 0);
QDockWidget* rayTracerDockWidget = new QDockWidget(this);
rayTracerDockWidget->setWidget(rayTracerWidget);
rayTracerDockWidget->adjustSize ();
addDockWidget (Qt::TopDockWidgetArea, rayTracerDockWidget);
rayTracerDockWidget->setFloating(true);
rayTracerDockWidget->setFeatures (QDockWidget::AllDockWidgetFeatures);
rayTracerDockWidget->adjustSize();
// Move widgets around the raytracer
QDesktopWidget desktop;
QRect mainScreenSize = desktop.availableGeometry(desktop.primaryScreen());
controlDockWidget->move(mainScreenSize.width() - 200, 0);
rayTracerDockWidget->move(0, 0);
focalDockWidget->move(0, mainScreenSize.height() - focalDockWidget->height());
statusBar()->showMessage("");
}
示例2: QMainWindow
Window::Window () : QMainWindow (NULL) {
try {
viewer = new GLViewer;
} catch (GLViewer::Exception e) {
cerr << e.getMessage () << endl;
exit (1);
}
setCentralWidget (viewer);
QDockWidget * controlDockWidget = new QDockWidget (this);
initControlWidget ();
controlDockWidget->setWidget (controlWidget);
controlDockWidget->adjustSize ();
addDockWidget (Qt::RightDockWidgetArea, controlDockWidget);
controlDockWidget->setFeatures (QDockWidget::AllDockWidgetFeatures);
statusBar()->showMessage("");
}