DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dspinbox.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DSPINBOX_H
6#define DSPINBOX_H
7
8#include <dtkwidget_global.h>
9#include <DObject>
10
11#include <QSpinBox>
12
13DWIDGET_BEGIN_NAMESPACE
14
15class DSpinBoxPrivate;
16class LIBDTKWIDGETSHARED_EXPORT DSpinBox : public QSpinBox, public DTK_CORE_NAMESPACE::DObject
17{
18 Q_OBJECT
19
20 Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged)
21#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
22 Q_PROPERTY(int defaultValue READ defaultValue WRITE setDefaultValue NOTIFY defaultValueChanged)
23#endif
24
25public:
26 explicit DSpinBox(QWidget *parent = nullptr);
27
28 QLineEdit *lineEdit() const;
29
30 bool isAlert() const;
31 void showAlertMessage(const QString &text, int duration = 3000);
32 void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000);
33#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
34 D_DECL_DEPRECATED int defaultValue() const;
35#endif
36
37 void setEnabledEmbedStyle(bool enabled);
38
39public Q_SLOTS:
40 void setAlert(bool alert);
41#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
42 D_DECL_DEPRECATED void setDefaultValue(int defaultValue);
43#endif
44
45Q_SIGNALS:
46 void alertChanged(bool alert);
47#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
48 D_DECL_DEPRECATED void defaultValueChanged(int defaultValue);
49#endif
50
51private:
52 D_DECLARE_PRIVATE(DSpinBox)
53};
54
56class LIBDTKWIDGETSHARED_EXPORT DDoubleSpinBox : public QDoubleSpinBox, public DTK_CORE_NAMESPACE::DObject
57{
58 Q_OBJECT
59
60 Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged)
61#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
62 Q_PROPERTY(double defaultValue READ defaultValue WRITE setDefaultValue NOTIFY defaultValueChanged)
63#endif
64
65public:
66 explicit DDoubleSpinBox(QWidget *parent = nullptr);
67
68 bool isAlert() const;
69 void showAlertMessage(const QString &text, int duration = 3000);
70 void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000);
71#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
72 D_DECL_DEPRECATED double defaultValue() const;
73#endif
74
75 QLineEdit *lineEdit() const;
76 void setEnabledEmbedStyle(bool enabled);
77
78public Q_SLOTS:
79 void setAlert(bool alert);
80#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
81 D_DECL_DEPRECATED void setDefaultValue(double defaultValue);
82#endif
83
84Q_SIGNALS:
85 void alertChanged(bool alert);
86#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
87 D_DECL_DEPRECATED void defaultValueChanged(double defaultValue);
88#endif
89
90private:
91 D_DECLARE_PRIVATE(DDoubleSpinBox)
92};
93
94DWIDGET_END_NAMESPACE
95
96#endif // DSPINBOX_H
Definition dspinbox_p.h:29
类似 DDoubleSpinBox
Definition dspinbox.h:57
deepin风格的QSpinBox.
Definition dspinbox.h:17
void alertChanged(bool alert)
警告状态发生了变化