diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-03-30 02:49:03 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-04-14 18:51:26 +0300 |
commit | 16c157de3c316517e095994fa8d526253225a672 (patch) | |
tree | d8aff58cc7d8a9f9c121e8bb1beec054dacca385 /src/qt/qrimagewidget.cpp | |
parent | 79311750b58d650d49a3f0edd59d31dd132ab8c0 (diff) |
qt, refactor: Use better QMenu::addAction overloaded function
This overloaded function was introduced in Qt 5.6 and makes code more
concise.
Diffstat (limited to 'src/qt/qrimagewidget.cpp')
-rw-r--r-- | src/qt/qrimagewidget.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/qt/qrimagewidget.cpp b/src/qt/qrimagewidget.cpp index ac463e0988..df6757ffd6 100644 --- a/src/qt/qrimagewidget.cpp +++ b/src/qt/qrimagewidget.cpp @@ -27,12 +27,8 @@ QRImageWidget::QRImageWidget(QWidget *parent): QLabel(parent), contextMenu(nullptr) { contextMenu = new QMenu(this); - QAction* saveImageAction = new QAction(tr("Save Image..."), this); - connect(saveImageAction, &QAction::triggered, this, &QRImageWidget::saveImage); - contextMenu->addAction(saveImageAction); - QAction* copyImageAction = new QAction(tr("Copy Image"), this); - connect(copyImageAction, &QAction::triggered, this, &QRImageWidget::copyImage); - contextMenu->addAction(copyImageAction); + contextMenu->addAction(tr("Save Image..."), this, &QRImageWidget::saveImage); + contextMenu->addAction(tr("Copy Image"), this, &QRImageWidget::copyImage); } bool QRImageWidget::setQR(const QString& data, const QString& text) |