Home > other >  Masters, you label -> setText () how to enter int
Masters, you label -> setText () how to enter int

Time:12-17

QList The list; List. Append (8001); List. Append (8002); List. Append (8003); List. Append (8004); The UI - & gt; Label_2 - & gt; SetText (" "+ list. The at (0)); The UI - & gt; Label_2 - & gt; SetText (QString (" "). Arg (list) at (0))); I searched the Internet, according to the above two methods, label_2 place is empty, want how to display 8001? Thank you for the

CodePudding user response:

The UI - & gt; Label_2 - & gt; SetText (QString: : number (list) at (0)))

CodePudding user response:

Can't write 1. UI - & gt; Label_2 - & gt; SetText (" "+ QString: : number (list) at (0))); 2. The UI - & gt; Label_2 - & gt; SetText (QString (" % 1 "). Arg (list) at (0)));

CodePudding user response:

Is this your search what ah... First how to also can't get an empty string to a Numbers together, the second, it's not VB see arg () document how do you say

CodePudding user response:

Oid QLabel: : setNum (int num) (slot)

CodePudding user response:

Int a=8001;
The UI - & gt; The label - & gt; SetText (QString: : number (a, 10));