DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dgraphicsclipeffect.h
1// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DGRAPHICSCLIPEFFECT_H
6#define DGRAPHICSCLIPEFFECT_H
7
8#include <dtkwidget_global.h>
9#include <DObject>
10
11#include <QGraphicsEffect>
12#include <QPainterPath>
13
14DWIDGET_BEGIN_NAMESPACE
15
16class DGraphicsClipEffectPrivate;
17class DGraphicsClipEffect : public QGraphicsEffect, 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 DGraphicsClipEffect(QObject *parent = Q_NULLPTR);
26
27 QMargins margins() const;
28 QPainterPath clipPath() const;
29
30public Q_SLOTS:
31 void setMargins(const QMargins &margins);
32 void setClipPath(const QPainterPath &clipPath);
33
34Q_SIGNALS:
35 void marginsChanged(QMargins margins);
36 void clipPathChanged(QPainterPath clipPath);
37
38protected:
39 void draw(QPainter *painter) Q_DECL_OVERRIDE;
40
41private:
42 D_DECLARE_PRIVATE(DGraphicsClipEffect)
43};
44
45DWIDGET_END_NAMESPACE
46
47#endif // DGRAPHICSCLIPEFFECT_H
用于裁剪窗口的绘制内容.
Definition dgraphicsclipeffect.h:18