maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Qt and Hildon menu (https://talk.maemo.org/showthread.php?t=34567)

hopbeat 2009-11-16 13:53

Qt and Hildon menu
 
Hello,

can someone tell me, how to get the menu, that appears from the top (for example when pressing clock in standby mode)?

QMenuBar is creating ad different style menu.
I'm using Qt 4.5 and Maemo 5.

attila77 2009-11-16 14:06

Re: Qt and Hildon menu
 
Depends on the actual build. A while ago you had to define a property o the QActions in it, nowadays it's automatic.

Hildon menus

Hildon menus are supported by Qt. qt-4.5.3-xxxx-maemo4 packages needs QActions in a "fremantle" menu. Packages with version > qt-4.5.3-xxxx-maemo4 hildonize the menu automaticall.

This and many other goodies found on

http://wiki.maemo.org/Qt4Hildon

Figa 2010-03-10 12:01

Re: Qt and Hildon menu
 
Please, can you give me some example?

krk969 2010-03-10 12:07

Re: Qt and Hildon menu
 
Quote:

Originally Posted by Figa (Post 562401)
Please, can you give me some example?

Code:

action1 = new QAction(tr("&ACTION1"), this);
action2 = new QAction(tr("&ACTION2"), this);

menu = menuBar()->addMenu(tr("MENU TITLE"));
menu->addAction(action1);
menu->addAction(action2);

connect(action1, SIGNAL(triggered()), this , SLOT(doAction1()));
connect(action2, SIGNAL(triggered()), this , SLOT(doAction2()));


Figa 2010-03-10 16:40

Re: Qt and Hildon menu
 
THX I did it but I cant see any menu. What I do have to do?
Code:

QWidget *master = new QWidget();
                QAction *action1 = new QAction(tr("&ACTION1"), this);
                QAction *action2 = new QAction(tr("&ACTION2"), this);

                connect(action1, SIGNAL(triggered()), this , SLOT(doAction1()));
                connect(action2, SIGNAL(triggered()), this , SLOT(doAction2()));
                master->addAction(action1);
                master->addAction(action2);


krk969 2010-03-10 16:43

Re: Qt and Hildon menu
 
Quote:

Originally Posted by Figa (Post 562716)
THX I did it but I cant see any menu. What I do have to do?

pls attach your code so somebody can try and help :)

Figa 2010-03-10 16:56

Re: Qt and Hildon menu
 
Sorry I did it too late :)

krk969 2010-03-10 17:00

Re: Qt and Hildon menu
 
as mentioned in my post above you need to do this

QMenu *menu = menuBar()->addMenu(tr("MENU TITLE"));

on a QMainWindow object to see the menu.
and then actions need to be added to this menu object.

Figa 2010-03-10 17:03

Re: Qt and Hildon menu
 
I dont understand what is menu?

krk969 2010-03-10 17:10

Re: Qt and Hildon menu
 
Quote:

Originally Posted by Figa (Post 562733)
I dont understand what is menu?

check here
ive added more details to my previous post above


All times are GMT. The time now is 14:20.

vBulletin® Version 3.8.8