Results 1 to 5 of 5

Thread: How to add a border to the QTextEdit image?

  1. #1
    Join Date
    Apr 2016
    Posts
    37
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default How to add a border to the QTextEdit image?

    Question 1:

    I try to add a border to the QTextEdit image.

    code is :
    QString image_html = QString("<img border="3" src="C:/test.png">");
    ui->textEdit->insertHtml(image_html);

    The picture shows no problem , but picture is no border.

    I'm using Qt 5.3.1. windows 7 64bit.


    Question 2:

    how to get QTextCursor current coordinates? I want to display the coordinates my widget.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,769
    Thanks
    262
    Thanked 773 Times in 763 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: How to add a border to the QTextEdit image?

    Qt supports a subset of HTML in rich text.

  3. #3
    Join Date
    Apr 2016
    Posts
    37
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to add a border to the QTextEdit image?

    thx , i see img Supports the src, source (for Qt 3 compatibility), width, and height attributes.

    no border attribute , Have other way to add for img?

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,769
    Thanks
    262
    Thanked 773 Times in 763 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: How to add a border to the QTextEdit image?

    Can you make a one-cell table (that supports the "border" attribute) and embed your image in the cell?

  5. #5
    Join Date
    Apr 2016
    Posts
    37
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to add a border to the QTextEdit image?

    thx,I can only so.

Similar Threads

  1. Drawing a border around an image.
    By owenb11 in forum Newbie
    Replies: 3
    Last Post: 15th April 2016, 16:30
  2. QTextEdit - Scrollbar cuts border bug
    By Nyte in forum Newbie
    Replies: 3
    Last Post: 24th September 2014, 15:41
  3. Replies: 4
    Last Post: 15th May 2013, 14:58
  4. About Border-image
    By Wong in forum Qt Programming
    Replies: 4
    Last Post: 29th March 2013, 14:04
  5. Css - problem with border in QTextEdit
    By Trok in forum Qt Programming
    Replies: 3
    Last Post: 28th March 2009, 23:53

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.