Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor rahul.kulshreshtha's Avatar
    Join Date
    Apr 2010
    Location
    Surat, India
    Posts
    277
    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 Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,672
    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 rahul.kulshreshtha's Avatar
    Join Date
    Apr 2010
    Location
    Surat, India
    Posts
    277
    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
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    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 Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,672
    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 rahul.kulshreshtha's Avatar
    Join Date
    Apr 2010
    Location
    Surat, India
    Posts
    277
    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 C++
    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. Replies: 0
    Last Post: 2005-09-14, 15:51
  5. 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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved