Bad use of signal / slot in 9X simulator
This commit is contained in:
@@ -118,7 +118,8 @@ SimulatorDialog9X::SimulatorDialog9X(QWidget * parent, SimulatorInterface *simul
|
|||||||
ui->trimVL_U->setText(QString::fromUtf8(upArrow));
|
ui->trimVL_U->setText(QString::fromUtf8(upArrow));
|
||||||
ui->trimVL_D->setText(QString::fromUtf8(downArrow));
|
ui->trimVL_D->setText(QString::fromUtf8(downArrow));
|
||||||
for (int i=0; i<pots.count(); i++) {
|
for (int i=0; i<pots.count(); i++) {
|
||||||
connect(pots[i], SIGNAL(valueChanged(int)), this, SLOT(dialChanged(i)));
|
pots[i]->setProperty("index", i);
|
||||||
|
connect(pots[i], SIGNAL(valueChanged(int)), this, SLOT(dialChanged(int)));
|
||||||
}
|
}
|
||||||
connect(ui->cursor, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
connect(ui->cursor, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
||||||
connect(ui->menu, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
connect(ui->menu, SIGNAL(buttonPressed(int)), this, SLOT(onButtonPressed(int)));
|
||||||
@@ -241,9 +242,10 @@ void SimulatorDialog::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimulatorDialog::dialChanged(int index)
|
void SimulatorDialog9X::dialChanged(int value)
|
||||||
{
|
{
|
||||||
potValues[index]->setText(QString("%1 %").arg((pots[index]->value()*100)/1024));
|
int index = sender()->property("index").toInt();
|
||||||
|
potValues[index]->setText(QString("%1 %").arg((value*100)/1024));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimulatorDialog::wheelEvent (QWheelEvent *event)
|
void SimulatorDialog::wheelEvent (QWheelEvent *event)
|
||||||
|
|||||||
@@ -131,7 +131,6 @@ class SimulatorDialog : public QDialog
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onButtonPressed(int value);
|
void onButtonPressed(int value);
|
||||||
void dialChanged(int index);
|
|
||||||
void on_FixRightY_clicked(bool checked);
|
void on_FixRightY_clicked(bool checked);
|
||||||
void on_FixRightX_clicked(bool checked);
|
void on_FixRightX_clicked(bool checked);
|
||||||
void on_FixLeftY_clicked(bool checked);
|
void on_FixLeftY_clicked(bool checked);
|
||||||
@@ -173,6 +172,9 @@ class SimulatorDialog9X: public SimulatorDialog
|
|||||||
void saveSwitches(void);
|
void saveSwitches(void);
|
||||||
void restoreSwitches(void);
|
void restoreSwitches(void);
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
void dialChanged(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SimulatorDialog9X * ui;
|
Ui::SimulatorDialog9X * ui;
|
||||||
static uint32_t switchstatus;
|
static uint32_t switchstatus;
|
||||||
|
|||||||
Reference in New Issue
Block a user