How do you set the message text for QErrorMessage widget?

374 views
Skip to first unread message

David Wysocki

unread,
Jun 20, 2013, 4:37:23 PM6/20/13
to qtcon...@googlegroups.com
I can't seem to find a method to set the message

setInformativeText method doesn't exist in this class.

Can anyone help?

David Wysocki

unread,
Jun 20, 2013, 5:54:13 PM6/20/13
to qtcon...@googlegroups.com
I have the error message dialog working but don't understand why the second statement is needed.

oErrorMsg:showMessage("Test message")
oErrorMsg:exec()

Can someone explain why the class behaves this way? Thank you.

Pritpal Bedi

unread,
Jun 20, 2013, 6:36:33 PM6/20/13
to qtcon...@googlegroups.com
Hi David


setInformativeText method doesn't exist in this class.

QErrorMessage() does not have this method. Nor QDialog()
which this class inherits. Only QMessageBox() have this message.

Qt is the culprit here.

Does above reply make any sense ?


Pritpal Bedi

Pritpal Bedi

unread,
Jun 20, 2013, 6:40:08 PM6/20/13
to qtcon...@googlegroups.com
David


I have the error message dialog working but don't understand why the second statement is needed.

oErrorMsg:showMessage("Test message")
oErrorMsg:exec()

Can someone explain why the class behaves this way? Thank you.



I suggest you to study Qt documentation on this subject.
For now:
:exec() is the method to invoke QDialog() as a modal window.
Which must be the case with Error reporting.

Hope you should be comfortable by now.

BTW : why did you asked this question ?
Do you want this dialog to behave in different way ?
If yes, in what way ?


Pritpal Bedi

Pritpal Bedi

unread,
Jun 20, 2013, 6:47:30 PM6/20/13
to qtcon...@googlegroups.com
Hi


oErrorMsg:showMessage("Test message")
oErrorMsg:exec()


A correction:

:showMessage() displays the dialog and returns back to 
the application. It then is in non-modal state.

If you call :exec() then it will become modal and control 
will not be returned to the application.

QErrorMessage() is meant for Qt programmers.
For Harbour, you can design/devise/exploit QMessageBox().


Pritpal Bedi

David Wysocki

unread,
Jun 21, 2013, 7:01:43 AM6/21/13
to qtcon...@googlegroups.com
Hi, thank you for all the feedback. I used QErrorMessage because I liked the look better than QDialog.

I understand the behavior of the class now.

Thanks again.
Reply all
Reply to author
Forward
0 new messages