28 lines
644 B
C
28 lines
644 B
C
|
#pragma once
|
||
|
#include <QObject>
|
||
|
#include <QWidget>
|
||
|
#include "webqt_global.h"
|
||
|
#include "json.hpp"
|
||
|
using json = nlohmann::json;
|
||
|
|
||
|
|
||
|
class WEBQT_EXPORT QFramelessHelper : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
explicit QFramelessHelper(QWidget* w, QWidget* titleBar, bool border = true, QObject* parent = nullptr);
|
||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
|
||
|
bool nativeEvent(const QByteArray& eventType, void* message, qintptr* result);
|
||
|
#else
|
||
|
bool nativeEvent(const QByteArray& eventType, void* message, long* result);
|
||
|
#endif
|
||
|
signals:
|
||
|
bool checkTitleBar(QPoint pos);
|
||
|
private slots:
|
||
|
void screenChanged(QScreen* screen);
|
||
|
private:
|
||
|
QWidget* _w;
|
||
|
};
|
||
|
|