How can I pass the QProcess Pointer to the constructor?
I tried to use a getter function but the UI still crashes when I write to the process from control_window. I've put the getter function in the header of configuration_window.
configuartion window header:
#ifndef CONFIGURATION_WINDOW_H
#define CONFIGURATION_WINDOW_H
#include <QMainWindow>
#include <QProcess>
class version_selection;
class control_window;
namespace Ui {
class configuration_window;
}
{
Q_OBJECT
public:
explicit configuration_window
(QWidget *parent
= 0);
~configuration_window();
void send_input_to_server();
{
return m_opc_ua_server;
}
{
m_opc_ua_server = server;
}
private slots:
void on_configuration_window_Exit_clicked();
void on_configuration_window_Back_clicked();
void on_configuration_window_Start_clicked();
private:
Ui::configuration_window *ui;
version_selection *m_version_selection;
control_window *m_control_window;
};
#endif // CONFIGURATION_WINDOW_H
#ifndef CONFIGURATION_WINDOW_H
#define CONFIGURATION_WINDOW_H
#include <QMainWindow>
#include <QProcess>
class version_selection;
class control_window;
namespace Ui {
class configuration_window;
}
class configuration_window : public QMainWindow
{
Q_OBJECT
public:
explicit configuration_window(QWidget *parent = 0);
~configuration_window();
void send_input_to_server();
QProcess *get_process()
{
return m_opc_ua_server;
}
void set_process(QProcess *server)
{
m_opc_ua_server = server;
}
private slots:
void on_configuration_window_Exit_clicked();
void on_configuration_window_Back_clicked();
void on_configuration_window_Start_clicked();
private:
Ui::configuration_window *ui;
version_selection *m_version_selection;
control_window *m_control_window;
QProcess *m_opc_ua_server;
};
#endif // CONFIGURATION_WINDOW_H
To copy to clipboard, switch view to plain text mode
Bookmarks