Fixed bug with Insight QApplication object being created too soon, which in turn caused issues with signal capturing.

Also ensured that we only initialise the Insight object when the user has enabled Insight in their config.
This commit is contained in:
Nav
2021-08-11 00:07:12 +01:00
parent bf7233e01b
commit 7a6dcdcbfd
4 changed files with 31 additions and 9 deletions

View File

@@ -52,7 +52,22 @@ namespace Bloom
void startup();
public:
explicit Insight(EventManager& eventManager): eventManager(eventManager) {};
/**
* Insight constructor.
*
* Note: We use the comma operator in the application() initializer to set the Qt::AA_ShareOpenGLContexts
* attribute, as this is required by Qt before creating a QCoreApplication instance.
*
* @param eventManager
*/
explicit Insight(EventManager& eventManager):
eventManager(eventManager),
application(
(
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true),
QApplication(this->qtApplicationArgc, this->qtApplicationArgv.data())
)
) {};
void setApplicationConfig(const ApplicationConfig& applicationConfig) {
this->applicationConfig = applicationConfig;