×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    89

    Question duplicating menus in softkey

    hi,
    i am facing some trouble with submenus
    i am creating some actions and menus to the softkeys..the problem is when accessing the softkey i have duplicating menus...
    i mean if i create on the positive key named "options" the action "exit" and a menu "synchronise" containing 4 others actions.
    when i click the positive key "options" , what i see is "exit" and "options" (again; which is menu) and then from option i get exit and synchronise
    this problem occurred on c5 and n8 and not with n97(in N97 i have directly exit and synchronise)
    hope that my problem is explained well
    i am using the following code

    menu1=new QMenu(this);

    /* Create options left softkey */
    QAction* options = new QAction(tr("Options"), this);
    options->setSoftKeyRole(QAction::PositiveSoftKey);

    /* Create exit right softkey */
    QAction* exi = new QAction(tr("exit"), this);
    exi->setSoftKeyRole(QAction::NegativeSoftKey);

    connect(exi, SIGNAL(triggered()),
    this, SLOT(close()));

    /* Set softkeys */
    QList<QAction*> mySoftKeys;
    mySoftKeys.append(options);
    mySoftKeys.append(exi);

    ui->centralWidget->addActions(mySoftKeys);
    ui->centralWidget->setFocus();


    QMenu* syncho = menu1->addMenu(tr("Synchronise"));

    synch = new QAction(tr("Synch now"), this);
    synch5 = new QAction(tr("Synch every 30 min"), this);
    synchohour = new QAction(tr("Synch every 1 hour"), this);
    synch24 = new QAction(tr("Synch every 24 hours"), this);

    syncho->addAction(synch);
    syncho->addAction(synch5);
    syncho->addAction(synchohour);
    syncho->addAction(synch24);

    connect(synch, SIGNAL(triggered()),this, SLOT(synch_All()));
    connect(synch5, SIGNAL(triggered()),this, SLOT(synch_min()));
    connect(synchohour, SIGNAL(triggered()),this, SLOT(synch_hour()));
    connect(synch24, SIGNAL(triggered()),this, SLOT(synch_day()));


    /* New exit action to options menu */

    QAction* exit = new QAction("Exit", this);
    connect(friends, SIGNAL(triggered()),this, SLOT(close()));
    menu1->addAction(exit);


    options->setMenu(menu1);


    is there anything wrong with this code?
    thx for any help

  2. #2
    Regular Contributor
    Join Date
    Apr 2010
    Posts
    89

    Re: duplicating menus in softkey

    Any help or idea ??

Similar Threads

  1. duplicating textfield in canvas
    By ashwin.nath.m in forum Mobile Java General
    Replies: 3
    Last Post: 2009-02-24, 15:47
  2. String duplicating ?
    By chirag_cel in forum Symbian C++
    Replies: 0
    Last Post: 2007-12-26, 12:32
  3. Replies: 2
    Last Post: 2007-10-18, 01:19
  4. how to add more menus to the options softkey in dialog
    By manjunaths in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-12-06, 10:54

Posting Permissions

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