×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    26

    QMenuBar bug for Maemo

    Here's my problem. For every QMainWindow I created the following connection

    QMenuBar *menu = m_window->menuBar();
    connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(menuTriggerAction(QAction*)));


    The only problem is that not every m_window has a QAction added to it, but still the menu icon is shown on the window title. On my point of view this is a bug from 4.6 version, since it was working on the previous one.

    Since I'm not sure where to post the bug, I've devided to use this forum.

    Does anyone has any suggestion on how to solve this problem, since I need to add the connection for all QMainWindow that I create??

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QMenuBar bug for Maemo

    Quote Originally Posted by romulovitor View Post
    Here's my problem. For every QMainWindow I created the following connection
    QMenuBar *menu = m_window->menuBar();
    connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(menuTriggerAction(QAction*)));
    Is the problem really related to connecting the signal? I have doubts.

    Quote Originally Posted by romulovitor View Post
    The only problem is that not every m_window has a QAction added to it, but still the menu icon is shown on the window title. On my point of view this is a bug from 4.6 version, since it was working on the previous one.
    What is the relationship between the windows?

    Quote Originally Posted by romulovitor View Post
    Does anyone has any suggestion on how to solve this problem, since I need to add the connection for all QMainWindow that I create??
    Connecting trigerred signal to menu bars without actions makes no sense, why do you have to do that?

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    26

    Re: QMenuBar bug for Maemo

    Quote Originally Posted by divanov View Post
    Is the problem really related to connecting the signal? I have doubts.
    No, the problem is not connecting the signal but when "m_window->menuBar();" is invoked. Apparently once menuBar is created, the windows title show the menu icon even when it's empty



    Quote Originally Posted by divanov View Post
    What is the relationship between the windows?
    Sorry!! Not sure what you mean.



    Quote Originally Posted by divanov View Post
    Connecting trigerred signal to menu bars without actions makes no sense, why do you have to do that?
    Here's my scenario. All my QMainWindow share the same QWebView object. I first create a new QMainWindow and then render the QWebView page using Ajax ( so there's no use of loadFinished ). The page rendered by QWebView can or cannot add a QAction to the menu, however when this happen the current window has to trigger the click event.

    A alternative for this approach would be to destroy and re-create this connection everytime a item is added to QMenu but I assume that this would be less efficient but would/could solve my problem.



    I just added this entry here because I think that a MenuBar without QActions should not be shown on the title bar.
    Last edited by romulovitor; 2010-03-02 at 21:43.

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QMenuBar bug for Maemo

    Quote Originally Posted by romulovitor View Post
    No, the problem is not connecting the signal but when "m_window->menuBar();" is invoked. Apparently once menuBar is created, the windows title show the menu icon even when it's empty
    Yes, you are right, it creates new menuBar:
    http://qt.gitorious.org/+qt-develope...ow.cpp#line455

    Then you can use setMenuBar(0); to remove it.

  5. #5
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QMenuBar bug for Maemo

    I confirm that the bug exists in 4.6.2~git20100212-0maemo1, however this version is pretty old, an it could be fixed in the latest Qt sources available in git.
    Test app:
    Code:
    #include <QApplication>
    #include <QMainWindow>
    #include <QMenuBar>
    #include <QDebug>
    
    int
    main (int argc, char **argv)
    {
        QApplication app(argc, argv);
        QMainWindow win;
    
        qDebug() << win.menuBar();
        //win.menuBar()->addAction("Action");
    
        win.show();
    
        return app.exec();
    }
    Menu is empty, indicator should not be visible.

Similar Threads

  1. Bug reporting: closed?
    By AndrzejPeszynski in forum Feedback - Nokia Developer Services & Infrastructure
    Replies: 1
    Last Post: 2009-12-12, 13:51
  2. RecordStore bug on Series 60
    By ncerezo2 in forum Mobile Java General
    Replies: 21
    Last Post: 2009-11-26, 10:12
  3. A bug: setColor with offscreen graphics - PLEASE, REPLY THIS TIME
    By palmcrust in forum Mobile Java General
    Replies: 11
    Last Post: 2003-12-04, 12:43
  4. Firmware bug or code bug displaying list on 3650
    By blackjack75 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-09-24, 19:52
  5. Replies: 8
    Last Post: 2003-07-11, 12:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×