UI: Call setWindowFlags before setupUi
For some reason this has a noticeable performance improvement, presumably because Qt is notifying all the child widgets?
This commit is contained in:
parent
eba6810423
commit
5cfc16e9f9
@ -11,10 +11,10 @@ using namespace json11;
|
|||||||
|
|
||||||
OBSAbout::OBSAbout(QWidget *parent) : QDialog(parent), ui(new Ui::OBSAbout)
|
OBSAbout::OBSAbout(QWidget *parent) : QDialog(parent), ui(new Ui::OBSAbout)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
|
||||||
|
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
QString bitness;
|
QString bitness;
|
||||||
QString ver;
|
QString ver;
|
||||||
|
|
||||||
|
@ -54,6 +54,8 @@ OBSBasicFilters::OBSBasicFilters(QWidget *parent, OBSSource source_)
|
|||||||
{
|
{
|
||||||
main = reinterpret_cast<OBSBasic *>(parent);
|
main = reinterpret_cast<OBSBasic *>(parent);
|
||||||
|
|
||||||
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
UpdateFilters();
|
UpdateFilters();
|
||||||
|
|
||||||
@ -64,7 +66,6 @@ OBSBasicFilters::OBSBasicFilters(QWidget *parent, OBSSource source_)
|
|||||||
|
|
||||||
const char *name = obs_source_get_name(source);
|
const char *name = obs_source_get_name(source);
|
||||||
setWindowTitle(QTStr("Basic.Filters.Title").arg(QT_UTF8(name)));
|
setWindowTitle(QTStr("Basic.Filters.Title").arg(QT_UTF8(name)));
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
|
||||||
|
|
||||||
#ifndef QT_NO_SHORTCUT
|
#ifndef QT_NO_SHORTCUT
|
||||||
ui->actionRemoveFilter->setShortcut(
|
ui->actionRemoveFilter->setShortcut(
|
||||||
|
@ -44,6 +44,10 @@ OBSBasicInteraction::OBSBasicInteraction(QWidget *parent, OBSSource source_)
|
|||||||
int cy = (int)config_get_int(App()->GlobalConfig(), "InteractionWindow",
|
int cy = (int)config_get_int(App()->GlobalConfig(), "InteractionWindow",
|
||||||
"cy");
|
"cy");
|
||||||
|
|
||||||
|
Qt::WindowFlags flags = windowFlags();
|
||||||
|
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;
|
||||||
|
setWindowFlags(flags & (~helpFlag));
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->preview->setMouseTracking(true);
|
ui->preview->setMouseTracking(true);
|
||||||
@ -59,10 +63,6 @@ OBSBasicInteraction::OBSBasicInteraction(QWidget *parent, OBSSource source_)
|
|||||||
const char *name = obs_source_get_name(source);
|
const char *name = obs_source_get_name(source);
|
||||||
setWindowTitle(QTStr("Basic.InteractionWindow").arg(QT_UTF8(name)));
|
setWindowTitle(QTStr("Basic.InteractionWindow").arg(QT_UTF8(name)));
|
||||||
|
|
||||||
Qt::WindowFlags flags = windowFlags();
|
|
||||||
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;
|
|
||||||
setWindowFlags(flags & (~helpFlag));
|
|
||||||
|
|
||||||
auto addDrawCallback = [this]() {
|
auto addDrawCallback = [this]() {
|
||||||
obs_display_add_draw_callback(ui->preview->GetDisplay(),
|
obs_display_add_draw_callback(ui->preview->GetDisplay(),
|
||||||
OBSBasicInteraction::DrawPreview,
|
OBSBasicInteraction::DrawPreview,
|
||||||
|
@ -318,10 +318,10 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
|||||||
|
|
||||||
EnableThreadedMessageBoxes(true);
|
EnableThreadedMessageBoxes(true);
|
||||||
|
|
||||||
ui->setupUi(this);
|
|
||||||
|
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
main->EnableOutputs(false);
|
main->EnableOutputs(false);
|
||||||
|
|
||||||
PopulateAACBitrates({ui->simpleOutputABitrate, ui->advOutTrack1Bitrate,
|
PopulateAACBitrates({ui->simpleOutputABitrate, ui->advOutTrack1Bitrate,
|
||||||
|
@ -42,10 +42,10 @@ void OBSBasicTransform::HookWidget(QWidget *widget, const char *signal,
|
|||||||
OBSBasicTransform::OBSBasicTransform(OBSBasic *parent)
|
OBSBasicTransform::OBSBasicTransform(OBSBasic *parent)
|
||||||
: QDialog(parent), ui(new Ui::OBSBasicTransform), main(parent)
|
: QDialog(parent), ui(new Ui::OBSBasicTransform), main(parent)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
|
||||||
|
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
HookWidget(ui->positionX, DSCROLL_CHANGED, SLOT(OnControlChanged()));
|
HookWidget(ui->positionX, DSCROLL_CHANGED, SLOT(OnControlChanged()));
|
||||||
HookWidget(ui->positionY, DSCROLL_CHANGED, SLOT(OnControlChanged()));
|
HookWidget(ui->positionY, DSCROLL_CHANGED, SLOT(OnControlChanged()));
|
||||||
HookWidget(ui->rotation, DSCROLL_CHANGED, SLOT(OnControlChanged()));
|
HookWidget(ui->rotation, DSCROLL_CHANGED, SLOT(OnControlChanged()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user