Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User mismael's Avatar
    Join Date
    Oct 2009
    Posts
    95
    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?

  2. #2
    Registered User mismael's Avatar
    Join Date
    Oct 2009
    Posts
    95
    anybody?
    please help!

  3. #3
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by mismael View Post
    anybody?
    please help!
    You need to install Qt 4.5.3 maemo6, which is the latest version of Maemo Qt community port.

  4. #4
    Nokia Developer Moderator gnuton's Avatar
    Join Date
    Mar 2009
    Posts
    1,024
    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

  5. #5
    Registered User mismael's Avatar
    Join Date
    Oct 2009
    Posts
    95
    thanks alot ,i made a menu called (Fremantle)and then i get the menu like maemo menus.
    thanks thanks thanks

  6. #6
    Registered User mismael's Avatar
    Join Date
    Oct 2009
    Posts
    95
    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?

  7. #7
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by mismael View Post
    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();
    }

  8. #8
    Registered User mismael's Avatar
    Join Date
    Oct 2009
    Posts
    95
    I used your code ,the code works fine
    but when i used the following code
    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();
    }
    the menus does not appear at all .
    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.

  9. #9
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by mismael View Post
    the menus does not appear at all .
    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.

Similar Threads

  1. Qt for Symbian development resources
    By liuxg in forum [Archived] Qt General ( Qt技术)
    Replies: 55
    Last Post: 2011-01-26, 04:06
  2. Some basic questions for QT with Maemo
    By smehta_ce in forum Nokia N9
    Replies: 5
    Last Post: 2009-12-18, 12:21
  3. kinetic scrolling
    By stalep in forum Nokia N9
    Replies: 10
    Last Post: 2009-12-08, 12:41
  4. Welcome to Qt for maemo
    By Nokia Ron in forum Nokia N9
    Replies: 0
    Last Post: 2009-08-31, 19:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved