Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-4493

Anchor not removed when using QTextBrowser::setText()

    XMLWordPrintable

Details

    Description

      When using setText to overwrite the content of QTextBrowser, the anchor is not removed properly.
      The following code reproduces the bug:

      #include <QtGui>
      #include <Dialog.h>
      
      Dialog::Dialog()
      {
          QDialog* dialog = new QDialog();
          _text = new QTextBrowser(dialog);
          connect(_text, SIGNAL(anchorClicked ( const QUrl &)), this, SLOT(clicked()));
          _text->setHtml("This is an <a href=\"http://www.w3schools.com/HTML/html_links.asp\">Anchor<\a>");
          dialog->show();
      }
      
      void Dialog::clicked()
      {
          _text->setText("No Anchor");
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            z35liu Zheng Liu (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes