Qt: CustomizeWindowHint should be set for no-close-button

This commit is contained in:
Stenzek 2024-12-01 14:27:19 +10:00
parent 42c5f9169f
commit 9c2244f40e
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View File

@ -111,6 +111,7 @@ void LogWindow::createUi()
QIcon icon; QIcon icon;
icon.addFile(QString::fromUtf8(":/icons/duck.png"), QSize(), QIcon::Normal, QIcon::Off); icon.addFile(QString::fromUtf8(":/icons/duck.png"), QSize(), QIcon::Normal, QIcon::Off);
setWindowIcon(icon); setWindowIcon(icon);
setWindowFlag(Qt::CustomizeWindowHint, true);
setWindowFlag(Qt::WindowCloseButtonHint, false); setWindowFlag(Qt::WindowCloseButtonHint, false);
updateWindowTitle(); updateWindowTitle();

View File

@ -19,6 +19,7 @@ QtModalProgressCallback::QtModalProgressCallback(QWidget* parent_widget, float s
m_dialog.setModal(parent_widget != nullptr); m_dialog.setModal(parent_widget != nullptr);
m_dialog.setAutoClose(false); m_dialog.setAutoClose(false);
m_dialog.setAutoReset(false); m_dialog.setAutoReset(false);
m_dialog.setWindowFlag(Qt::CustomizeWindowHint, true);
m_dialog.setWindowFlag(Qt::WindowCloseButtonHint, false); m_dialog.setWindowFlag(Qt::WindowCloseButtonHint, false);
connect(&m_dialog, &QProgressDialog::canceled, this, &QtModalProgressCallback::dialogCancelled); connect(&m_dialog, &QProgressDialog::canceled, this, &QtModalProgressCallback::dialogCancelled);
checkForDelayedShow(); checkForDelayedShow();