QString str = "\ttext line 1\n\ttext line 2"; QStringList list = str.split("\n"); // list1: [ "\ttext line 1" , "\ttext line 2" ]
textLayout.setText("\ttext line 1 text line 2");line = textLayout.createLine();line.setNumColumns(13);line = textLayout.createLine();
QTextLine line;textLayout->beginLayout();line = textLayout->createLine();line.setNumColumns(13);line = textLayout.createLine();textLayout->endLayout();
QTextOption opt;opt.setTabStop(5); //Sets the default distance in device units between tab stops opt.setAlignment(Qt::AlignLeft | Qt::AlignTop);opt.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);textLayout.setTextOption(opt);