PDA

View Full Version : QTextEdit HTML QCheckBox?



cyberduck
12th December 2011, 07:44
Hi,

how can i put some QCheckboxes into a QTextEdit? The Form should look like the attached example. I use a QToolBox and a QTextEdit on each page. The QTextEdit include some HTML to display the page. The problem is i can't use a QCheckbox, can you help me?

Thanks in advance

7168

Jonny174
12th December 2011, 08:39
http://www.qtcentre.org/archive/index.php/t-44065.html?

cyberduck
2nd February 2012, 12:48
Hi,

people from the other post say: use the QTextObjectInterface and i have try it. I can paint the RadioButton but there is without any function. How i get the button working e.g. checked with a mouseclick?

Thats my try:


void SvgTextObject::drawObject(QPainter *painter, const QRectF &rect,
QTextDocument * /*doc*/, int /*posInDocument*/,
const QTextFormat &format)
{
QStyleOptionButton option;
option.rect = rect.toRect();
option.state = QStyle::State_On;
QApplication::style()->drawControl(QStyle::CE_RadioButton, &option, painter);
}
and the RadioButton looks deactivated.