Issue
I am showing a message into a Qlabel and I want to append the messages:
if A>B:
text_1=('As<sub>min</sub>')
else:
text_1=(' ')
if A>C:
text_2=(' A>C')
else:
text_2=(' ')
self.ui.label.setText('message' + '\n' +text_1 + '\n' + text_2)
But the message displayed looks like this
message
As<sub>min</sub>
A>C
instead of
message
As min
A>C
My problem is when I try to display the subscript, it doesn`t show
Solution
You have to use <br>
if you want to do a line break instead of "\n" which is for plain text.
self.ui.label.setText("<br>".join(["message", text_1, text_2]))
Answered By - eyllanesc
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.