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 = new CardInfoPictureEnlargedWidget(this->window());
enlargedPixmapWidget->hide(); enlargedPixmapWidget->hide();
connect(this, &CardInfoPictureWidget::deleteEnlargedPixmapWidget, enlargedPixmapWidget, connect(this, &QObject::destroyed, enlargedPixmapWidget, &CardInfoPictureEnlargedWidget::deleteLater);
&CardInfoPictureEnlargedWidget::deleteLater);
hoverTimer = new QTimer(this); hoverTimer = new QTimer(this);
hoverTimer->setSingleShot(true); 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. * @brief Sets the card to be displayed and updates the pixmap.
* @param card A shared pointer to the card information (CardInfoPtr). * @param card A shared pointer to the card information (CardInfoPtr).

View file

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