QMenuBar shows "Actions" item



  • Hi,

    I recently received a Nokia C7 (from the Qt Ambassador thingy) and I tried some simple stuff with it.
    I use Nokia SDK 1.1 beta, but something goes wrong.
    I just create a new project in Qt Creator, add some actions to the QMenuBar (using the Designer) and add a push button to switch styles, with the following code:
    @ if(isMaximized()) {
    showFullScreen();
    ui->modeLabel->setText(tr("Normal Fullscreen"));
    } else {
    Qt::WindowFlags flags = windowFlags();
    if(flags & Qt::WindowSoftkeysRespondHint) {
    flags |= Qt::WindowSoftkeysVisibleHint;
    flags &= ~Qt::WindowSoftkeysRespondHint;
    setWindowFlags(flags); // Hides visible window
    showFullScreen();
    ui->modeLabel->setText(tr("Fullscreen with softkeys"));
    } else if(flags & Qt::WindowSoftkeysVisibleHint) {
    flags &= ~Qt::WindowSoftkeysVisibleHint;
    flags &= ~Qt::WindowSoftkeysRespondHint;
    setWindowFlags(flags); // Hides visible window
    showMaximized();
    ui->modeLabel->setText(tr("Normal Maximized"));
    } else {
    flags &= ~Qt::WindowSoftkeysVisibleHint;
    flags |= Qt::WindowSoftkeysRespondHint;
    setWindowFlags(flags); // Hides visible window
    showFullScreen();
    ui->modeLabel->setText(tr("Fullscreen with SK respond"));
    }
    }@
    This code is copied from the softkeys example. Only in some modes my softkeys are shown.
    Anyway, when the softkey is shown, and I tap the "options" key, I get a strange "Actions" menu item. I can not get rid of it.
    Who knows what it is and how to get rid of it?



  • That is caused by a long standing bug (coudn't find it in JIRA though) in Qt where the "Actions" item in the softkey menu is supposed to represent the context menu for the widget that has focus. The way to remove it is to set the context menu policy to Qt::NoContextMenu Note that you might have to set this on more than one widget to get it to disappear completely.



  • You can also look at "this ":http://developer.qt.nokia.com/wiki/Remove_actions_options_menu_in_Symbian wiki article that describes how to do it.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.