Results 1 to 2 of 2

Thread: Bulleted List

  1. #1
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Red face Bulleted List

    I have a QStringList I want to display on the screen and was hoping to do this in a bulleted list fashion. From what I can see is I could possibly use a QTextEdit and make it read-only. But my confusion comes in how I would display this QStringList of items into the QTextEdit. It looks like I would have to set the AutoFormattingFlag to AutoBulletList but how do I add text to this? Or am I going about this all in the wrong direction? Any idea on what I should do to display a bulleted list would be great. I searched the forums thinking this had been done, but much to my dismay, I saw no topic related to creating a bulleted list. I am using Qt 4.3. Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bulleted List

    Dig around QTextDocument, QTextCursor::insertList() and QTextList. Or simply change your list into:
    HTML Code:
    1. <html>
    2. <body>
    3. <ul>
    4. <li>string1</li>
    5. <li>string2</li>
    6. <li>string3</li>
    7. ...
    8. </ul>
    9. </body>
    10. </html>
    To copy to clipboard, switch view to plain text mode 
    and use QTextEdit::setHtml().

Similar Threads

  1. Replies: 1
    Last Post: 22nd October 2007, 02:04
  2. QComboBox drop list button events
    By maird in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2007, 19:25
  3. Replies: 26
    Last Post: 21st July 2007, 21:34
  4. QListBox with QListBoxItems cyclic List
    By codebehind in forum Newbie
    Replies: 3
    Last Post: 24th June 2007, 19:47
  5. Highlight text in list box
    By Sheetal in forum Qt Tools
    Replies: 7
    Last Post: 9th April 2007, 11:24

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.