QApplication::activeWindow() working incorrectly
-
wrote on 19 Apr 2021, 11:23 last edited by
Hello everyone!
QMessageBox::information(QApplication::activeWindow(),"Error", query.lastError().text(),QMessageBox::Ok);
When I use this construct, the QMESSAGEBOX returns an empty one with no message. The message is sent from another class that does not have widgets.
-
@iddqd-0 said in QApplication::activeWindow() working incorrectly:
QMESSAGEBOX returns an empty one with no message
What does this mean?
-
Hello everyone!
QMessageBox::information(QApplication::activeWindow(),"Error", query.lastError().text(),QMessageBox::Ok);
When I use this construct, the QMESSAGEBOX returns an empty one with no message. The message is sent from another class that does not have widgets.
@iddqd-0 What happens if you don't set parent? Setting parent or not should not have any influence on the content of the message box. What does query.lastError().text() return?
-
@iddqd-0 said in QApplication::activeWindow() working incorrectly:
QMESSAGEBOX returns an empty one with no message
What does this mean?
wrote on 19 Apr 2021, 11:54 last edited by@Christian-Ehrlicher
instead of a window with an error message, I get just an empty window -
What Qt version do you use? Is this called from the main thread?
-
What Qt version do you use? Is this called from the main thread?
wrote on 19 Apr 2021, 12:04 last edited by@Christian-Ehrlicher I'm using version 6.0.2. Yes, in main thread
-
Ok, fine. Can you create a minimal example to reproduce the problem? It looks like a QMessageBox in main() should also trigger your issue.
-
Ok, fine. Can you create a minimal example to reproduce the problem? It looks like a QMessageBox in main() should also trigger your issue.
wrote on 22 Apr 2021, 09:43 last edited bythanks for the help. Your tips helped solve the problem!
1/8