qt, refactor: Inline GUIUtil::GetImage function

This commit is contained in:
Hennadii Stepanov committed 2025-04-02 20:48:36 +01:00
1 parent 4b36ab3a6a
commit d1ec6db249
3 files changed
+5 -11

No files matched your search

-9
View File
@@ -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(
-1
View File
@@ -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
+5 -1
View File
@@ -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)