DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
denhancedwidget.h
1// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DENHANCEDWIDGET_H
6#define DENHANCEDWIDGET_H
7
8#include <QWidget>
9
10#include <dtkwidget_global.h>
11
12DWIDGET_BEGIN_NAMESPACE
13
14class DEnhancedWidgetPrivate;
15class DEnhancedWidget: public QObject
16{
17 Q_OBJECT
18
19 Q_PROPERTY(QWidget *target READ target WRITE setTarget NOTIFY targetChanged)
20 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
21
22public:
23 explicit DEnhancedWidget(QWidget *target, QObject *parent = 0);
25
26 QWidget *target() const;
27 bool enabled() const;
28
29public Q_SLOTS:
30 void setTarget(QWidget *target);
31 void setEnabled(bool enabled);
32
33Q_SIGNALS:
34 void xChanged(int x);
35 void yChanged(int y);
36 void positionChanged(const QPoint &point);
37 void widthChanged(int width);
38 void heightChanged(int height);
39 void sizeChanged(const QSize &size);
40 void targetChanged(QWidget *target);
41 void enabledChanged(bool enabled);
42 void showed();
43
44protected:
45 bool eventFilter(QObject *o, QEvent *e) Q_DECL_OVERRIDE;
46
47private:
48 explicit DEnhancedWidget(DEnhancedWidgetPrivate *dd, QWidget *w, QObject *parent = 0);
49
51
52 Q_DECLARE_PRIVATE(DEnhancedWidget)
53};
54
55DWIDGET_END_NAMESPACE
56
57#endif // DENHANCEDWIDGET_H
Definition denhancedwidget.cpp:13
对目标控件进行监听,并发射相应的信号
Definition denhancedwidget.h:16