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. |
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 |
Re: Qt and Hildon menu
Please, can you give me some example?
|
Re: Qt and Hildon menu
Quote:
Code:
action1 = new QAction(tr("&ACTION1"), this); |
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(); |
Re: Qt and Hildon menu
Quote:
|
Re: Qt and Hildon menu
Sorry I did it too late :)
|
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. |
Re: Qt and Hildon menu
I dont understand what is menu?
|
Re: Qt and Hildon menu
Quote:
ive added more details to my previous post above |
Re: Qt and Hildon menu
Thank you, but it still doesnt work.
Code:
QAction *action1 = new QAction(tr("&ACTION1"), this); |
Re: Qt and Hildon menu
what doesnt work, what error do you see , could you please detail so you can solicit some responses.
|
Re: Qt and Hildon menu
It doesnt work because I cant see any menu on the top. Any errors.
|
Re: Qt and Hildon menu
is this all done in a QMainWindow ?
attach the source file if you can. |
Re: Qt and Hildon menu
This is full code.
Code:
class Window : public QMainWindow |
Re: Qt and Hildon menu
making corrections ...
Code:
class Window : public QMainWindow |
Re: Qt and Hildon menu
Thank you. I didnt setCentraWidget.
|
Re: Qt and Hildon menu
Hi krk969!
I'm also new to Maemo and Qt. I tried creating a window with your code. It works, but there is a side effect: When I run the application, two menu items appear, with the name "MENU TITLE / ACTION1" and "MENU TITLE / ACTION2". This is understandable, but what do I do if I don't want the slash signs to appear there? |
Re: Qt and Hildon menu
replace
appMenu = menuBar()->addMenu(tr("MENU TITLE")); with appMenu = menuBar()->addMenu(tr("")); i dont know what i did but my previous post got replaced with this message too. but i guess you will figure it out :) |
Re: Qt and Hildon menu
Thanks!
IT WORKS! :) Now it is nice that this works from code, but is there any way in the UI designer to do this? (I mean the UI designer of Qt Creator for Windows. I use MADDE.) |
Re: Qt and Hildon menu
Quote:
Im sure there is, I will try it in the UI designer when I have sometime and let you know if you somebody else doesnt reply. |
Re: Qt and Hildon menu
Thanks!
I tried it but if I remove the caption, the menu won't appear. However, your solution suits my needs, so it is enough. By the way, how do I change the title of the dialog box which appears when I click on a QComboBox? |
Re: Qt and Hildon menu
Quote:
here's an example ( may not compile straightaway , but to give you an idea ) Code:
// the data model , which contains your list data |
Re: Qt and Hildon menu
Actually, MADDE doesn't support Qt 4.6 yet, so I'm using 4.5...
|
Re: Qt and Hildon menu
http://labs.trolltech.com/blogs/2010...so-on-windows/
besides AFAIK QT4.5 is already history. You will see it completely gone in a few days. PR1.2 SDK is out which has QT4.6 by default, even the autobuilder is now supporting QT4.6. |
Re: Qt and Hildon menu
Very nice, thank you!
I will check it out soon. However, the name "QMaemo5ValueButton" doesn't suggest too much portability to me. |
Re: Qt and Hildon menu
Is there a way of having the "old style" menu still in QT 4.6? Porting some applications is very tricky when all normal menuitems are translated into hildon menuitems automatically (very many items in the list --> unusable).
So is there an easy way to prevent this: http://i2.aijaa.com/b/00876/6016140.jpg |
Re: Qt and Hildon menu
Quote:
I also use MADDE. In the Qt Designer you can add a menu bar to your main window by right clicking on it (in the "object/class window") and selecting menu bar. Then it will show up in the wysiwyg window. There you can change the "type here" to something valid and get your menu. In that "drop down" menu you, you have to fill in some names. If I take the examples above it would be "Action1" and "Action2". The resulting action will be called like actionAction1 actionAction2, or so, which you than can use. I hope this can be somehow understood (without graphics ^^). |
Re: Qt and Hildon menu
Quote:
Put the other functionality elsewhere - this is also required if you want your app to be finger-friendly, anyways. Quote:
Since then, I already discovered this. But it is nice from you to answer. |
Re: Qt and Hildon menu
Does somebody know some code to open the menubar automatically?
Or a way to update and repaint an open menubar? I could implement a qpushbutton into the menu which lets the menu open when pressed and it should change some actions from the menu. It all does what I want but the result can only be seen by closing and reopen the menu again. I also tried to update and repaint parent widgets with no success. In qt desktop version it is working:mad: [edit]: So it looks like that this menu belongs to the WM, so I had to make a workaround with X11. |
All times are GMT. The time now is 21:12. |
vBulletin® Version 3.8.8