MCPcopy Create free account
hub / github.com/baldurk/renderdoc / LoadLayout

Method LoadLayout

qrenderdoc/Windows/MainWindow.cpp:3250–3284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3248}
3249
3250bool MainWindow::LoadLayout(int layout)
3251{
3252 qInfo() << "LoadLayout " << layout;
3253 QString path = GetLayoutPath(layout);
3254
3255 QFile f(path);
3256 if(f.open(QIODevice::ReadOnly | QIODevice::Text))
3257 {
3258 QVariantMap state;
3259
3260 bool success = LoadFromJSON(state, f, JSON_ID, JSON_VER);
3261
3262 if(!success)
3263 return false;
3264
3265 if(restoreState(state))
3266 {
3267 // Close any windows which have now become orphaned
3268 foreach(QWidget *toolWindow, ui->toolWindowManager->toolWindows())
3269 {
3270 if(ui->toolWindowManager->areaOf(toolWindow) == NULL)
3271 {
3272 qInfo() << "Manually closing orphaned window " << toolWindow->objectName();
3273 ui->toolWindowManager->forceCloseToolWindow(toolWindow);
3274 }
3275 }
3276 return true;
3277 }
3278 return false;
3279 }
3280
3281 qInfo() << "Couldn't load layout from " << path << " " << f.errorString();
3282
3283 return false;
3284}
3285
3286void MainWindow::showLaunchError(ResultDetails result)
3287{

Callers

nothing calls this directly

Calls 7

LoadFromJSONFunction · 0.85
toolWindowsMethod · 0.80
areaOfMethod · 0.80
forceCloseToolWindowMethod · 0.80
errorStringMethod · 0.80
foreachFunction · 0.50
openMethod · 0.45

Tested by

no test coverage detected