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. Float data to a slot
Forum Updated to NodeBB v4.3 + New Features

Float data to a slot

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 779 Views 1 Watching
  • 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 Offline
    L Offline
    lihakimpale
    wrote on last edited by
    #1

    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
    0

    • Login

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