PDA

View Full Version : Selecting and copying the informative text from a QMessageBox in Qt 4.8



pothead42
12th June 2017, 14:20
Hey folks,

as the title already tells, my question is about selecting and copying the informative text from a QMessageBox in Qt 4.8. I already used setStyleSheet("messagebox-text-interaction-flags: 5;") to set the text interaction flags for the QMessageBox. When I do so, I can select and copy the "normal" text of the message box, but not the informative text that can be expanded pressing "Show Details".
So I further tryed to use findChild on the QMessageBox to get the QTextEdit. This function even returned the correct text edit. If I change the text color using a styleSheet, it works. But when I call setTextinteractionFlags on the found QTextEdit and set the Qt::TextSelectableByMouse, it doesn't change anything. I somehow can select the text (but the selection color is gray, not blue) and when I then copy the selection and paste it to Notepad, I get the name of the buttons and some dashed lines.
Is there another trick to get this work or did I do something wrong? Or do I even have to create my onw MessegeBox class to do this? The last idear mensioned, I'd like to avoid to realize.

If anybody can give me a hint- thanks in advance