Relax check, allow to set Config flags after QApplication

This commit is contained in:
Sergio Martins
2019-08-01 10:05:25 +01:00
parent 06e58c2225
commit 1849010e3e
2 changed files with 9 additions and 3 deletions

View File

@@ -26,6 +26,8 @@
*/
#include "Config.h"
#include "DockRegistry_p.h"
#include <QApplication>
#include <QDebug>
#include <QOperatingSystemVersion>
@@ -70,8 +72,8 @@ Config::Flags Config::flags() const
void Config::setFlags(Flags f)
{
if (!qApp) {
qWarning() << Q_FUNC_INFO << "Only use this function before creating the QApplication";
if (!DockRegistry::self()->isEmpty()) {
qWarning() << Q_FUNC_INFO << "Only use this function at startup before creating any DockWidget or MainWindow";
return;
}