Fix newlines when copying from DatabaseWidget

This commit is contained in:
Owen Wang 2022-10-04 20:40:18 -04:00 committed by Jonathan White
parent db98f114f9
commit 893b398d73

View File

@ -28,6 +28,7 @@
#include <QPlainTextEdit> #include <QPlainTextEdit>
#include <QProcess> #include <QProcess>
#include <QSplitter> #include <QSplitter>
#include <QTextDocumentFragment>
#include <QTextEdit> #include <QTextEdit>
#include <core/Tools.h> #include <core/Tools.h>
@ -638,7 +639,7 @@ void DatabaseWidget::copyPassword()
auto textEdit = qobject_cast<QTextEdit*>(focusWidget()); auto textEdit = qobject_cast<QTextEdit*>(focusWidget());
if (textEdit && textEdit->textCursor().hasSelection()) { if (textEdit && textEdit->textCursor().hasSelection()) {
clipboard()->setText(textEdit->textCursor().selectedText(), clearClipboard); clipboard()->setText(textEdit->textCursor().selection().toPlainText(), clearClipboard);
return; return;
} }