[Qt-interest] QStateMachine without MainWindow
Bo Thorsen
bo at fioniasoftware.dk
Tue May 10 13:45:50 CEST 2011
Den 10-05-2011 09:17, Mandeep Sandhu skrev:
> On Tue, May 10, 2011 at 3:50 AM,<emmanuel_mayssat at lynceantech.com> wrote:
>> The only way I found to generate QEvent from a terminal is to use
>> 1/ a timer
>> 2/ stateMachine.postEvent(...)
>>
>> Is there a way to have a Qt application read from the terminal?
>> It seems that the raw_input command doesn't work as the event handler is done by QApplication...
>>
>> Q: Is there a way to bypass the QApplication event handler?
>> Q: If not is there a way other than those described about (which are non interactive) to generate events?
>
> How about using signals (native OS signals, not Qt signals). You can
> install a signal handler in your Qt app and react to the signal sent
> from outside the app.
Why do you insist on a Qt solution for this? Just read it with standard
C or C++ code. If you need to have the Qt event loop running, then do
the reading in a thread and set up queued signals for sending the chars
to other threads.
Just because Qt is a *very* big hammer, not all problems are nails :)
Bo Thorsen,
Fionia Software.
--
Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk
More information about the Qt-interest-old
mailing list