Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2020-08-13 16:29:12 +08:00
parent 9d06d67c9d
commit c9e38491ae
2 changed files with 11 additions and 18 deletions

View File

@ -24,20 +24,22 @@
#include "framelessquickhelper.h"
#ifdef Q_OS_WINDOWS
#include "winnativeeventfilter.h"
#endif
#include <QQuickWindow>
#include <QScreen>
#ifdef Q_OS_WINDOWS
namespace {
const int m_defaultBorderWidth = 8, m_defaultBorderHeight = 8, m_defaultTitleBarHeight = 30;
}
#include "winnativeeventfilter.h"
#else
#include "framelesshelper.h"
#endif
namespace {
#ifdef Q_OS_WINDOWS
const int m_defaultBorderWidth = 8, m_defaultBorderHeight = 8, m_defaultTitleBarHeight = 30;
#else
FramelessHelper m_framelessHelper;
#endif
}
FramelessQuickHelper::FramelessQuickHelper(QQuickItem *parent) : QQuickItem(parent) {}
int FramelessQuickHelper::borderWidth() const

View File

@ -32,10 +32,6 @@
#define Q_OS_WINDOWS
#endif
#ifndef Q_OS_WINDOWS
#include "framelesshelper.h"
#endif
#if (QT_VERSION < QT_VERSION_CHECK(5, 13, 0))
#define Q_DISABLE_MOVE(Class) \
Class(Class &&) = delete; \
@ -119,9 +115,4 @@ Q_SIGNALS:
void minimumSizeChanged(const QSize &);
void maximumSizeChanged(const QSize &);
void titleBarEnabledChanged(bool);
private:
#ifndef Q_OS_WINDOWS
FramelessHelper m_framelessHelper;
#endif
};