CommonHostInterface: Add a method to get top-level window handle

This commit is contained in:
Connor McLaughlin
2020-12-29 16:29:14 +10:00
parent a894b295b6
commit a3e4c61a0b
7 changed files with 35 additions and 9 deletions

View File

@ -47,6 +47,20 @@ MainWindow::MainWindow(QtHostInterface* host_interface)
{
m_host_interface->setMainWindow(this);
// force creation of native window
winId();
}
MainWindow::~MainWindow()
{
Assert(!m_display_widget);
m_host_interface->setMainWindow(nullptr);
Assert(!m_debugger_window);
}
void MainWindow::initializeAndShow()
{
m_ui.setupUi(this);
setupAdditionalUi();
connectSignals();
@ -56,14 +70,8 @@ MainWindow::MainWindow(QtHostInterface* host_interface)
restoreStateFromConfig();
switchToGameListView();
}
MainWindow::~MainWindow()
{
Assert(!m_display_widget);
m_host_interface->setMainWindow(nullptr);
Assert(!m_debugger_window);
show();
}
void MainWindow::reportError(const QString& message)