rubikon
20th July 2012, 11:29
Hello.
I want to separate the business-logic of my application from the GUI. So I can easily implement a GUI for desktop PCs and PC with touchscreens (or some other devices in the future).
As most applications my application should have some kind of main menu. This main menu should be able change (quite often), depending on some conditions.
The desktop GUI should just use QMenuBar and my touch GUI should use a custom widget which I wrote. This is basically a bar with large tool buttons which contains texts like 'file', 'edit' and so on and up popping bars which contains the corresponding 'subitems' like 'new', 'save', 'close'...
My idea is to provide the current main menu as model (because the menu can change) and the GUI displays it as view. Is this possible?
I guess I have to inherit from QAbstractTableModel for my model, from QAbstractItemView and QMenuBar for my desktop view and from QAbstractItemView for my touchscreen view. Is this idea correct? Can someone give me a ruff roadmap how to achieve model/view -> menu connection?
Sorry for this basic questions. I'm absolutely new to the model/view concept.
I want to separate the business-logic of my application from the GUI. So I can easily implement a GUI for desktop PCs and PC with touchscreens (or some other devices in the future).
As most applications my application should have some kind of main menu. This main menu should be able change (quite often), depending on some conditions.
The desktop GUI should just use QMenuBar and my touch GUI should use a custom widget which I wrote. This is basically a bar with large tool buttons which contains texts like 'file', 'edit' and so on and up popping bars which contains the corresponding 'subitems' like 'new', 'save', 'close'...
My idea is to provide the current main menu as model (because the menu can change) and the GUI displays it as view. Is this possible?
I guess I have to inherit from QAbstractTableModel for my model, from QAbstractItemView and QMenuBar for my desktop view and from QAbstractItemView for my touchscreen view. Is this idea correct? Can someone give me a ruff roadmap how to achieve model/view -> menu connection?
Sorry for this basic questions. I'm absolutely new to the model/view concept.