PDA

View Full Version : Correct spacing of a text in QT Creator using QTextEdit



gimv30
23rd January 2017, 12:42
I am trying to allign some text and show it via QTextEdit but I'm not sure how to do it properly .
I realized that the space in QT creator doesnt take as much as a normal character and I guess there's where I have problems because I can space it well in c/c++ using this:


snprintf(BufInterm1,100,"%-25s",BufferPPart); - %-25s

However, when I send it to QT, it's not displayed proper. Any idea how I can space it well ?

This is how I'm showing it:



ui->MersulText->setText(MersSosiri);

I've tried different fonts but none work unfortunately

LAST EDIT: Fixed it, it can be closed

high_flyer
25th January 2017, 12:40
LAST EDIT: Fixed it, it can be closed
It would be nice if you could share your solution so others who may search for this problem as well might benefit from your solutions as well.

ChrisW67
25th January 2017, 22:59
Likely just set a monospace font on the text edit (e.g. Courier or Liberation Sans Mono) after trying proportional fonts (most of them)