PDA

View Full Version : "Do not show this message again" functionality in Message Boxes



JPNaude
8th October 2008, 10:27
Hi

I've read that Qt supports message boxes which supports a "Do not show this message again" check box. I've checked the QMessageBox class reference but it does not seems to have information on this topic.

Does anyone have a reference that explains how this works?

Thanks in advance
Jaco

spirit
8th October 2008, 10:33
do you mean this widget QErrorMessage (http://doc.trolltech.com/4.4/qerrormessage.html)?

JPNaude
8th October 2008, 10:43
I wasn't aware of the QErrorMessage class... Thanks.

I guess this "do not show again" functionality is not available to custom user generated QMessageBox messages? I'm planning to implement my own message handler class which keeps track of which messages needs to be shown or not. I thought that it's worthwhile to investigate if this functionality was already available.

Thanks for the help. I'll implement my own class to manage showing or not showing of message boxes.

Jaco

Lykurg
8th October 2008, 15:11
Hi,

just use QSettings and store a bool value for each dialog, if it should be displayed again or not.


Lykurg

Edit: If the value should only stored for the lifetime of the application use a static "QHash<QString> doNotShow" as QErrorMessage does.

jpn
12th October 2008, 14:47
See QxtConfirmationMessage.