Connect to QObject instead of emitting own signal.

Took 12 minutes

Took 7 minutes
This commit is contained in:
Lukas Brübach 2025-09-13 12:38:17 +02:00
parent 578c650936
commit 7a9d3f8e77
2 changed files with 1 additions and 9 deletions

View file

@ -40,8 +40,7 @@ CardInfoPictureWidget::CardInfoPictureWidget(QWidget *parent, const bool _hoverT
enlargedPixmapWidget = new CardInfoPictureEnlargedWidget(this->window());
enlargedPixmapWidget->hide();
connect(this, &CardInfoPictureWidget::deleteEnlargedPixmapWidget, enlargedPixmapWidget,
&CardInfoPictureEnlargedWidget::deleteLater);
connect(this, &QObject::destroyed, enlargedPixmapWidget, &CardInfoPictureEnlargedWidget::deleteLater);
hoverTimer = new QTimer(this);
hoverTimer->setSingleShot(true);
@ -65,11 +64,6 @@ CardInfoPictureWidget::CardInfoPictureWidget(QWidget *parent, const bool _hoverT
});
}
CardInfoPictureWidget::~CardInfoPictureWidget()
{
emit deleteEnlargedPixmapWidget();
}
/**
* @brief Sets the card to be displayed and updates the pixmap.
* @param card A shared pointer to the card information (CardInfoPtr).

View file

@ -21,7 +21,6 @@ public:
explicit CardInfoPictureWidget(QWidget *parent = nullptr,
bool hoverToZoomEnabled = false,
bool raiseOnEnter = false);
~CardInfoPictureWidget();
ExactCard getCard()
{
return exactCard;
@ -40,7 +39,6 @@ signals:
void cardScaleFactorChanged(int _scale);
void cardChanged(const ExactCard &card);
void cardClicked();
void deleteEnlargedPixmapWidget();
protected:
void resizeEvent(QResizeEvent *event) override;