2025-01-04 04:12:51 +00:00
|
|
|
#include "FramelessWindow.h"
|
|
|
|
|
|
|
|
|
|
#include "FrameTitleBar.h"
|
|
|
|
|
#include "FramelessDelegate.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FramelessWindow::FramelessWindow(QWidget* parent)
|
2025-06-19 14:30:05 +00:00
|
|
|
: QFrame(parent) {
|
2025-04-13 15:12:17 +00:00
|
|
|
setWindowFlags(windowFlags() | Qt::Window | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint);
|
2025-01-04 04:12:51 +00:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FramelessWindow::~FramelessWindow() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FramelessWindow::SetTitleBar(FrameTitleBar* titleBar) {
|
2025-04-13 15:12:17 +00:00
|
|
|
titleBar->SetMainWidget(this);
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
|
|
|
bool FramelessWindow::nativeEvent(const QByteArray& eventType, void* message, qintptr* result) {
|
|
|
|
|
#else
|
|
|
|
|
bool FramelessWindow::nativeEvent(const QByteArray & eventType, void* message, long* result) {
|
|
|
|
|
#endif
|
2025-04-13 15:12:17 +00:00
|
|
|
return QFrame::nativeEvent(eventType, message, result);
|
2025-01-04 04:12:51 +00:00
|
|
|
}
|