mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 15:49:28 -08:00
Properly delete enlargedPixmapWidget (#6131)
* Properly delete enlargedPixmapWidget. Took 23 minutes Took 13 seconds Took 16 seconds * Connect to QObject instead of emitting own signal. Took 12 minutes Took 7 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
@@ -40,6 +40,7 @@ CardInfoPictureWidget::CardInfoPictureWidget(QWidget *parent, const bool _hoverT
|
||||
|
||||
enlargedPixmapWidget = new CardInfoPictureEnlargedWidget(this->window());
|
||||
enlargedPixmapWidget->hide();
|
||||
connect(this, &QObject::destroyed, enlargedPixmapWidget, &CardInfoPictureEnlargedWidget::deleteLater);
|
||||
|
||||
hoverTimer = new QTimer(this);
|
||||
hoverTimer->setSingleShot(true);
|
||||
@@ -63,14 +64,6 @@ CardInfoPictureWidget::CardInfoPictureWidget(QWidget *parent, const bool _hoverT
|
||||
});
|
||||
}
|
||||
|
||||
CardInfoPictureWidget::~CardInfoPictureWidget()
|
||||
{
|
||||
if (enlargedPixmapWidget) {
|
||||
enlargedPixmapWidget->hide();
|
||||
enlargedPixmapWidget->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Sets the card to be displayed and updates the pixmap.
|
||||
* @param card A shared pointer to the card information (CardInfoPtr).
|
||||
|
||||
@@ -21,7 +21,6 @@ public:
|
||||
explicit CardInfoPictureWidget(QWidget *parent = nullptr,
|
||||
bool hoverToZoomEnabled = false,
|
||||
bool raiseOnEnter = false);
|
||||
~CardInfoPictureWidget();
|
||||
ExactCard getCard()
|
||||
{
|
||||
return exactCard;
|
||||
|
||||
Reference in New Issue
Block a user