DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dsearchedit.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DSEARCHEDIT_H
6#define DSEARCHEDIT_H
7
8#include <DLineEdit>
9
10DWIDGET_BEGIN_NAMESPACE
11
12class DSearchEditPrivate;
13class LIBDTKWIDGETSHARED_EXPORT DSearchEdit : public DLineEdit
14{
15 Q_OBJECT
16 Q_PROPERTY(bool voiceInput READ isVoiceInput NOTIFY voiceChanged)
17
18public:
19 explicit DSearchEdit(QWidget *parent = nullptr);
21
22 void setPlaceHolder(QString placeHolder);
23 QString placeHolder() const;
24
25 void clear();
26 void clearEdit();
27
28 bool isVoiceInput() const;
29
30 void setPlaceholderText(const QString &text);
31 QString placeholderText() const;
32
33Q_SIGNALS:
34 void voiceInputFinished();
35 void searchAborted();
36 void voiceChanged();
37
38protected:
39 Q_DISABLE_COPY(DSearchEdit)
40 D_DECLARE_PRIVATE(DSearchEdit)
41 Q_PRIVATE_SLOT(d_func(), void _q_toEditMode(bool))
42 D_PRIVATE_SLOT(void _q_onVoiceActionTrigger(bool))
43 D_PRIVATE_SLOT(void _q_clearFocus())
44};
45
46DWIDGET_END_NAMESPACE
47
48#endif // DSEARCHEDIT_H
DLineEdit一个聚合 QLineEdit 的输入框.
Definition dlineedit.h:20
void setPlaceholderText(const QString &)
设置占位文本
Definition dlineedit.cpp:372
void clear()
清空编辑的内容
Definition dlineedit.cpp:316
DSearchEdit 类提供了专门用来进行搜索的输入框控件.
Definition dsearchedit.h:14