identifier and initializer errors in extracted example code
-
wrote on 7 Feb 2023, 11:23 last edited by
-
Hi,
I keep getting this error on my code, but the same lines do not give an error in the terminal example...
I have checked the other files for missed includes and the like, but I am at a dead end, whats the problem?
my code^
code in the terminal example^ -
@agmar
Show yourmainwindow.h
file, preferably as text rather than screenshot, indication wherem_serial
member is declared.wrote on 7 Feb 2023, 11:57 last edited by@JonB here it is #ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>
#include <QApplication>
#include <QLabel>
#include <QScrollArea>
#include <QVBoxLayout>
#include <QWidget>
#include <QtSerialPort/QSerialPortInfo>
#include <QtSerialPort>
#include <QLineEdit>
#include <QByteArray>#include <iostream>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACEclass MainWindow : public QMainWindow
{
Q_OBJECTsignals:
void getData(const QByteArray &data);public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
void putData(const QByteArray &data);private slots:
void sendMessage();
void inputGet();
void receiveMessage();
void readData();
void on_horizontalSlider_sliderReleased();private:
Ui::MainWindow *ui;
QLabel *label;};
#endif // MAINWINDOW_H
I know there is nothing here related to m_serial, but the terminal example has nothing as well... -
-
@JonB here it is #ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>
#include <QApplication>
#include <QLabel>
#include <QScrollArea>
#include <QVBoxLayout>
#include <QWidget>
#include <QtSerialPort/QSerialPortInfo>
#include <QtSerialPort>
#include <QLineEdit>
#include <QByteArray>#include <iostream>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACEclass MainWindow : public QMainWindow
{
Q_OBJECTsignals:
void getData(const QByteArray &data);public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
void putData(const QByteArray &data);private slots:
void sendMessage();
void inputGet();
void receiveMessage();
void readData();
void on_horizontalSlider_sliderReleased();private:
Ui::MainWindow *ui;
QLabel *label;};
#endif // MAINWINDOW_H
I know there is nothing here related to m_serial, but the terminal example has nothing as well... -
Hi,
I keep getting this error on my code, but the same lines do not give an error in the terminal example...
I have checked the other files for missed includes and the like, but I am at a dead end, whats the problem?
my code^
code in the terminal example^
1/5