×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    12

    Update Commands/Actions in Softkey Options menu problem/bug

    Hi,

    I have seen a strange behaviour when using softkey menus in QT for S60.
    For me it sounds like a bug in QT, but I am not sure on how to proceed with reporting the error nor on how to prevent the faulty behaviour.

    * I have an application that is based on QMainWindow
    * My softkey commands(QActions) are added to QMainWindows menubar.

    * In runtime, I update available commands/actions with setEnable()/setVisible().
    This works perfectly when the Options menu is closed.
    BUT, if the options menu is opened, the Options menu disapears, application is dimmed in background, and the only command visible is a Exit command on right softkey. This exits the application.

    To reproduce this, I have done a test app thar look like this.
    ************************************************************
    SoftkeyTest::SoftkeyTest(QWidget *parent)
    : QMainWindow(parent)
    {
    ui.setupUi(this);

    iCommand1 = new QAction(tr("Command 1"), this);
    iCommand2 = new QAction(tr("Command 2"), this);

    menuBar()->addAction(iCommand1);
    menuBar()->addAction(iCommand2);


    iTimer = new QTimer(this);
    iTimer->setSingleShot(true);

    connect(iTimer, SIGNAL(timeout()), this, SLOT(handleTimeout()));
    iTimer->start(10000); // timer executes after 10s.
    }

    SoftkeyTest::~SoftkeyTest()
    {
    }

    void SoftkeyTest::handleTimeout()
    {
    iCommand1->setEnabled(false);
    }
    ************************************************************



    1. Start the application.
    2. Quickly open the Options menu.
    3. Wait 10 seconds and see how the menu and softkeys behavies.

    Anyone that has any suggestion on how to solve this? It feels like a standard use-case. Am I doing something wrong?


    Best regards,
    Lars

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    12

    Re: Update Commands/Actions in Softkey Options menu problem/bug

    Hi again,

    I have raised a bug:
    http://bugreports.qt.nokia.com/browse/QTBUG-9468

    lets hope for an answer/fix.

    cheers,
    lars

  3. #3
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: Update Commands/Actions in Softkey Options menu problem/bug

    Hi,

    I don't think something like this (modifying menu dynamically while it is visible) can be easily implemented. In Symbian, one overrides DynInitMenuPaneL() to decide what menu items are displayed/hidden each time Options menu is opened - and those properties cannot change before it's closed and reopened - ie. DynInitMenuPaneL() is called again. This doesn't fit very well with Qt, where menu items are tied to QActions whose properties can change anytime.

    Still, the way it currently works (Options/Cancel replaced by only Exit) is not ok. I can see from the bug report that it wasn't reproduced with latest sources - instead, it works how a Symbian application would.

    On current release (4.6.2), a possible workaround is to force the Options menu to close before changing the properties of a menu action. It's not pretty, though.

    Code:
    #ifdef Q_OS_SYMBIAN
    #include <eikenv.h>
    #include <eikmenub.h> // symbian: LIBS += -lcone -leikcore -leikcoctl
    #endif
    
    #ifdef Q_OS_SYMBIAN
      CEikMenuBar* nativeMenuBar = CEikonEnv::Static()->AppUiFactory()->MenuBar();
      if(nativeMenuBar) {
        nativeMenuBar->StopDisplayingMenuBar();
      }
    #endif

Similar Threads

  1. Menu bar doesn't update
    By kalastaja in forum Symbian User Interface
    Replies: 3
    Last Post: 2009-03-04, 07:40
  2. Replies: 0
    Last Post: 2008-06-12, 18:38
  3. options menu in FullCanvas?
    By xrsu in forum Mobile Java General
    Replies: 3
    Last Post: 2002-10-17, 09:42
  4. How to add a menu item in the Options menu of a Nokia 7650 ?
    By nmittal in forum Symbian User Interface
    Replies: 1
    Last Post: 2002-08-07, 08:23

Posting Permissions

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