Non-lambda.

This commit is contained in:
Lukas Brübach 2024-12-29 18:12:48 +01:00
parent ac3a128c85
commit 1d093d62b5
2 changed files with 8 additions and 4 deletions

View file

@ -35,10 +35,7 @@ VisualDeckStorageWidget::VisualDeckStorageWidget(QWidget *parent) : QWidget(pare
layout->addWidget(cardSizeWidget);
// Connect sorting change signal to refresh the file list
connect(sortComboBox, &QComboBox::currentIndexChanged, this, [this]() {
sortOrder = static_cast<SortOrder>(sortComboBox->currentData().toInt());
refreshBannerCards(); // Refresh the banner cards with the new sort order
});
connect(sortComboBox, &QComboBox::currentIndexChanged, this, &VisualDeckStorageWidget::updateSortOrder);
}
void VisualDeckStorageWidget::showEvent(QShowEvent *event)
@ -47,6 +44,12 @@ void VisualDeckStorageWidget::showEvent(QShowEvent *event)
refreshBannerCards();
}
void VisualDeckStorageWidget::updateSortOrder()
{
sortOrder = static_cast<SortOrder>(sortComboBox->currentData().toInt());
refreshBannerCards(); // Refresh the banner cards with the new sort order
}
void VisualDeckStorageWidget::imageClickedEvent(QMouseEvent *event, DeckPreviewCardPictureWidget *instance)
{
emit imageClicked(event, instance);

View file

@ -24,6 +24,7 @@ public slots:
void imageDoubleClickedEvent(QMouseEvent *event, DeckPreviewCardPictureWidget *instance);
void refreshBannerCards(); // Refresh the display of cards based on the current sorting option
void showEvent(QShowEvent *event) override;
void updateSortOrder();
signals:
void imageClicked(QMouseEvent *event, DeckPreviewCardPictureWidget *instance);