QtCanpool 3.3.0
载入中...
搜索中...
未找到
framelesshelper.h
浏览该文件的文档.
1
5#pragma once
6
7#include <QObject>
8#include <QAbstractNativeEventFilter>
9
10#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
11#define QTRESULT qintptr
12#else
13#define QTRESULT long
14#endif // QTRESULT
15
16class QWidget;
17class FramelessHelperPrivate;
18
19class FramelessHelper : public QObject, public QAbstractNativeEventFilter
20{
21 Q_OBJECT
22public:
23 explicit FramelessHelper(QObject *parent);
25
26 void addWidget(QWidget *w);
27 void removeWidget(QWidget *w);
28
29 bool widgetResizable() const;
30 void setWidgetResizable(bool resizable);
31
32 bool widgetMovable() const;
33 void setWidgetMovable(bool movable);
34
35 int titleHeight() const;
36 void setTitleHeight(int height);
37
38 int borderWidth() const;
39 void setBorderWidth(int width);
40
41 void addCaptionClassName(const QString &name);
42
43Q_SIGNALS:
44 void windowIconChanged(const QIcon &icon);
45 void windowTitleChanged(const QString &title);
46 void windowStateChanged(Qt::WindowStates state);
47protected:
48 virtual bool eventFilter(QObject *object, QEvent *event);
49 virtual bool nativeEventFilter(const QByteArray &eventType, void *message, QTRESULT *result);
50private:
51 FramelessHelperPrivate *d;
52};
void removeWidget(QWidget *w)
int titleHeight() const
void windowTitleChanged(const QString &title)
void setWidgetResizable(bool resizable)
void windowStateChanged(Qt::WindowStates state)
bool widgetMovable() const
void addCaptionClassName(const QString &name)
bool widgetResizable() const
void setWidgetMovable(bool movable)
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result)
void addWidget(QWidget *w)
virtual bool eventFilter(QObject *object, QEvent *event)
int borderWidth() const
void setTitleHeight(int height)
void windowIconChanged(const QIcon &icon)
void setBorderWidth(int width)
#define QTRESULT
Copyleft (C) 2023-2024 maminjie canpool@163.com SPDX-License-Identifier: MIT
const char * name
Definition qxtheme.cpp:25