Formatting
-
@
QTextCharFormat hosname;
hosname.setForeground(QBrush(QColor(0,255,0)));
hosname.setFontWeight(QFont::Bold);
hosname.setFontFamily("Times New Roman");
hosname.setFontPointSize(18);
@I want to set center alignment using the QTextCharFormat how do i achieve this
[edit] code wrappers added, koahnig. Check out "this section":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 from Fourm help
-
I think that's a property of the QTextOption and not related to QTextCharFormat.
-
thanks for ur reply ,
but i archive it in another way..QTextBlockFormat v;
v.setAlignment(Qt::AlignHCenter);
cursor.setBlockFormat(v);I think QTextCharFormat is only for character and QTextBlockFormat is used for Block ( Entire String )
-
Hi,
Kindly use "code wrapping":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 for your code, so that it is easily readable. Use @-tags for your code while posting. -
ok thanks for Ur comment i will correct it