aboutsummaryrefslogtreecommitdiff
path: root/src/qt/qrimagewidget.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-08-09 17:55:34 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-08-26 20:17:52 +0300
commitfa5749c805878304c107bcae0ae5ffa401dc7c4d (patch)
tree00567d46ca9289dcad996d00ab2312432ca12bdb /src/qt/qrimagewidget.cpp
parentb02264cb5dfcef50eec8a6346471cbaa25370e00 (diff)
qt, refactor: Fix 'pixmap is deprecated' warnings
Diffstat (limited to 'src/qt/qrimagewidget.cpp')
-rw-r--r--src/qt/qrimagewidget.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/qt/qrimagewidget.cpp b/src/qt/qrimagewidget.cpp
index c816e1f8ed..5dc4d58f86 100644
--- a/src/qt/qrimagewidget.cpp
+++ b/src/qt/qrimagewidget.cpp
@@ -95,15 +95,12 @@ bool QRImageWidget::setQR(const QString& data, const QString& text)
QImage QRImageWidget::exportImage()
{
- if(!pixmap())
- return QImage();
- return pixmap()->toImage();
+ return GUIUtil::GetImage(this);
}
void QRImageWidget::mousePressEvent(QMouseEvent *event)
{
- if(event->button() == Qt::LeftButton && pixmap())
- {
+ if (event->button() == Qt::LeftButton && GUIUtil::HasPixmap(this)) {
event->accept();
QMimeData *mimeData = new QMimeData;
mimeData->setImageData(exportImage());
@@ -118,7 +115,7 @@ void QRImageWidget::mousePressEvent(QMouseEvent *event)
void QRImageWidget::saveImage()
{
- if(!pixmap())
+ if (!GUIUtil::HasPixmap(this))
return;
QString fn = GUIUtil::getSaveFileName(this, tr("Save QR Code"), QString(), tr("PNG Image (*.png)"), nullptr);
if (!fn.isEmpty())
@@ -129,14 +126,14 @@ void QRImageWidget::saveImage()
void QRImageWidget::copyImage()
{
- if(!pixmap())
+ if (!GUIUtil::HasPixmap(this))
return;
QApplication::clipboard()->setImage(exportImage());
}
void QRImageWidget::contextMenuEvent(QContextMenuEvent *event)
{
- if(!pixmap())
+ if (!GUIUtil::HasPixmap(this))
return;
contextMenu->exec(event->globalPos());
}