fix: 修复bug85684
Description: plaintEdit太过于灵敏,换用qtextedit Log: 与编辑栏有关 Bug: https://pms.uniontech.com/zentao/bug-view-85684.html Change-Id: I1b85e533e9e4a02447c4da7de299323fa576f54b
This commit is contained in:
parent
a5ca0e54a4
commit
0f4bf6ecf5
|
@ -402,7 +402,8 @@ void MainWidget::loadHtml(const QString &html)
|
|||
if (!html.isEmpty()) {
|
||||
m_frameStackLayout->setContentsMargins(20, 0, 5, 0);
|
||||
m_resultWidget->setCurrentWidget(m_plainTextEdit);
|
||||
m_plainTextEdit->appendHtml(html);
|
||||
// m_plainTextEdit->appendHtml(html);
|
||||
m_plainTextEdit->setHtml(html);
|
||||
} else {
|
||||
resultEmpty();
|
||||
}
|
||||
|
@ -413,7 +414,8 @@ void MainWidget::loadString(const QString &string)
|
|||
if (!string.isEmpty()) {
|
||||
m_frameStackLayout->setContentsMargins(20, 0, 5, 0);
|
||||
m_resultWidget->setCurrentWidget(m_plainTextEdit);
|
||||
m_plainTextEdit->appendPlainText(string);
|
||||
// m_plainTextEdit->appendPlainText(string);
|
||||
m_plainTextEdit->setText(string);
|
||||
//读取完了显示在最上方
|
||||
m_plainTextEdit->moveCursor(QTextCursor::Start) ;
|
||||
m_plainTextEdit->ensureCursorVisible() ;
|
||||
|
@ -498,7 +500,7 @@ void MainWidget::slotCopy()
|
|||
m_plainTextEdit->copy();
|
||||
} else {
|
||||
QTextDocument *document = m_plainTextEdit->document();
|
||||
DPlainTextEdit *tempTextEdit = new DPlainTextEdit(this);
|
||||
QTextEdit *tempTextEdit = new QTextEdit(this);
|
||||
tempTextEdit->setDocument(document);
|
||||
tempTextEdit->selectAll();
|
||||
tempTextEdit->copy();
|
||||
|
|
|
@ -67,5 +67,5 @@ void ResultTextView::resizeEvent(QResizeEvent *event)
|
|||
{
|
||||
emit sigChangeSize();
|
||||
this->viewport()->setFixedWidth(this->width() - 15);
|
||||
DPlainTextEdit::resizeEvent(event);
|
||||
QTextEdit::resizeEvent(event);
|
||||
}
|
||||
|
|
|
@ -2,13 +2,12 @@
|
|||
#define RESULTTEXTVIEW_H
|
||||
|
||||
#include <QObject>
|
||||
#include <DPlainTextEdit>
|
||||
#include <QTextEdit>
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
|
||||
class ResultTextView : public DPlainTextEdit
|
||||
class ResultTextView : public QTextEdit
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue
Block a user