Qt: Force redraw when window gets focus

This commit is contained in:
Jeffrey Pfau 2015-08-04 19:59:59 -07:00
parent 071fe7ff2d
commit d4721cb30d
2 changed files with 5 additions and 0 deletions

View File

@ -441,6 +441,10 @@ void Window::closeEvent(QCloseEvent* event) {
QMainWindow::closeEvent(event); QMainWindow::closeEvent(event);
} }
void Window::focusInEvent(QFocusEvent*) {
m_display->forceDraw();
}
void Window::focusOutEvent(QFocusEvent*) { void Window::focusOutEvent(QFocusEvent*) {
m_controller->setTurbo(false, false); m_controller->setTurbo(false, false);
m_controller->stopRewinding(); m_controller->stopRewinding();

View File

@ -105,6 +105,7 @@ protected:
virtual void keyReleaseEvent(QKeyEvent* event) override; virtual void keyReleaseEvent(QKeyEvent* event) override;
virtual void resizeEvent(QResizeEvent*) override; virtual void resizeEvent(QResizeEvent*) override;
virtual void closeEvent(QCloseEvent*) override; virtual void closeEvent(QCloseEvent*) override;
virtual void focusInEvent(QFocusEvent*) override;
virtual void focusOutEvent(QFocusEvent*) override; virtual void focusOutEvent(QFocusEvent*) override;
virtual void dragEnterEvent(QDragEnterEvent*) override; virtual void dragEnterEvent(QDragEnterEvent*) override;
virtual void dropEvent(QDropEvent*) override; virtual void dropEvent(QDropEvent*) override;