diff options
author | Saturneric <[email protected]> | 2021-08-10 14:06:45 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-08-10 14:06:45 +0000 |
commit | 61ced076e5effd3f8ddc76372242ba5fa67b6303 (patch) | |
tree | 4722a7cea8387c83f470d170d88e5a8164498d0b /src/ui/ShowCopyDialog.cpp | |
parent | Merge branch 'develop-ci' into develop (diff) | |
download | GpgFrontend-61ced076e5effd3f8ddc76372242ba5fa67b6303.tar.gz GpgFrontend-61ced076e5effd3f8ddc76372242ba5fa67b6303.zip |
Add Functions:
GpgFrontend Settings
Service Token
Short Crypto Text
Functions TODO:
Revoke Cert Generation
Diffstat (limited to '')
-rw-r--r-- | src/ui/ShowCopyDialog.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ui/ShowCopyDialog.cpp b/src/ui/ShowCopyDialog.cpp new file mode 100644 index 00000000..58a6cf0a --- /dev/null +++ b/src/ui/ShowCopyDialog.cpp @@ -0,0 +1,26 @@ +// +// Created by Administrator on 2021/7/21. +// + +#include "ui/ShowCopyDialog.h" + +ShowCopyDialog::ShowCopyDialog(const QString &text, QWidget *parent) : QDialog(parent) { + textEdit = new QTextEdit(); + textEdit->setReadOnly(true); + textEdit->setLineWrapMode(QTextEdit::WidgetWidth); + textEdit->setText(text); + copyButton = new QPushButton("Copy"); + connect(copyButton, SIGNAL(clicked(bool)), this, SLOT(slotCopyText())); + + auto *layout = new QVBoxLayout(); + layout->addWidget(textEdit); + layout->addWidget(copyButton); + + this->setModal(true); + this->setLayout(layout); +} + +void ShowCopyDialog::slotCopyText() { + QClipboard *cb = QApplication::clipboard(); + cb->setText(textEdit->toPlainText()); +} |