×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Surat, India
    Posts
    277

    How to replace "Exit" with "Back" in Menu

    I have one MainWindow and 3 Widgets. I am putting all widgets inside QStackWidget.
    I am also have a menu.

    Menu on every widget shows "Options" left side and "Exit" right side. I want in few widgets it should be "Back" at right side instead of exit. So that user can go on last screen. How can I do that? I tried following but no success
    Code:
        QAction* back = new QAction(tr("Back"), this);
        back->setSoftKeyRole(QAction::NegativeSoftKey);
        connect(back, SIGNAL(triggered()), this, SLOT(gotoLastScreen()));
    Thanks,
    Rahul Kulshreshtha
    Please choose Notification type as "Instant Email Notification". It must be default.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to replace "Exit" with "Back" in Menu

    try calling addAction(back). the whole code could be found from wiki as well: http://wiki.forum.nokia.com/index.ph...Qt_for_Symbian

  3. #3
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Surat, India
    Posts
    277

    Re: How to replace "Exit" with "Back" in Menu

    Quote Originally Posted by symbianyucca View Post
    try calling addAction(back). the whole code could be found from wiki as well: http://wiki.forum.nokia.com/index.ph...Qt_for_Symbian
    If I use addAction then it comes "left side" inside options menu but I want right side in place of "Exit". "Exit" is still there.
    I tried with
    Code:
    QAction* back = new QAction(tr("Back"), this);
        back->setSoftKeyRole(QAction::NegativeSoftKey);
        menuBar()->addAction(back);
        connect(back, SIGNAL(triggered()), this, SLOT(gotoLastScreen()));
    Thanks,
    Rahul Kulshreshtha
    Please choose Notification type as "Instant Email Notification". It must be default.

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

    Re: How to replace "Exit" with "Back" in Menu

    Code:
    QAction* back = new QAction(tr("Back"), this);
    back->setSoftKeyRole(QAction::NegativeSoftKey);
    addAction(back);
    connect(back, SIGNAL(triggered()), this, SLOT(gotoLastScreen()));

  5. #5
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to replace "Exit" with "Back" in Menu

    do not use the menu bar, just use the addAction defined for QMainWindow.. It at least worked for me just fine.

  6. #6
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Surat, India
    Posts
    277

    Re: How to replace "Exit" with "Back" in Menu

    Oh yes!! thanks it worked
    Thanks,
    Rahul Kulshreshtha
    Please choose Notification type as "Instant Email Notification". It must be default.

Similar Threads

  1. How to use "Back" option instead of "Exit"
    By anup007star in forum Symbian
    Replies: 3
    Last Post: 2009-06-30, 13:23
  2. Replies: 3
    Last Post: 2009-06-18, 21:42
  3. Replies: 21
    Last Post: 2006-10-11, 09:17
  4. how to replace the "back" button with the menu?
    By yinjialiang in forum Symbian User Interface
    Replies: 9
    Last Post: 2003-10-28, 06:33

Posting Permissions

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