Put a variable on qt's display widget

Use this forum to ask questions about how to do things in QCAD.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
woddy
Junior Member
Posts: 13
Joined: Mon Mar 05, 2018 10:44 pm

Put a variable on qt's display widget

Post by woddy » Thu May 17, 2018 12:18 pm

Hello, recently i created a variable 'x' that changes whenever i run the script. Now i want it to be displayed on my .ui widget i created in qt. I know how to call an input text box value from qt to qcad script but i couldn't manage to change this value and display it on my widget.

In other words, briefly i want qt lcd display number changes with respect to script variable whenever i run the code

Is there a sample script for that? or a function?
Thanks.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Put a variable on qt's display widget

Post by andrew » Fri May 18, 2018 9:00 am

QLCDNumber has a property called digitCount:
http://doc.qt.io/qt-5/qlcdnumber.html#digitCount-prop

So if w if your LCD widget, you can simply do:
w.digitCounter = x;

Post Reply

Return to “QCAD 'How Do I' Questions”