本文整理汇总了C++中QMdiSubWindow::restoreGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ QMdiSubWindow::restoreGeometry方法的具体用法?C++ QMdiSubWindow::restoreGeometry怎么用?C++ QMdiSubWindow::restoreGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMdiSubWindow
的用法示例。
在下文中一共展示了QMdiSubWindow::restoreGeometry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readSettings
void MainWindow::readSettings()
{
QSettings settings("NUbots", "NUView");
qDebug() <<"Start Reading Settings";
// Restore the main window.
settings.beginGroup("mainWindow");
restoreGeometry(settings.value("geometry").toByteArray()); // Set previous position/size
restoreState(settings.value("state").toByteArray()); // restore the other main widgets layout.
// openFile(settings.value("logFile").toString());
settings.endGroup();
int numWindows = settings.beginReadArray("midWindows"); // Get midi windows settings
for (int i = 0; i < numWindows; ++i) {
settings.setArrayIndex(i); // set to element
QString windowType = settings.value("type").toString(); // Get the window type
if(windowType == "unknown")
{
continue;
}
else if(windowType == "GLDisplay")
{
QMdiSubWindow* tempGl = createGLDisplay();
tempGl->restoreGeometry(settings.value("geometry").toByteArray());
GLDisplay *GLDisp = qobject_cast<GLDisplay *>(tempGl->widget());
GLDisp->restoreState(settings.value("state").toByteArray());
}
else if(windowType == "locWmGlDisplay")
{
QMdiSubWindow* tempLocwm = createLocWmGlDisplay();
tempLocwm->restoreGeometry(settings.value("geometry").toByteArray());
locWmGlDisplay *lwmDisp = qobject_cast<locWmGlDisplay *>(tempLocwm->widget());
lwmDisp->restoreState(settings.value("state").toByteArray());
}
else if(windowType == "LUTGlDisplay")
{
QMdiSubWindow* tempLUTDisp = createLUTGlDisplay();
tempLUTDisp->restoreGeometry(settings.value("geometry").toByteArray());
LUTGlDisplay *lwmDisp = qobject_cast<LUTGlDisplay *>(tempLUTDisp->widget());
lwmDisp->restoreState(settings.value("state").toByteArray());
}
}
}