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

QUrl truncates on invalid "hostname" characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.6.0, 4.6.1, 4.6.2
    • Other
    • None
    • Linux Debian 64-bit

      No problem with Qt 4.5.2 - haven't tested 4.5.3
      Problem with 4.6.x as well as the 4.7 preview

      I have an HTML document that looks like,

      <img src="mydata://image_1" />
      <img src="mydata://image_2" />
      <img src="mydata://image_3" />

      I then load it into QTextDocument for printing, and assign images as,

      doc.addResource( QTextDocument::ImageResource, QUrl( "mydata://image_1" ), img1 );
      doc.addResource( QTextDocument::ImageResource, QUrl( "mydata://image_2" ), img2 );
      doc.addResource( QTextDocument::ImageResource, QUrl( "mydata://image_3" ), img3 );

      then the latest image is used for all images.

      If img1 and img2 is null and img3 is not null, img3 will appear in all placeholders in the document.
      If I move addResource call to prior to img1, then img2 (last addREsource) will overwrite all images.

      Edit: QUrl is the issue.

        1. test.cpp
          0.2 kB
          Adam Majer
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kjernase Trond Kjernåsen (Inactive)
            adamm Adam Majer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes