Mercurial > octave-dspies
view 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 |
line wrap: on
line source
/* Copyright (C) 2013 John W. Eaton Copyright (C) 2011-2013 Jacob Dawid This file is part of Octave. Octave is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. Octave is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Octave; see the file COPYING. If not, see <http://www.gnu.org/licenses/>. */ #ifndef OCTAVEMAINTHREAD_H #define OCTAVEMAINTHREAD_H #include <QObject> /** * \class octave_main * \brief This class represents a thread just running octave_main. * \author Jacob Dawid */ class octave_main_thread : public QObject { Q_OBJECT public: // Create a new thread for running the octave interpreter. octave_main_thread (void) : QObject () { } public slots: // Start the thread and initialize and execute the octave // interpreter. void execute_interpreter (void); }; #endif // OCTAVEMAINTHREAD_H