[Qt-interest] QStateMachine without MainWindow

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Tue May 10 09:17:53 CEST 2011


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.

-mandeep


>
>
> --
> E
>
> On 15:00 Wed 04 May     , emmanuel_mayssat at lynceantech.com wrote:
>>
>> Hello,
>>
>> I am interested in the QStateMachine framework.
>> I would like to run a statemachine in a terminal.
>>
>> Now I would like to generate QKeyEventTransition
>> based on what I press on the keyboard.
>>
>> state_1 --[QEvent or Signal]--> state2
>>
>> How can I generate a QKeyEventTransition if I am not using a QMainWindow?
>> In other words, how can I generate QEvents from my keyboard when using a terminal application?
>>
>> Thanks,
>>
>> --
>> Emmanuel
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at qt.nokia.com
>> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
> --
> Emmanuel
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>



More information about the Qt-interest-old mailing list