Results 1 to 3 of 3

Thread: QTextEdit HTML QCheckBox?

  1. #1
    Join Date
    Aug 2011
    Posts
    16
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question QTextEdit HTML QCheckBox?

    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

    preview.png

  2. #2
    Join Date
    Apr 2011
    Location
    Russia
    Posts
    85
    Thanks
    2
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

  3. #3
    Join Date
    Aug 2011
    Posts
    16
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question Re: QTextEdit HTML QCheckBox?

    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:
    Qt Code:
    1. void SvgTextObject::drawObject(QPainter *painter, const QRectF &rect,
    2. QTextDocument * /*doc*/, int /*posInDocument*/,
    3. const QTextFormat &format)
    4. {
    5. option.rect = rect.toRect();
    6. option.state = QStyle::State_On;
    7. QApplication::style()->drawControl(QStyle::CE_RadioButton, &option, painter);
    8. }
    To copy to clipboard, switch view to plain text mode 
    and the RadioButton looks deactivated.

Similar Threads

  1. Html used in QTextEdit and QTextDocument
    By nifei in forum Qt Programming
    Replies: 5
    Last Post: 15th August 2012, 20:38
  2. send the text QCheckBox to QTextEdit
    By jaca in forum Newbie
    Replies: 3
    Last Post: 19th November 2011, 12:29
  3. QTextEdit and Html
    By giusepped in forum Qt Programming
    Replies: 1
    Last Post: 28th October 2008, 17:20
  4. Load HTML to QTextEdit
    By Gamalof in forum Qt Programming
    Replies: 2
    Last Post: 5th July 2008, 18:08
  5. Replies: 1
    Last Post: 21st March 2007, 14:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.