mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-03-21 17:55:21 -05:00
[VDS] Try to fix memory leak by properly parenting widgets (#6498)
* [VDS] Try to fix memory leak by properly parenting widgets * format
This commit is contained in:
parent
b86853b65c
commit
0a2fdb05ad
|
|
@ -47,7 +47,7 @@ CardInfoPictureWidget::CardInfoPictureWidget(QWidget *parent, const bool _hoverT
|
|||
originalPos = this->pos();
|
||||
|
||||
// Create the animation
|
||||
animation = new QPropertyAnimation(this, "pos");
|
||||
animation = new QPropertyAnimation(this, "pos", this);
|
||||
animation->setDuration(200); // 200ms animation duration
|
||||
animation->setEasingCurve(QEasingCurve::OutQuad);
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ void DeckPreviewWidget::initializeUi(const bool deckLoadSuccess)
|
|||
bannerCardComboBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||
bannerCardComboBox->setObjectName("bannerCardComboBox");
|
||||
bannerCardComboBox->setCurrentText(deckLoader->getDeck().deckList.getBannerCard().name);
|
||||
bannerCardComboBox->installEventFilter(new NoScrollFilter());
|
||||
bannerCardComboBox->installEventFilter(new NoScrollFilter(bannerCardComboBox));
|
||||
connect(bannerCardComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this,
|
||||
&DeckPreviewWidget::setBannerCard);
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,11 @@ private slots:
|
|||
class NoScrollFilter : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NoScrollFilter(QObject *parent = nullptr) : QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user