mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-13 03:30:42 +02:00
qt, refactor: Inline GUIUtil::GetImage
function
This commit is contained in:
parent
4b36ab3a6a
commit
d1ec6db249
@ -962,15 +962,6 @@ bool HasPixmap(const QLabel* label)
|
||||
return !label->pixmap(Qt::ReturnByValue).isNull();
|
||||
}
|
||||
|
||||
QImage GetImage(const QLabel* label)
|
||||
{
|
||||
if (!HasPixmap(label)) {
|
||||
return QImage();
|
||||
}
|
||||
|
||||
return label->pixmap(Qt::ReturnByValue).toImage();
|
||||
}
|
||||
|
||||
QString MakeHtmlLink(const QString& source, const QString& link)
|
||||
{
|
||||
return QString(source).replace(
|
||||
|
@ -347,7 +347,6 @@ namespace GUIUtil
|
||||
* QPixmap* QLabel::pixmap() is deprecated since Qt 5.15.
|
||||
*/
|
||||
bool HasPixmap(const QLabel* label);
|
||||
QImage GetImage(const QLabel* label);
|
||||
|
||||
/**
|
||||
* Splits the string into substrings wherever separator occurs, and returns
|
||||
|
@ -92,7 +92,11 @@ bool QRImageWidget::setQR(const QString& data, const QString& text)
|
||||
|
||||
QImage QRImageWidget::exportImage()
|
||||
{
|
||||
return GUIUtil::GetImage(this);
|
||||
if (!GUIUtil::HasPixmap(this)) {
|
||||
return QImage();
|
||||
}
|
||||
|
||||
return this->pixmap(Qt::ReturnByValue).toImage();
|
||||
}
|
||||
|
||||
void QRImageWidget::mousePressEvent(QMouseEvent *event)
|
||||
|
Loading…
Reference in New Issue
Block a user