Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Float data to a slot

    General and Desktop
    1
    1
    655
    Loading More Posts
    • 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.
    • L
      lihakimpale last edited by

      I am new to GUI development and I am also quite newbie in C++ so I have no clue how to do this.

      Here is my code:

      @#include "mainwindow.h"
      #include "ui_mainwindow.h"

      extern "C"{
      #include "defines.h"
      #include "tft.h"
      #include "RAI8870.h"
      #include "bmp.h"
      #include "examples.h"
      }

      MainWindow::MainWindow(int *c_ptr, QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
      {
      ui->setupUi(this);

      struct Measurement_Data *m_Data = (struct Measurement_Data*)malloc(sizeof(struct Measurement_Data));
      
      m_Data = L2CAP_server(c_ptr);
      
      void on_TempButton_clicked(m_Data->temp);
      

      }

      MainWindow::~MainWindow()
      {
      delete ui;
      }

      void MainWindow::on_TempButton_clicked(float temp)
      {
      unsigned char txt[10] = { 0 };

      ui->lcdNumber->display(temp);
      

      }

      void MainWindow::on_HumButton_clicked()
      {

      }

      void MainWindow::on_PresButton_clicked()
      {

      }

      void MainWindow::on_pushButton_4_clicked()
      {
      ui->lcdNumber->display(0);
      RAIO_clear_screen();
      }

      void MainWindow::on_lcdNumber_overflow()
      {

      }@

      I have three measuring data which I store to that m_Data structure which has members temp, humi and pressure. I am trying to get that code working so that when I for example press that TempButton it prints temperature value to the LCD widget and when I press HumButton it prints humidity value to the LCD widget and so on.. I would be very thankful if someone could show me how to do this with one slot so that I could continue by my own.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post