×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2008
    Location
    Egypt
    Posts
    122

    Cannot see QtMessage button

    I created a button to show a message box when user clicks on it:

    void MainWindow:n_pushButton_clicked()
    {
    int ret = QMessageBox::warning(this, "Exit?",
    "Exit the application?",
    QMessageBox::Yes | QMessageBox::No);

    if(ret==0)
    QApplication::exit(0);
    }

    The messagebox pops up but I cannot see the messagebox buttons (Yes or no) on the screen.

  2. #2
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    Re: Cannot see QtMessage button

    try this code
    Code:
     QMessageBox msgBox;
     msgBox.setText("The document has been modified.");
     msgBox.setInformativeText("Do you want to save your changes?");
     msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
     msgBox.setDefaultButton(QMessageBox::Save);
     int ret = msgBox.exec();
    For handling the button events deal in switch case
    Code:
     switch (ret) {
       case QMessageBox::Save:
           // Save was clicked
           break;
       case QMessageBox::Discard:
           // Don't Save was clicked
           break;
       case QMessageBox::Cancel:
           // Cancel was clicked
           break;
       default:
           // should never be reached
           break;
     }

  3. #3
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Cannot see QtMessage button

    Is the problem that the buttons aren't there, or that they're off the screen?

    Note that by using "this" on the QMessageBox::warning factory method you "anchor" the box to the window rather than allowing it to float. This is apt to skew the location of the box.

  4. #4
    Nokia Developer Expert
    Join Date
    Feb 2008
    Posts
    183

    Re: Cannot see QtMessage button

    What Qt release you are using?
    Is the parent window for the dialog fullscreen?

    If your parent is fullscreen and this is happening in pre-Qt4.7.3, then it might be related to this one: http://bugreports.qt.nokia.com/browse/QTBUG-4953
    Good news is that it should be fixed in Qt4.7.3.

  5. #5
    Registered User
    Join Date
    Nov 2008
    Location
    Egypt
    Posts
    122

    Re: Cannot see QtMessage button

    Thank you, it works fine. I guess the problem was within my code .

Similar Threads

  1. Cannot Express Sign ,Cannot See Content IDs
    By lxwwd in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2011-02-21, 08:15
  2. Cannot Express Sign ,Cannot See Content IDs
    By gz208 in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 6
    Last Post: 2011-02-03, 18:05
  3. Cannot see app on 6600
    By rgsv123 in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2005-08-31, 09:29
  4. I cannot see the application
    By antogarforum in forum Symbian
    Replies: 2
    Last Post: 2004-12-09, 09:48

Posting Permissions

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