4

When using the Meego Touch Framework, the standard MApplicationWindow has the common navigation bar (with the switcher, 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 a blank window with a menu bar that looks similar to this (eg. the switcher button, menu and close button along the top).

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

carbin
  • 2,907
  • 2
  • 28
  • 36
  • 3
    @Andrejs Cainikovs: MeeGo is still being supported by small company that you probably haven't heard of, I can't remember their name though. I think it's something like 'Intel'. – carbin Feb 25 '11 at 15:36
  • 2
    Yes, that's the Mom. But Dad is gone! – Andrejs Cainikovs Feb 25 '11 at 20:36
  • @Andrejs Cainikovs: I think you should again think on your thoughts. – Vikas Patidar Mar 01 '11 at 08:21
  • @Vikas Patidar: I think you should read on what happened between Nokia and Intel, and only then start arguing to the people who actually works in this area. – Andrejs Cainikovs Mar 01 '11 at 09:28
  • @Andrejs Cainikovs: If you did "actually work in this area" you would know Intel is still developing Meego and finding a new mobile partner for it and that Nokia is still releasing a Meego phone this year. It is far from dead and still a good platform to develop for. – carbin Mar 03 '11 at 18:40
  • @Glass: I didn't tell anything bad about it. Yes, Nokia will release the one and only phone based on Meego. Honestly, Meego is far better than what Nokia had before. I am just laughing about this ridiculous situation. – Andrejs Cainikovs Mar 04 '11 at 08:47

2 Answers2

1

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

The main view should be a window class that would hold the navigation bar widget on top of a QVBoxLayout, and the actual content below it. The bottom index would have a stretch factor to it, so that the upper index would always be at the top.

I don't quite remember how the Meego handset UX should act like, but that's how I would create a similar looking navigation bar.

Gerstmann
  • 5,368
  • 6
  • 37
  • 57
  • Why the downvote on my answer? Perhaps an explanation what was wrong with it? – Gerstmann Feb 23 '11 at 19:08
  • 1
    +1 to even it out. Considering there isn't really a question being asked here your general suggestion for a possible implementation is fine. – AJG85 Feb 24 '11 at 22:20
1

I would just go with the QMainWindow class, as this class already has menus, toolbars, statusbar aso.
You should however take care of the orientation switching yourself (I see that the toolbar in portrait mode is at the bottom, while in landscape mode it is on the top).
This could be accomplished by setting the right Qt::ToolbarArea value.

The style of the buttons and the window itself, can be set using a Qt stylesheet.

Kurt Pattyn
  • 2,758
  • 2
  • 30
  • 42