'Best QWidget or item to use to display a variable in a box
I would like to ask which QWidget or which Qt GUI item would be best to use to display a variable that will change during the lifecycle of the program, in a box. The image gives a description of what I need. I want to place that box several times on my MainWindow.
I have tried QRectItem but then I was unable to display the text using a label because the label is a QWidget. Thank you in advance.
Solution 1:[1]
You can use simple QLabel with a style sheet. In the style sheet you can define a border (color, width, style), a font size, a font color and required paddings. Nevermind what is the type of the value to be displayed, you will change the text with setText method with the explicitly provided QString argument.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Alexey |

