Skip to content

Commit d1ec6db

Browse files
committed
qt, refactor: Inline GUIUtil::GetImage function
1 parent 4b36ab3 commit d1ec6db

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/qt/guiutil.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -962,15 +962,6 @@ bool HasPixmap(const QLabel* label)
962962
return !label->pixmap(Qt::ReturnByValue).isNull();
963963
}
964964

965-
QImage GetImage(const QLabel* label)
966-
{
967-
if (!HasPixmap(label)) {
968-
return QImage();
969-
}
970-
971-
return label->pixmap(Qt::ReturnByValue).toImage();
972-
}
973-
974965
QString MakeHtmlLink(const QString& source, const QString& link)
975966
{
976967
return QString(source).replace(

src/qt/guiutil.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ namespace GUIUtil
347347
* QPixmap* QLabel::pixmap() is deprecated since Qt 5.15.
348348
*/
349349
bool HasPixmap(const QLabel* label);
350-
QImage GetImage(const QLabel* label);
351350

352351
/**
353352
* Splits the string into substrings wherever separator occurs, and returns

src/qt/qrimagewidget.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ bool QRImageWidget::setQR(const QString& data, const QString& text)
9292

9393
QImage QRImageWidget::exportImage()
9494
{
95-
return GUIUtil::GetImage(this);
95+
if (!GUIUtil::HasPixmap(this)) {
96+
return QImage();
97+
}
98+
99+
return this->pixmap(Qt::ReturnByValue).toImage();
96100
}
97101

98102
void QRImageWidget::mousePressEvent(QMouseEvent *event)

0 commit comments

Comments
 (0)