DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dclipeffectwidget.h
1// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DCLIPEFFECTWIDGET_H
6#define DCLIPEFFECTWIDGET_H
7
8#include <dtkwidget_global.h>
9#include <DObject>
10
11#include <QWidget>
12#include <QPainterPath>
13
14DWIDGET_BEGIN_NAMESPACE
15
16class DClipEffectWidgetPrivate;
17class DClipEffectWidget : public QWidget, public DTK_CORE_NAMESPACE::DObject
18{
19 Q_OBJECT
20
21 Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged)
22 Q_PROPERTY(QPainterPath clipPath READ clipPath WRITE setClipPath NOTIFY clipPathChanged)
23
24public:
25 explicit DClipEffectWidget(QWidget *parent);
26
27 QMargins margins() const;
28 QPainterPath clipPath() const;
29
30public Q_SLOTS:
31 void setMargins(QMargins margins);
32 void setClipPath(const QPainterPath &path);
33
34Q_SIGNALS:
35 void marginsChanged(QMargins margins);
36 void clipPathChanged(QPainterPath clipPath);
37
38protected:
39 bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
40 void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
41 void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
42 void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
43 void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE;
44
45private:
46 using QWidget::move;
47 using QWidget::resize;
48 using QWidget::setGeometry;
49
50 D_DECLARE_PRIVATE(DClipEffectWidget)
51};
52
53DWIDGET_END_NAMESPACE
54
55#endif // DCLIPEFFECTWIDGET_H
用于裁剪窗口的绘制内容.
Definition dclipeffectwidget.h:18