qlabel

How to enable mouse tracking on a QLabel that has RichText

How to enable mouse tracking on a QLabel that has RichText Question: I really want a single QLabel to have different colours for different parts of the string. Past questions have led me to the solution of using HTML4 rich text options within it, for example: ‘<font color="red">I’m red! </font><font color="blue">I’m blue!</font>’ This solution works …

Total answers: 1

Change a label after a specified time

Change a label after a specified time Question: I am trying to change a label on a button click and then after 3 seconds I want it to change back to nothing ("") my code is this: def apply_click(self): ui.label_ischanged.setText("Applied!") and I connected it to my button then I used time.sleep(3) but I know that …

Total answers: 1

PyQt5: QLabel.text() function causes app to crash

PyQt5: QLabel.text() function causes app to crash Question: I’m new to PyQt5. I’m currently working on a calculator just for some practice, but for some reason, the app crashes when I use the eval() function in the QLabel().setText() function. Here’s a sample snippet: import PyQt5.QtWidgets as qtw import PyQt5.QtGui as qtg class MainWindow: def __init__(self): …

Total answers: 1