Try m_opc_ua_server->state() == QProcess::Running instead.
Try m_opc_ua_server->state() == QProcess::Running instead.
I write the best type of code possible, code that I want to write, not code that someone tells me to write!
Max Fleischer (10th March 2017)
Thanks, that's working.
Great, also, to "share" the QProcess with other classes, either pass the QProcess pointer to the other class' constructor or create a getter method in the class that creates/owns the QProcess, for example:
Qt Code:
{ return m_opc_ua_server; }To copy to clipboard, switch view to plain text mode
I write the best type of code possible, code that I want to write, not code that someone tells me to write!
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:
Qt Code:
#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: ~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; QProcess *m_opc_ua_server; }; #endif // CONFIGURATION_WINDOW_HTo copy to clipboard, switch view to plain text mode
Bookmarks