comparison libgui/src/octave-main-thread.h @ 17918:a38cee8f0a9b

derive octave_main_thread from QObject, not QThread * main-window.h, main-window.cc (main_window::_octave_main_thread): Delete member variable and all uses. * libgu/src/module.mk (octave_gui_MOC): Include src/moc-octave-main-thread.cc in the list. * octave-main-thread.h, octave-main-thread.cc (octave_main_thread::run): Delete. (octave_main_thread::execute): Rename from octave_main_thread::run. (class octave_main_thread): Derive from QObject, not QThread. * octave-qt-link.h, octave-qt-link.cc (octave_qt_link::octave_interpreter): New member variable. (octave_qt_link::main_thread): Now a pointer to a QThread object. (octave_qt_link::execute_interpreter_signal): New signal. (octave_qt_link::octave_qt_link): Create thread and octave_interpreter object here instead of accepting thread as argument. Move octave_interpreter to the main_thread object and connect the execute_interpreter signal to the corresponding slot.
author John W. Eaton <jwe@octave.org>
date Tue, 12 Nov 2013 12:36:30 -0500
parents d63878346099
children
comparison
equal deleted inserted replaced
17917:c9f622fd7307 17918:a38cee8f0a9b
22 */ 22 */
23 23
24 #ifndef OCTAVEMAINTHREAD_H 24 #ifndef OCTAVEMAINTHREAD_H
25 #define OCTAVEMAINTHREAD_H 25 #define OCTAVEMAINTHREAD_H
26 26
27 #include <QThread> 27 #include <QObject>
28 28
29 /** 29 /**
30 * \class octave_main 30 * \class octave_main
31 * \brief This class represents a thread just running octave_main. 31 * \brief This class represents a thread just running octave_main.
32 * \author Jacob Dawid 32 * \author Jacob Dawid
33 */ 33 */
34 class octave_main_thread : public QThread 34 class octave_main_thread : public QObject
35 { 35 {
36 Q_OBJECT
37
36 public: 38 public:
39
37 // Create a new thread for running the octave interpreter. 40 // Create a new thread for running the octave interpreter.
38 octave_main_thread (void) : QThread () { } 41
42 octave_main_thread (void) : QObject () { }
43
44 public slots:
39 45
40 // Start the thread and initialize and execute the octave 46 // Start the thread and initialize and execute the octave
41 // interpreter. 47 // interpreter.
48
42 void execute_interpreter (void); 49 void execute_interpreter (void);
43
44 protected:
45 // Avoid exec. Run the octave interpreter in the new thread.
46 void run (void);
47 }; 50 };
48 51
49 #endif // OCTAVEMAINTHREAD_H 52 #endif // OCTAVEMAINTHREAD_H