diff options
author | Saturneric <[email protected]> | 2021-10-02 14:08:50 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2021-10-02 14:16:27 +0000 |
commit | 3c65d087eeee687ac01af2e80f3dd538f9a2c230 (patch) | |
tree | 1e860dc6343c1897e2224a002f2ca44c574381b3 /src/ui/ShowCopyDialog.cpp | |
parent | The basic functions of the core pass the test. (diff) | |
download | GpgFrontend-3c65d087eeee687ac01af2e80f3dd538f9a2c230.tar.gz GpgFrontend-3c65d087eeee687ac01af2e80f3dd538f9a2c230.zip |
UI Framework Modified.
Diffstat (limited to 'src/ui/ShowCopyDialog.cpp')
-rw-r--r-- | src/ui/ShowCopyDialog.cpp | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/src/ui/ShowCopyDialog.cpp b/src/ui/ShowCopyDialog.cpp index 3286f6c4..98a1df3c 100644 --- a/src/ui/ShowCopyDialog.cpp +++ b/src/ui/ShowCopyDialog.cpp @@ -24,30 +24,37 @@ #include "ui/ShowCopyDialog.h" -ShowCopyDialog::ShowCopyDialog(const QString &text, const QString &info, 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())); - - infoLabel = new QLabel(); - infoLabel->setText(info); - infoLabel->setWordWrap(true); - - auto *layout = new QVBoxLayout(); - layout->addWidget(textEdit); - layout->addWidget(copyButton); - layout->addWidget(infoLabel); - - this->setWindowTitle("Short Ciphertext"); - this->resize(320, 120); - this->setModal(true); - this->setLayout(layout); +namespace GpgFrontend::UI { + +ShowCopyDialog::ShowCopyDialog(const QString& text, + const QString& info, + 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())); + + infoLabel = new QLabel(); + infoLabel->setText(info); + infoLabel->setWordWrap(true); + + auto* layout = new QVBoxLayout(); + layout->addWidget(textEdit); + layout->addWidget(copyButton); + layout->addWidget(infoLabel); + + this->setWindowTitle("Short Ciphertext"); + this->resize(320, 120); + this->setModal(true); + this->setLayout(layout); } void ShowCopyDialog::slotCopyText() { - QClipboard *cb = QApplication::clipboard(); - cb->setText(textEdit->toPlainText()); + QClipboard* cb = QApplication::clipboard(); + cb->setText(textEdit->toPlainText()); } + +} // namespace GpgFrontend::UI |