diff --git a/src/kernel/dplatformhandle.cpp b/src/kernel/dplatformhandle.cpp index f3e5c92..110a989 100644 --- a/src/kernel/dplatformhandle.cpp +++ b/src/kernel/dplatformhandle.cpp @@ -588,9 +588,10 @@ static void initWindowRadius(QWindow *window) return; auto theme = DGuiApplicationHelper::instance()->systemTheme(); - int radius = theme->windowRadius(18); //###(zccrs): 暂时在此处给窗口默认设置为18px的圆角 - - setWindowProperty(window, _windowRadius, radius); + if (theme->isValid()) { + int radius = theme->windowRadius(18); //###(zccrs): 暂时在此处给窗口默认设置为18px的圆角 + setWindowProperty(window, _windowRadius, radius); + } // Qt::UniqueConnection will report a warning // to `unique connections require a pointer to member function of a QObject subclass`. const char *uniqueueConnectionFlag("_d_uniqueueConnectionFlag"); @@ -604,9 +605,9 @@ static void initWindowRadius(QWindow *window) } } -class Q_DECL_HIDDEN CreatorWindowEventFile : public QObject { +class Q_DECL_HIDDEN WindowCreateEventFilter : public QObject { public: - CreatorWindowEventFile(QObject *par= nullptr): QObject(par){} + WindowCreateEventFilter(QObject *par= nullptr) : QObject(par){} public: bool eventFilter(QObject *watched, QEvent *event) override { @@ -657,7 +658,7 @@ bool DPlatformHandle::setEnabledNoTitlebarForWindow(QWindow *window, bool enable if (window->handle()) { initWindowRadius(window); } else { - window->installEventFilter(new CreatorWindowEventFile(window)); + window->installEventFilter(new WindowCreateEventFilter(window)); } }