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

QWebHitTestResult::linkTitle is a QUrl

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.5.0
    • 5.4.0
    • WebKit
    • None
    • ce4edc79a8cf0114e7306f0e577b34555d381221

    Description

      Looking at the code of QWebHitTestResult::linkTitle in qtwebkit/Source/WebKit/qt/WidgetApi/qwebframe.cpp, it does this:

      QUrl QWebHitTestResult::linkTitle() const
      {
          if (!d)
              return QUrl();
          return d->linkTitle;
      }
      

      d->linkTitle is a QString, not a QUrl. I guess C++ will automatically call QUrl::QUrl(const QString & url), correct?

      Why is that? If I'm not mistaken this would return an invalid QUrl in any case.

      If this can't be changed because of ABI compatibility, I propose the following:

      • Change the documentation to point this issue out, and how to get the title if it's still retrievable from the QUrl.
      • Convert the QString to a QUrl explicitely and add a comment describing why this is the way this is.

      If I get the time I can submit a contribution for these changes, but I'd like to be sure it can't be changed in some better way first.

      Attachments

        For Gerrit Dashboard: QTBUG-44052
        # Subject Branch Project Status CR V

        Activity

          People

            allan.jensen Allan Sandfeld Jensen
            the compiler Florian Bruhin
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes