mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 01:33:20 +02:00
qt, refactor: Fix 'pixmap is deprecated' warnings
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user