mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
use a signal instead of calling QMetaObject::invokeMethod
This commit is contained in:
parent
922e98af67
commit
a9ffbf5d2d
2 changed files with 5 additions and 1 deletions
|
|
@ -549,6 +549,8 @@ DeckEditorSettingsPage::DeckEditorSettingsPage()
|
||||||
connect(priceTagSource0, SIGNAL(toggled(bool)), this, SLOT(radioPriceTagSourceClicked(bool)));
|
connect(priceTagSource0, SIGNAL(toggled(bool)), this, SLOT(radioPriceTagSourceClicked(bool)));
|
||||||
connect(priceTagSource1, SIGNAL(toggled(bool)), this, SLOT(radioPriceTagSourceClicked(bool)));
|
connect(priceTagSource1, SIGNAL(toggled(bool)), this, SLOT(radioPriceTagSourceClicked(bool)));
|
||||||
|
|
||||||
|
connect(this, SIGNAL(priceTagSourceChanged(int)), settingsCache, SLOT(setPriceTagSource(int)));
|
||||||
|
|
||||||
QGridLayout *generalGrid = new QGridLayout;
|
QGridLayout *generalGrid = new QGridLayout;
|
||||||
generalGrid->addWidget(priceTagsCheckBox, 0, 0);
|
generalGrid->addWidget(priceTagsCheckBox, 0, 0);
|
||||||
generalGrid->addWidget(priceTagSource0, 1, 0);
|
generalGrid->addWidget(priceTagSource0, 1, 0);
|
||||||
|
|
@ -582,7 +584,7 @@ void DeckEditorSettingsPage::radioPriceTagSourceClicked(bool checked)
|
||||||
if(priceTagSource1->isChecked())
|
if(priceTagSource1->isChecked())
|
||||||
source=1;
|
source=1;
|
||||||
|
|
||||||
QMetaObject::invokeMethod( settingsCache, "setPriceTagSource", Qt::QueuedConnection, Q_ARG(int, source));
|
emit priceTagSourceChanged(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessagesSettingsPage::MessagesSettingsPage()
|
MessagesSettingsPage::MessagesSettingsPage()
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,8 @@ public:
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
private slots:
|
private slots:
|
||||||
void radioPriceTagSourceClicked(bool checked);
|
void radioPriceTagSourceClicked(bool checked);
|
||||||
|
signals:
|
||||||
|
void priceTagSourceChanged(int _priceTagSource);
|
||||||
private:
|
private:
|
||||||
QCheckBox *priceTagsCheckBox;
|
QCheckBox *priceTagsCheckBox;
|
||||||
QRadioButton *priceTagSource0, *priceTagSource1;
|
QRadioButton *priceTagSource0, *priceTagSource1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue