How to add a general navigation bar to a Meego app?

When using the Meego Touch Framework, the standard MApplicationWindow has a common navigation bar (with a switch, menu, and close buttons) already attached.

For example, the following code:

 #include <MApplication> #include <MApplicationWindow> int main(int argc, char *argv[]){ MApplication app(argc, argv); MApplicationWindow w; w.show(); return app.exec(); } 

Creates an empty window with a menu bar that looks similar to this (for example, a toggle button, menu, and close button at the top).

However, since docs prevent the use of the Touch Framework, I want to avoid using it, so how would I create a similar window view using only the standard API ?

+4
source share
2 answers

How to implement this would probably be a fixed height, a variable width QHBoxLayout with a stretch factor for those indices that need it. Then I just used QPushButton and QCombobBox for widgets and ended them with a special stylesheet and icons. I would then wrap them inside a neat little custom widget that I could reuse in my main view class.

The main view should be the window class that will contain the navigation bar widget on top of the QVBoxLayout and the actual content below it. The subscript will have a stretch factor, so the superscript will always be at the top.

I don’t quite remember how the UX Meego UX should work, but the way I would have created a similar navigation bar.

+1
source

I would just go with the QMainWindow class, since this class already has menus, toolbars, a status bar. However, you should take care of switching the orientation (I see that the toolbar in portrait mode is at the bottom, and in landscape mode at the top).
This can be done by setting the correct Qt :: ToolbarArea.

The style of the buttons and the window itself can be set using the Qt style sheet.

+1
source

Source: https://habr.com/ru/post/1340538/


All Articles