Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 492:ab3bcd06b5c2 fullscreen
Make the full-screen mode come up correctly (though not on demand!) and slot back in to the window when Esc is pressed
author | Chris Cannam |
---|---|
date | Fri, 20 Jan 2012 17:08:47 +0000 |
parents | 9137b619b652 |
children | 3a85461ab9a7 |
comparison
equal
deleted
inserted
replaced
491:9137b619b652 | 492:ab3bcd06b5c2 |
---|---|
374 } | 374 } |
375 | 375 |
376 void | 376 void |
377 MainWindow::goFullScreen() | 377 MainWindow::goFullScreen() |
378 { | 378 { |
379 m_paneStack->setParent(0); | 379 QWidget *ps = m_mainScroll->takeWidget(); |
380 m_paneStack->showFullScreen(); | 380 // m_mainScroll->setWidget(0); |
381 QApplication::processEvents(); | 381 ps->setParent(0); |
382 m_paneStack->adjustSize(); | 382 ps->showFullScreen(); |
383 // ps->showMaximized(); | |
384 //!!! we don't really want to create this every time! | |
385 QShortcut *sc = new QShortcut(QKeySequence("Esc"), ps); | |
386 connect(sc, SIGNAL(activated()), this, SLOT(endFullScreen())); | |
387 // QApplication::processEvents(); | |
388 // m_paneStack->adjustSize(); | |
389 } | |
390 | |
391 void | |
392 MainWindow::endFullScreen() | |
393 { | |
394 m_mainScroll->setWidget(m_paneStack); | |
383 } | 395 } |
384 | 396 |
385 void | 397 void |
386 MainWindow::setupFileMenu() | 398 MainWindow::setupFileMenu() |
387 { | 399 { |