Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMessageBox - text not showing when it has a parent
Qt 6.11 is out! See what's new in the release blog

QMessageBox - text not showing when it has a parent

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maximus
    wrote on last edited by
    #1

    Hi,

    I'm using the "code example here":http://qt-project.org/doc/qt-5.0/qtwidgets/qmessagebox.html
    I trying the static and the non-static approach, both with the same problem, no text message displayed:

    "Here what I get":https://www.dropbox.com/s/bowz9uut73osmfl/QMessageBox.png

    @int ret = QMessageBox::warning(this, tr("My Application"),
    tr("The document has been modified.\n"
    "Do you want to save your changes?"),
    QMessageBox::Save | QMessageBox::Discard
    | QMessageBox::Cancel,
    QMessageBox::Save);@

    OR

    @ QMessageBox msgBox(this); //Text doesn't show when I put a parent, works fine without (but doesn't show application icon..)
    // QMessageBox msgBox;
    msgBox.setIcon(QMessageBox::Warning);
    msgBox.setText("The document has been modified.");
    msgBox.setInformativeText("Do you want to save your changes?");
    msgBox.setStandardButtons(QMessageBox::Ok);
    msgBox.setDefaultButton(QMessageBox::Ok);
    int ret = msgBox.exec();@

    Maybe the code example is outdated? I'm using 5.1.1 and this code is straight in the MainWindow with nothing fancy, thank you!


    Free Indoor Cycling Software - https://maximumtrainer.com

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved