Added showEvent() method to GRenderWindow to keep GMainWindow clean

This commit is contained in:
Ramuh 2015-03-22 02:54:19 +01:00
parent 512c749f79
commit 0093206dd8
3 changed files with 12 additions and 5 deletions

View File

@ -331,3 +331,11 @@ void GRenderWindow::OnClientAreaResized(unsigned width, unsigned height)
void GRenderWindow::OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) {
setMinimumSize(minimal_size.first, minimal_size.second);
}
void GRenderWindow::showEvent(QShowEvent * event) {
QWidget::showEvent(event);
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, SLOT(OnFramebufferSizeChanged()));
#endif
}

View File

@ -145,4 +145,7 @@ private:
/// Device id of keyboard for use with KeyMap
int keyboard_id;
protected:
void showEvent(QShowEvent * event) override;
};

View File

@ -159,11 +159,7 @@ GMainWindow::GMainWindow()
setWindowTitle(window_title.c_str());
show();
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
connect(render_window->windowHandle(), SIGNAL(screenChanged(QScreen*)), render_window, SLOT(OnFramebufferSizeChanged()));
#endif
QStringList args = QApplication::arguments();
if (args.length() >= 2) {
BootGame(args[1].toStdString());