Questions tagged [qmessagebox]

QMessageBox is a Qt class that provides a modal window for informing the user or asking for a simple input (like "yes"/"no").

The simplest QMessageBox to alert a user will look like this:

QMessageBox myBox;
myBox.setText("Hello, World!");
myBox.exec();

This will pop up a small modal window (which will block the rest of the interface until dismissed) with the text, and a standard "ok" button.

Basically the QMessageBox provides text for informing the user, informative text for a more detailed explanation, and an optional detailed text for even more additional info, should the user request it. The message box can also have standard buttons.

The official documentation can be found here for Qt 4.8 and here for Qt 5.

233 questions
0
votes
1 answer

Lower text in a QMessagebox

I have a QMessagebox with a custom background image. Since there is some stuff on the top side of the background image I want to see, the text of the messagebox should be lowered. Does anybody know how I can do this? I already tried throwing in some…
Frank
  • 2,446
  • 7
  • 33
  • 67
-1
votes
1 answer

QMessageBox with "Dont show this message again" in python

I'm developing a UI using PyQt 5. I'm using stackedWidget to alternate between screens. Every time I open a screen I show a pop up message (QMessageBox), but I want to able to the user to define if he/she wants to see the pop up next time that…
Mutante
  • 278
  • 5
  • 18
-1
votes
1 answer

Qt Message Box Won´t appear

i recently started working with qt and there occurs a problem i do not understand: In this particular code i just want to show a Message Box, if a push button is clicked and a radio button is checked, but the Message Box wont appear. Can anyone…
Cedric
  • 3
  • 1
-1
votes
1 answer

How to change the color of QMessageBox in PyQt5 Python

I have a below code for QMessageBox: msgBox = QMessageBox() reply = msgBox.question(self, 'Window Close', 'Are you sure you want to close the window?', QMessageBox.Yes | QMessageBox.No, QMessageBox.No) This is showing as below: So I added below…
S Andrew
  • 5,592
  • 27
  • 115
  • 237
-1
votes
1 answer

QMessageBox does not close

I am relatively new to Python and PyQt5, so sorry if this question is quite simple. I want to create a critical message stating that a particular QlineEdit is empty and so the program does not run. I was able to bind the message to the respective…
Luca
  • 1
  • 3
-1
votes
1 answer

QMessageBox Compatibility

I'm looking through some Qt code and see that rather than just using QMessageBox, the program checks whether QAPPLICATION_H is defined. If it isn't, then it uses some default system message box. Here's what it looks like: bool Connect() { …
Archie Gertsman
  • 1,601
  • 2
  • 17
  • 45
-3
votes
2 answers

How do I print a variable value in QMessageBox?

Do I need to use a QString first then put it in the msgbox? Are there any examples?
craftace
  • 217
  • 1
  • 6
  • 10
-3
votes
1 answer

Handle QMessageBox in python unittest with QTest

I automate UI tests in python. I'm using pyqt and qtest. How handle QMessageBox and close it in unittest.
KanekiSenpai
  • 122
  • 10
1 2 3
15
16