Update yAxis->setLabel() from another button.
Unsolved
General and Desktop
-
I need update yAxis->setLabel() on my qcustomplot.
When user push celsius button. label should update as "C" when user push Fahrenheit buttonç label should update as "F".how can I do that? Here is my code I tried.
void MainWindow::on_celsiusBtn_clicked() { ui->widgetChart->yAxis->setLabel("C"); } void MainWindow::on_fahrenheitBtn_clicked() { ui->widgetChart->yAxis->setLabel("F"); }
-
I need update yAxis->setLabel() on my qcustomplot.
When user push celsius button. label should update as "C" when user push Fahrenheit buttonç label should update as "F".how can I do that? Here is my code I tried.
void MainWindow::on_celsiusBtn_clicked() { ui->widgetChart->yAxis->setLabel("C"); } void MainWindow::on_fahrenheitBtn_clicked() { ui->widgetChart->yAxis->setLabel("F"); }
@mangekoyu
And? Code to update the buttons looks fine.... -
- Have you put a
qDebug()
statement into each one to see whether it is being called? That is the first thing to do. - Have you done a
connect()
statement to connect buttons to these slots? - Or, are you relying on auto-connection-by-name-of-slot-method?
- Have you put a