[Interest] QMessageBox copy to clipboard

André Somers andre at familiesomers.nl
Wed Jun 4 09:12:36 CEST 2014


Hamish Moffatt schreef op 4-6-2014 08:50:
> Hi,
>
> We're displaying an error message with QMessageBox and we'd like to make
> it easy for the user to copy the detailed text to the clipboard. I'd
> like to add a button to do this, but I don't want to dismiss the dialog
> at the same time.
>
> It looks like I can add any button with QMessageBox::addButton, but any
> button will cause the message box to close. Is there another way?
>
> I'm aware that the detailed text has select/copy functions but that's
> not very user friendly.
>
You could try to add the button, and then after adding disconnect all 
signals from it. Then connect your own copy-to-clipboard code to the 
clicked signal.

André





More information about the Interest mailing list