Results 1 to 2 of 2

Thread: Insert line to textedit

  1. #1
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Question Insert line to textedit

    How to insert line into textedit ? So far I use this code

    Qt Code:
    1. QTextCursor cursor(ui->textEdit->textCursor());
    2. cursor.insertHtml("<hr>");
    To copy to clipboard, switch view to plain text mode 

    But, hr can't be styled with <hr style="height:2px;color:red;">. I look qt have a class with name QTextLine. But I don't know and haven't a sample how to use that class for insert line into textedit

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Insert line to textedit

    QTextLine is for representing a line of text, not a graphical object. You can insert a frame, a table or an image with a horizontal line using QTextCursor API.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Why is my application's CPU usage always > 50%
    By richardander in forum Qt Programming
    Replies: 10
    Last Post: 14th October 2010, 22:22
  2. QTcpSocket exception.
    By Fastman in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2008, 13:51
  3. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

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.