Reputation: 1
as from title, I am setting up a QLabel in QT designer. I know I can set it up in the designer and then populate it via code. I still would like to exploit the ease of managing the text via the designer and import a variable value in it.
For instance:
In the designer, I set a QLabel that will be: "Hello, [long text with formatting], this session will last" + $variable_from_Python_code "minutes [long text with formatting]".
Is it possible?
Upvotes: 0
Views: 726
Reputation: 48543
No, that's not what Designer is intended for, and Qt doesn't directly provide such support.
All properties are intended as "static", with the exception of properties directly linked with signals and slot created in the GUI.
A possible solution would be to use a promoted widget (which wouldn't provide a visual result while designing) or a custom widget plugin (which is a pretty complex procedure that would be rather pointless if you just need to update a string).
Upvotes: 1