[Qt-interest] State Machine implementation

Tibo W tibo_wcc at yahoo.com
Tue Feb 1 23:33:23 CET 2011


Hi,

I'm working on an application for an embedded platform, and I have some questions regarding the implementation.

I think it's a pretty simple application, but I'd like to use a Qt approach and use most of its benefits.


description:
- the application read a XML config file
- the XML file describes how many (independent) windows are required, and home many icons will be displayed in each window
- each window will be displayed on a different (touch) screen, and will display icons
- when the user will click on an icon, it will start an application (replace the current display by the application's content)
- everything is displayed using OpenGL

There's an existing implementation, but it's not optimized and it handles only one window.
And I'd like to reimplement everything using a state machine.

Here are my questions:
1) how to handle multiple windows ?
 - create as many QMainWindow as required and use show() to display them ?
 - how about the QGraphicsScene ? Each window should be in a different scene ?

2) regarding the state machine, I'm not sure how to implement it...
 - each state should contains what I want to display ?
   ie I will have a displayState class which inherits from QState (or QAbsctractState ?) and the onEntry() will show the objects I want to display ?
 - or I create what I want to display somewhere, and use the state machine on those objects to display them ?
   Like in the Qt example, they create a QPushButton, and the states are linked to the button and its signals.

 
I have more questions regarding the state machine (like QSignalTransition and stuff), and about QML-3D, but I think I'll start with that :)

Thanks for your help !
cheers


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110201/5ec5e0ea/attachment.html 


More information about the Qt-interest-old mailing list