2020-12-29 23:28:17 +08:00
|
|
|
#ifndef FRAMELESSWINDOW_H
|
|
|
|
#define FRAMELESSWINDOW_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QVBoxLayout;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
class FramelessWindow : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit FramelessWindow(QWidget *parent = nullptr);
|
|
|
|
|
|
|
|
void setCentralWidget(QWidget * widget);
|
|
|
|
|
2021-01-10 14:57:01 +08:00
|
|
|
protected:
|
|
|
|
bool nativeEvent(const QByteArray& eventType, void* message, long* result) override;
|
2020-12-29 23:28:17 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
QVBoxLayout * m_centralLayout = nullptr;
|
|
|
|
QWidget * m_centralWidget = nullptr; // just a pointer, doesn't take the ownership.
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FRAMELESSWINDOW_H
|