Unsolved How to add proper space between two strings.
-
I need to print two strings with some gap like below
CF Test1
MN Test2
R Test3But I am unable to print Test1 , Test 2, Test 3 in same line. Indentation is not proper. Also the string CF and MN are same length but charachters appearance of MN seems longer hence also the Test1 and Test2 are also not coming in same length if i add tabs.
Please suggest some good solution. I am using QString,
-
the more important question is, how and were to do you "print" these strings?
-
I have a message box where I am priting this strings like below
msg += "CF";
msg+= " Test1";
msg+= "\n";
msg+= "MN";
msg+= " Test2";
MsgBoxInfo(msg); -
- Use fixed width font
- Use tab (\t) instead of space
-
how to use fixed widht font? the font CF and MN can be of varying length
-
@Ayush-Gupta Set font in the widget you use to show the text (https://doc.qt.io/qt-5/qwidget.html#font-prop)
Why don't you read documentation?