Fixed usage of deprecated method "const QPixmap *QLabel::pixmap() const;"

This commit is contained in:
thunder2 2025-07-19 03:20:44 +02:00
parent fcd7a213e6
commit b2bec12a43
2 changed files with 5 additions and 11 deletions

View file

@ -700,8 +700,8 @@ void IdEditDialog::removeAvatar()
void IdEditDialog::updateInterface()
{
const QPixmap *pixmap = ui->avatarLabel->pixmap();
if (pixmap && !pixmap->isNull()) {
QPixmap pixmap = ui->avatarLabel->pixmap(Qt::ReturnByValue);
if (!pixmap.isNull()) {
ui->removeButton->setEnabled(true);
} else if (mEditGroup.mImage.mSize > 0) {
ui->removeButton->setEnabled(true);

View file

@ -107,8 +107,8 @@ void AvatarDialog::removeAvatar()
void AvatarDialog::updateInterface()
{
const QPixmap *pixmap = ui->avatarLabel->pixmap();
if (pixmap && !pixmap->isNull()) {
QPixmap pixmap = ui->avatarLabel->pixmap(Qt::ReturnByValue);
if (!pixmap.isNull()) {
ui->removeButton->setEnabled(true);
} else {
ui->removeButton->setEnabled(false);
@ -123,13 +123,7 @@ void AvatarDialog::setAvatar(const QPixmap &avatar)
void AvatarDialog::getAvatar(QPixmap &avatar)
{
const QPixmap *pixmap = ui->avatarLabel->pixmap();
if (!pixmap) {
avatar = QPixmap();
return;
}
avatar = *pixmap;
avatar = ui->avatarLabel->pixmap(Qt::ReturnByValue);
}
void AvatarDialog::getAvatar(QByteArray &avatar)