comparison main/main.cpp @ 625:763b1fbeb31c with-dependencies

Merge from the default branch
author Chris Cannam
date Tue, 24 Sep 2013 11:06:29 +0100
parents b8f750319cd9 c0a20cd1a9ff
children
comparison
equal deleted inserted replaced
623:d4d2f9319155 625:763b1fbeb31c
361 int height = available.height() / 2; 361 int height = available.height() / 2;
362 if (height < 450) height = (available.height() * 2) / 3; 362 if (height < 450) height = (available.height() * 2) / 3;
363 if (width > height * 2) width = height * 2; 363 if (width > height * 2) width = height * 2;
364 364
365 settings.beginGroup("MainWindow"); 365 settings.beginGroup("MainWindow");
366
366 QSize size = settings.value("size", QSize(width, height)).toSize(); 367 QSize size = settings.value("size", QSize(width, height)).toSize();
367 gui->resizeConstrained(size); 368 gui->resizeConstrained(size);
369
368 if (settings.contains("position")) { 370 if (settings.contains("position")) {
369 QRect prevrect(settings.value("position").toPoint(), size); 371 QRect prevrect(settings.value("position").toPoint(), size);
370 if (!(available & prevrect).isEmpty()) { 372 if (!(available & prevrect).isEmpty()) {
371 gui->move(prevrect.topLeft()); 373 gui->move(prevrect.topLeft());
372 } 374 }
373 } 375 }
376
377 if (settings.value("maximised", false).toBool()) {
378 gui->setWindowState(Qt::WindowMaximized);
379 }
380
374 settings.endGroup(); 381 settings.endGroup();
375 382
376 gui->show(); 383 gui->show();
377 384
378 // The MainWindow class seems to have trouble dealing with this if 385 // The MainWindow class seems to have trouble dealing with this if