PDA

View Full Version : QTextTable background color?



anupamgee
26th June 2009, 11:40
hi All,
I am trying to have desired background color in Rows of QtextTable .I used following code But i am not able to get Result.What is wrong with code.


QTextEdit *editor=new QTextEdit(this);
editor->setGeometry(0,0,200,200);
QTextCursor cursor(editor->textCursor());
cursor.movePosition(QTextCursor::Start);
QColor color(222,22,0,255);
QBrush brush(color,Qt::RadialGradientPattern);
QTextTableFormat format;
format.setBorderStyle(QTextFrameFormat::BorderStyl e_Dashed);
format.setBackground(brush);
QTextTable *table = cursor.insertTable(1, 1, format);
cursor.insertText("Helo");