General Guidance on Organizing a Touch Screen Program
-
Hey guys, I'm new to Qt. And still fairly new to object oriented programming to be honest. I'm wanting to write a touch screen application for my house (I love home automation). Learning the API just requires me to study the examples and docs, then search the net if I get stuck. So I probably won't have much trouble there.
What I'm having trouble figuring out is how "layering" works, or better yet, the best way to approach my problem. Let me give you an example. Let's say I have a home screen that displays 6 icons on the touch screen. When you click/touch an icon, the current screen is wiped clean and that "sub page" is shown. Then you can click/touch the home button and again the screen is wiped and you are back at the home screen with the 6 icons again. Sounds simple enough, right?
Well, I'm having trouble with that concept. From what little I've learned, I think I should be using QGraphicsView as the main window, followed by a scene and then objects in that scene.
So if that's correct, then am I on the right track with the following?:
Create the QApplication.
Create the view with QGraphicsView.
Create the scene (for example, the home page) with QGraphicsScene
Add objects (images/icons to touch) using QGraphicsObject that is overridden so I can get events from it.Then, once an icon is clicked on the home page, you remove/delete/(or just hide?) the home page scene and create the new scene for the sub-page (like a music player interface or something). Then add the new objects to it.
Then, once the home button is pressed, remove/delete/(or just hide?) the "sub page" scene and show the home page scene again.
Am I on the right track here? Thanks for any input. :o)
-
I recommend you QtQuick for this purposes. It is QGraphicsView-based, but allows you to create animations, transitions (like screen transitions) , drag and drop and so on much easier.