Refactor files in src/client/ui to new Qt Slot/Signal syntax (#5832)

This commit is contained in:
RickyRister 2025-04-15 15:06:56 -07:00 committed by GitHub
parent 686717e544
commit 728c87589f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 51 additions and 48 deletions

View file

@ -22,7 +22,7 @@ CardInfoDisplayWidget::CardInfoDisplayWidget(const QString &cardName,
pic->setObjectName("pic");
text = new CardInfoTextWidget();
text->setObjectName("text");
connect(text, SIGNAL(linkActivated(const QString &)), this, SLOT(setCard(const QString &)));
connect(text, &CardInfoTextWidget::linkActivated, this, [this](const QString &card) { setCard(card); });
auto *layout = new QVBoxLayout();
layout->setObjectName("layout");
@ -52,7 +52,7 @@ void CardInfoDisplayWidget::setCard(CardInfoPtr card)
disconnect(info.data(), nullptr, this, nullptr);
info = std::move(card);
if (info)
connect(info.data(), SIGNAL(destroyed()), this, SLOT(clear()));
connect(info.data(), &QObject::destroyed, this, &CardInfoDisplayWidget::clear);
text->setCard(info);
pic->setCard(info);

View file

@ -21,7 +21,7 @@ CardInfoFrameWidget::CardInfoFrameWidget(const QString &cardName, QWidget *paren
text = new CardInfoTextWidget();
text->setObjectName("text");
connect(text, SIGNAL(linkActivated(const QString &)), this, SLOT(setCard(const QString &)));
connect(text, &CardInfoTextWidget::linkActivated, this, qOverload<const QString &>(&CardInfoFrameWidget::setCard));
tab1 = new QWidget(this);
tab2 = new QWidget(this);
@ -34,7 +34,7 @@ CardInfoFrameWidget::CardInfoFrameWidget(const QString &cardName, QWidget *paren
insertTab(ImageOnlyView, tab1, QString());
insertTab(TextOnlyView, tab2, QString());
insertTab(ImageAndTextView, tab3, QString());
connect(this, SIGNAL(currentChanged(int)), this, SLOT(setViewMode(int)));
connect(this, &CardInfoFrameWidget::currentChanged, this, &CardInfoFrameWidget::setViewMode);
tab1Layout = new QVBoxLayout();
tab1Layout->setObjectName("tab1Layout");
@ -154,7 +154,7 @@ void CardInfoFrameWidget::setCard(CardInfoPtr card)
info = std::move(card);
if (info) {
connect(info.data(), SIGNAL(destroyed()), this, SLOT(clearCard()));
connect(info.data(), &QObject::destroyed, this, &CardInfoFrameWidget::clearCard);
}
setViewTransformationButtonVisibility(hasTransformation(info));

View file

@ -68,7 +68,7 @@ void CardInfoPictureWidget::setCard(CardInfoPtr card)
info = std::move(card);
if (info) {
connect(info.data(), SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
connect(info.data(), &CardInfo::pixmapUpdated, this, &CardInfoPictureWidget::updatePixmap);
}
updatePixmap();