Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Update yAxis->setLabel() from another button.
Forum Updated to NodeBB v4.3 + New Features

Update yAxis->setLabel() from another button.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 275 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mangekoyu
    wrote on 5 Jul 2022, 14:17 last edited by
    #1

    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");
    
    }
    
    J 1 Reply Last reply 5 Jul 2022, 14:18
    0
    • M mangekoyu
      5 Jul 2022, 14:17

      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");
      
      }
      
      J Offline
      J Offline
      JonB
      wrote on 5 Jul 2022, 14:18 last edited by
      #2

      @mangekoyu
      And? Code to update the buttons looks fine....

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mangekoyu
        wrote on 5 Jul 2022, 14:21 last edited by
        #3

        There is no update. When I click to button I can not see any changes

        J 1 Reply Last reply 5 Jul 2022, 14:23
        0
        • M mangekoyu
          5 Jul 2022, 14:21

          There is no update. When I click to button I can not see any changes

          J Offline
          J Offline
          JonB
          wrote on 5 Jul 2022, 14:23 last edited by
          #4

          @mangekoyu

          • 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?
          1 Reply Last reply
          0

          1/4

          5 Jul 2022, 14:17

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved