Hello,
i developed an application that using menus , but these menus does not appear with the native Maemo menu theme.
how can i display my menus using Native Maemo theme?
Hello,
i developed an application that using menus , but these menus does not appear with the native Maemo menu theme.
how can i display my menus using Native Maemo theme?
Hi,
Maemo5 menus are supported by all Qt packages available.
Qt 4.6 tech preview2 as well as next Qt 4.5.3 packages (version 4.5.3-xxxxx-maemo6)
have maemo5 menus enabled by default.
Current Qt 4.5.3 packages doesn't have Maemo5 menus enabled by default.
Qt 4.5.3 shows Maemo5 menu ONLY if QActions are in a menu called "fremantle".
Eg:
You can create a Menu structure like this:
-File
* Open
* Close
-Edit
* Copy
* Paste
-Fremantle
* Action1
* Action2
In this case Qt 4.5.3 will show a Maemo5 menu with Action1 and Action2.
Actions in File and Edit menu won't be shown at all.
Antonio
thanks alot ,i made a menu called (Fremantle)and then i get the menu like maemo menus.
thanks thanks thanks
execuse me antoher thing please,
when i set the style sheet of the mainwindow backgrouned , the menu take the style sheet of the mainwindow background.
i tried to not set the menu parent but it still appear with the parent style.
there is a solution?
Menu is a window parented to the application window. Here is a test application which colors two windows in different colors:
Code:#include <QApplication> #include <QMainWindow> int main (int argc, char **argv) { QApplication app(argc, argv); app.setStyleSheet("QMainWindow { background-color: yellow }\ QMainWindow#main { background-color: green }"); QMainWindow win1; QMainWindow win2(&win1); win1.setObjectName("main"); win1.show(); win2.show(); return app.exec(); }
I used your code ,the code works fine
but when i used the following code
the menus does not appear at all .Code:#include <QApplication> #include <QMainWindow> #include <QMenuBar> #include <QMenu> int main (int argc, char **argv) { QApplication app(argc, argv); app.setStyleSheet("QMainWindow { background-color: yellow }\ QMainWindow#main { background-color: green }"); QMainWindow win1; QMainWindow win2(&win1); win1.setObjectName("main"); QMenuBar menuBar(&win1); QMenu menu("Fremantle",&menuBar); QAction action("hello", &menu); menu.addAction(&action); menuBar.addMenu(&menu); // menuBar.setStyleSheet("background-image: url();"); win1.show(); win2.show(); return app.exec(); }
listen , My main problem is to set background image for the main window but the menus
must still appear in native maemo theme.
there is a solution?
note:
when i set the style sheet of the background to image, the menus take the same image.
thank you.
You don't need to create another QMenuBar.
Code:#include <QApplication> #include <QMainWindow> #include <QMenuBar> #include <QMenu> int main (int argc, char **argv) { QApplication app(argc, argv); /* Ukrainian-style colour scheme */ app.setStyleSheet("QMainWindow { background-color: blue }" \ "QMenuBar { background-color: red }" \ "QMenu { background-color: yellow }"); QMainWindow win; QMenu menu("Fremantle"); menu.addAction("Action"); win.menuBar()->addMenu(&menu); win.show(); return app.exec(); }
Last edited by divanov; 2009-12-23 at 11:33.