Fix build on 5.12

Q_DISABLE_COPY_MOVE: since 5.13
QLatin1String arg: since 5.14

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2020-10-20 12:38:15 +08:00
parent 17b35173ef
commit cde5ebcf8d
2 changed files with 14 additions and 0 deletions

View File

@ -41,6 +41,10 @@
#define GET_X_LPARAM(lp) ((int) (short) LOWORD(lp))
#define GET_Y_LPARAM(lp) ((int) (short) HIWORD(lp))
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
#define QLatin1String(str) QString::fromUtf8(str)
#endif
namespace {
const char useNativeTitleBar[] = "WNEF_USE_NATIVE_TITLE_BAR";

View File

@ -32,6 +32,16 @@ QT_FORWARD_DECLARE_CLASS(Widget)
}
QT_END_NAMESPACE
#if (QT_VERSION < QT_VERSION_CHECK(5, 13, 0))
#define Q_DISABLE_MOVE(Class) \
Class(Class &&) = delete; \
Class &operator=(Class &&) = delete;
#define Q_DISABLE_COPY_MOVE(Class) \
Q_DISABLE_COPY(Class) \
Q_DISABLE_MOVE(Class)
#endif
class Widget : public QWidget
{
Q_OBJECT