From b89c2b76d33d6b53ab27ffd9a6caea0958556c85 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Wed, 6 Feb 2019 13:28:15 -0800 Subject: [PATCH] UI: Add function to get main window more easily Adds OBSBasic::Get() to just quickly return the main window. --- UI/window-basic-main.cpp | 5 +++++ UI/window-basic-main.hpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index af6c8984e..056c76bfe 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -6857,3 +6857,8 @@ void OBSBasic::ResizeOutputSizeOfSource() ResetVideo(); on_actionFitToScreen_triggered(); } + +OBSBasic *OBSBasic::Get() +{ + return reinterpret_cast(App()->GetMainWindow()); +} diff --git a/UI/window-basic-main.hpp b/UI/window-basic-main.hpp index 7ae382b19..3b0f3d01e 100644 --- a/UI/window-basic-main.hpp +++ b/UI/window-basic-main.hpp @@ -617,6 +617,8 @@ public: void CreatePropertiesWindow(obs_source_t *source); void CreateFiltersWindow(obs_source_t *source); + static OBSBasic *Get(); + protected: virtual void closeEvent(QCloseEvent *event) override; virtual void changeEvent(QEvent *event) override;