DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dtextedit.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DTEXTEDIT_H
6#define DTEXTEDIT_H
7
8#include <QTextEdit>
9
10#include <dtkwidget_global.h>
11#include <DObject>
12
13QT_BEGIN_NAMESPACE
14class QContextMenuEvent;
15QT_END_NAMESPACE
16
17DWIDGET_BEGIN_NAMESPACE
18class DTextEditPrivate;
19class DTextEdit : public QTextEdit, public DCORE_NAMESPACE::DObject
20{
21public:
22 explicit DTextEdit(QWidget *parent = nullptr);
23 explicit DTextEdit(const QString& text, QWidget* parent = nullptr);
24
25public:
26 bool speechToTextIsEnabled() const;
27 void setSpeechToTextEnabled(bool enable);
28
29 bool textToSpeechIsEnabled() const;
30 void setTextToSpeechEnabled(bool enable);
31
32 bool textToTranslateIsEnabled() const;
33 void setTextToTranslateEnabled(bool enable);
34
35protected:
36 bool event(QEvent *e) override;
37 void contextMenuEvent(QContextMenuEvent *e) override;
38 virtual void keyPressEvent(QKeyEvent *e) override;
39
40private:
41 D_DECLARE_PRIVATE(DTextEdit)
42};
43
44DWIDGET_END_NAMESPACE
45
46#endif // DTEXTEDIT_H
一个用于编辑和显示纯文本/富文本的控件
Definition dtextedit.h:20