hello,
So I explain, I did several tests to display a random value in a LineEdit Here is what the window looks like: (I'm with QMainWindow)
Capture.PNG
Then the .cpp and .h:
.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
{
Q_OBJECT
public:
explicit MainWindow
(QWidget *parent
= 0);
~MainWindow();
private:
Ui::MainWindow *ui;
private slots:
void Statut_Changed(int value);
};
#endif // MAINWINDOW_H
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
private slots:
void Statut_Changed(int value);
};
#endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode
.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::Statut_Changed(int value)
{
value = 50;
ui->lineEdit->setText(value);
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::Statut_Changed(int value)
{
value = 50;
ui->lineEdit->setText(value);
}
To copy to clipboard, switch view to plain text mode
I would like to display the desired value in the LineEdit and once done, create a connection between QwtTHermo and LineEdit.
For example, by setting the value 50, I would like this value to be displayed in the lineEdit and also displayed in QwtThermo
Do you have an idea ?
Already to display the value in lineEdit
Thank you for your help
Bookmarks