UI: Use QDialog for all dialogs

While QWidgets can be opened as dialogs, they don't contain certain
functions/defaults that are expected in a dialog.
master
Matt Gajownik 2022-08-30 18:29:05 +10:00
parent 9a5e094cb3
commit 9613fe7d47
4 changed files with 11 additions and 7 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>OBSExtraBrowsers</class> <class>OBSExtraBrowsers</class>
<widget class="QWidget" name="OBSExtraBrowsers"> <widget class="QDialog" name="OBSExtraBrowsers">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>ScriptsTool</class> <class>ScriptsTool</class>
<widget class="QWidget" name="ScriptsTool"> <widget class="QDialog" name="ScriptsTool">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View File

@ -85,7 +85,7 @@ static OBSPlainTextEdit *scriptLogWidget = nullptr;
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
ScriptLogWindow::ScriptLogWindow() : QWidget(nullptr) ScriptLogWindow::ScriptLogWindow() : QDialog(nullptr)
{ {
OBSPlainTextEdit *edit = new OBSPlainTextEdit(); OBSPlainTextEdit *edit = new OBSPlainTextEdit();
edit->setReadOnly(true); edit->setReadOnly(true);
@ -109,6 +109,8 @@ ScriptLogWindow::ScriptLogWindow() : QWidget(nullptr)
setLayout(layout); setLayout(layout);
scriptLogWidget = edit; scriptLogWidget = edit;
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
resize(600, 400); resize(600, 400);
config_t *global_config = obs_frontend_get_global_config(); config_t *global_config = obs_frontend_get_global_config();
@ -179,8 +181,10 @@ void ScriptLogWindow::Clear()
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
ScriptsTool::ScriptsTool() : QWidget(nullptr), ui(new Ui_ScriptsTool) ScriptsTool::ScriptsTool() : QDialog(nullptr), ui(new Ui_ScriptsTool)
{ {
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
ui->setupUi(this); ui->setupUi(this);
RefreshLists(); RefreshLists();

View File

@ -1,12 +1,12 @@
#pragma once #pragma once
#include <QWidget> #include <QDialog>
#include <QString> #include <QString>
#include <memory> #include <memory>
class Ui_ScriptsTool; class Ui_ScriptsTool;
class ScriptLogWindow : public QWidget { class ScriptLogWindow : public QDialog {
Q_OBJECT Q_OBJECT
QString lines; QString lines;
@ -25,7 +25,7 @@ public slots:
void ScrollChanged(int val); void ScrollChanged(int val);
}; };
class ScriptsTool : public QWidget { class ScriptsTool : public QDialog {
Q_OBJECT Q_OBJECT
std::unique_ptr<Ui_ScriptsTool> ui; std::unique_ptr<Ui_ScriptsTool> ui;