diff options
author | Arno <arno@disconnect.de> | 2017-12-27 05:45:28 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2017-12-27 05:45:28 +0100 |
commit | a5bc7085e4d62fcb5895d5c7da20c4fbea8f1b50 (patch) | |
tree | 1d50d109e10b520084b9a08213ce172b20b19f05 | |
parent | 8dba30a9dd2386f59179818e106c4eb5993a5390 (diff) | |
download | SheMov-a5bc7085e4d62fcb5895d5c7da20c4fbea8f1b50.tar.gz SheMov-a5bc7085e4d62fcb5895d5c7da20c4fbea8f1b50.tar.bz2 SheMov-a5bc7085e4d62fcb5895d5c7da20c4fbea8f1b50.zip |
Add clear button for comment in metadata
Also use SLOT activated instead of currentChanged for the reasons
QCombobox so the text is inserted even if the selection didn't change.
-rw-r--r-- | archiveview.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/archiveview.cpp b/archiveview.cpp index cf4013a..2773512 100644 --- a/archiveview.cpp +++ b/archiveview.cpp @@ -795,24 +795,27 @@ MetadataEditorWidget::MetadataEditorWidget(QWidget *parent) : QWidget(parent){ srcGB->setLayout(srcGBL); QGroupBox *reasonGB = new QGroupBox(tr("Reencode reason")); - QHBoxLayout *reasonGBL = new QHBoxLayout; + QVBoxLayout *reasonGBL = new QVBoxLayout; mReencReason = new QComboBox; QStringList reasons = SmGlobals::instance()->reencReasons(); mReencReason->addItems(reasons); - connect(mReencReason, SIGNAL(currentIndexChanged(QString)), this, SLOT(addToComment(QString))); + connect(mReencReason, QOverload<const QString &>::of(&QComboBox::activated), this, &MetadataEditorWidget::addToComment); + QPushButton *clearB = new QPushButton(tr("Clear")); reasonGBL->addWidget(mReencReason); + reasonGBL->addWidget(clearB); reasonGB->setLayout(reasonGBL); QHBoxLayout *srcReasonL = new QHBoxLayout; srcReasonL->addWidget(srcGB); - srcReasonL->addWidget(reasonGB); //comment QGroupBox *commentGB = new QGroupBox(tr("Comment")); mComment = new QTextEdit; QHBoxLayout *commentGBL = new QHBoxLayout; commentGBL->addWidget(mComment); + commentGBL->addWidget(reasonGB); commentGB->setLayout(commentGBL); + connect(clearB, &QPushButton::clicked, [this] { mComment->clear(); }); QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(captionL); |