<p dir="ltr"><br>
Den 10 maj 2016 4:25 em skrev "Leonardo Corato" <<a href="mailto:leocor@gmail.com">leocor@gmail.com</a>>:<br>
><br>
> Hello everybody,<br>
><br>
> this is my first post. Pardon me whether it has aldready been asked. <br>
> I made a small program with PyQT (5) and the result is shown into a QMessageBox. <br>
> In Windows I cannot select the text with the mouse while in Linux I can.<br>
><br>
> I suppose in Windows there's a different default that in Linux.<br>
> I saw there's an option in QT to force the text to be selectable, said mb is the instance of QMessageBox mb.setTextInteractionFlags(Qt::TextSelectableByMouse) but How can I apply it in Python?<br>
><br>
> My snippet:<br>
> def tagconvert(self):<br>
> i = self.lineEdit.text()<br>
> if len(i) >= 0 and i.isdigit():<br>
> d = (int(i)).to_bytes(4, byteorder='little')<br>
> converted = ''.join('%02x' % c for c in d)<br>
> msg=QMessageBox()<br>
> msg.setText(converted)<br>
> msg.setWindowTitle("Tag Convertito:")<br>
> msg.setTextInteractionFlags(TextSelectableByMouse);</p>
<p dir="ltr">Should be</p>
<p dir="ltr">msg.setTextInteractionFlags(Qt.TextSelectableByMouse);</p>
<p dir="ltr">after</p>
<p dir="ltr">from PyQt5.QtCore import Qt</p>
<p dir="ltr">I think.</p>
<p dir="ltr">Elvis</p>
<p dir="ltr">> msg.exec_()<br>
> print(converted)<br>
> else:<br>
><br>
> Thanks and best regads,<br>
> Leo<br>
><br>
> _______________________________________________<br>
> PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
> <a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</p>