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:
  1. #ifndef CONFIGURATION_WINDOW_H
  2. #define CONFIGURATION_WINDOW_H
  3.  
  4. #include <QMainWindow>
  5. #include <QProcess>
  6.  
  7. class version_selection;
  8. class control_window;
  9.  
  10. namespace Ui {
  11. class configuration_window;
  12. }
  13.  
  14. class configuration_window : public QMainWindow
  15. {
  16. Q_OBJECT
  17.  
  18. public:
  19. explicit configuration_window(QWidget *parent = 0);
  20. ~configuration_window();
  21.  
  22. void send_input_to_server();
  23.  
  24. QProcess *get_process()
  25. {
  26. return m_opc_ua_server;
  27. }
  28. void set_process(QProcess *server)
  29. {
  30. m_opc_ua_server = server;
  31. }
  32.  
  33. private slots:
  34. void on_configuration_window_Exit_clicked();
  35.  
  36. void on_configuration_window_Back_clicked();
  37.  
  38. void on_configuration_window_Start_clicked();
  39.  
  40. private:
  41. Ui::configuration_window *ui;
  42.  
  43. version_selection *m_version_selection;
  44.  
  45. control_window *m_control_window;
  46.  
  47. QProcess *m_opc_ua_server;
  48. };
  49.  
  50. #endif // CONFIGURATION_WINDOW_H
To copy to clipboard, switch view to plain text mode