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.

Update yAxis->setLabel() from another button.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 273 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.
  • mangekoyuM Offline
    mangekoyuM Offline
    mangekoyu
    wrote on 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");
    
    }
    
    JonBJ 1 Reply Last reply
    0
    • mangekoyuM mangekoyu

      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");
      
      }
      
      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • mangekoyuM Offline
        mangekoyuM Offline
        mangekoyu
        wrote on last edited by
        #3

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

        JonBJ 1 Reply Last reply
        0
        • mangekoyuM mangekoyu

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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on 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

          • Login

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