Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor Joyce An's Avatar
    Join Date
    Dec 2008
    Posts
    86
    Code:
    QMessageBox box;
     box.setText("Low battery. Do you want to continue?");
     box.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
     box.show();
        switch (box.exec()) {
        case QMessageBox::Yes:
        {
           //
        }
            break;
        case QMessageBox::No:
        {
        //
        }
            break;
        default:
            break;
        }
    but it shows dialog, yes and no button is on cba, I want to these two buttons are on dialog.
    that is Symbian dialog shows.
    do you know how should I do?
    thank you
    where there is a will, there is a way.

  2. #2
    Nokia Developer Champion savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    AFAIK, You can not do it without using symbian API(that create and show dialog).

  3. #3
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Normally it's easier to use static methods providing pre-defined dialogs
    http://doc.qt.nokia.com/4.6/qmessagebox.html#question

  4. #4
    Regular Contributor Joyce An's Avatar
    Join Date
    Dec 2008
    Posts
    86
    Do you mean use this method"StandardButton QMessageBox::question ( QWidget * parent, const QString & title, const QString & text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton ) [static]"?
    where there is a will, there is a way.

  5. #5
    Regular Contributor Joyce An's Avatar
    Join Date
    Dec 2008
    Posts
    86
    I try it, but the button and dialog is Separate. I want to the "yes" and "no" button connect the "Low battery. Do you want to continue?" dialog.
    where there is a will, there is a way.

  6. #6
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    Quote Originally Posted by Joyce An View Post
    Do you mean use this method"StandardButton QMessageBox::question ( QWidget * parent, const QString & title, const QString & text, StandardButtons buttons = Ok, StandardButton defaultButton = NoButton ) [static]"?
    Well, yes. There are also others http://doc.qt.nokia.com/4.6/qmessage...public-members
    But I don't know if it will solve your problem with CBA as I don't know what it means.

  7. #7
    Regular Contributor Joyce An's Avatar
    Join Date
    Dec 2008
    Posts
    86
    Low battery. Do you want to continue?
    Yes No
    I want to show this dialog.
    not
    "Low battery. Do you want to continue?"
    this dialog and CBA shows
    Yes and No.
    Do you know other QT class can realize that?
    where there is a will, there is a way.

  8. #8
    Registered User Kruil's Avatar
    Join Date
    Apr 2009
    Location
    Russia
    Posts
    51
    I am also have this problem. My app in fullscreen mode with "Qt::WindowSoftkeysVisibleHint" flag, and when I execute QMessageDialog my app screen mode switches to .showmaximazed. Therefore I wrote this code:
    Code:
    QMessageBox mes;
    mes.setStyleSheet("color: white; background-color: blue; border-radius: 6px");
    mes.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
    mes.("<center>Are you sure?</center>");
    mes.setText("<center>Are you sure?</center>");
    mes.setWindowFlags(windowFlags() | Qt::WindowSoftkeysVisibleHint);
    mes.showshowFullScreen();
    int ret = mes.exec();
    But its not painted correctly, its slightly askew. Is there already good way to get to dialog with fullscreen mode?

Similar Threads

  1. C++ Symbols class(), class()->,class. ????
    By PACALA_BA in forum Symbian C++
    Replies: 7
    Last Post: 2008-09-15, 20:57
  2. Replies: 0
    Last Post: 2004-03-03, 10:34

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