Results 1 to 2 of 2

Thread: Issue with QMessageBox

  1. #1
    Join Date
    May 2024
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Issue with QMessageBox

    Hello,
    I am runnig an application in UN20_WCE6 PLATFORM. am using VisualStudio 2008 to run the application
    QMessageBox is not popping up a message box in "Release mode".
    But in Debug mode message box is shown.
    I am using QT Version 5.15

    Please help me. Thanks in advance!
    - Joshua - undertale yellow

  2. #2
    Join Date
    Sep 2024
    Posts
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Issue with QMessageBox

    In Release mode, the compiler optimizes the code more aggressively than in Debug mode. These optimizations can sometimes lead to unexpected behavior, such as objects being optimized away, or certain code paths not being executed correctly.

    Try turning off some optimizations in the Release configuration and see if the issue persists:

    In Visual Studio, go to Project Properties > C++ > Optimization and set Optimization to "Disabled (/Od)" for testing purposes.
    Rebuild the project and check if the QMessageBox is now displayed in Release mode.

    Ensure that the QMessageBox is being called from the main thread and within the main event loop. If the QMessageBox is called from another thread in Release mode, it might not behave as expected. To ensure the message box is shown correctly, try wrapping the QMessageBox::exec() call in QMetaObject::invokeMethod, forcing it to execute in the main thread.
    Last edited by rebnfa; 18th September 2024 at 04:41.

  3. The following user says thank you to rebnfa for this useful post:

    d_stranz (18th September 2024)

Similar Threads

  1. QMessageBox
    By sonuani in forum Qt Programming
    Replies: 13
    Last Post: 2nd September 2009, 17:56
  2. QMessageBox
    By sonuani in forum Qt Programming
    Replies: 1
    Last Post: 31st March 2008, 08:27
  3. Re: Help on QMessageBox
    By arunvv in forum Newbie
    Replies: 2
    Last Post: 25th March 2008, 23:45
  4. how to use tr() for QMessageBox?
    By gfunk in forum Qt Programming
    Replies: 4
    Last Post: 17th November 2007, 11:30
  5. QMessageBox Icon Issue and How to add a dir to Qt Resources File
    By vishal.chauhan in forum Qt Programming
    Replies: 19
    Last Post: 25th March 2007, 00:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.