DtkDeclarative
DTK Declarative module
载入中...
搜索中...
未找到
dquickglobal_p.h
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DQUICKGLOBAL_P_H
6#define DQUICKGLOBAL_P_H
7
8#include <QtGlobal>
9
10#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
11#define ThrowError(obj, message) {\
12 auto e = qmlEngine(obj);\
13 if (e) e->throwError(message);\
14 else qCritical().noquote() << message.toLocal8Bit();\
15}
16#else
17#define ThrowError(obj, message) \
18 qCritical().noquote() << message.toLocal8Bit()
19#endif
20
21#endif // DQUICKGLOBAL_P_H