Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. HTML img qrc Resource does not display
Forum Update on Monday, May 27th 2025

HTML img qrc Resource does not display

Scheduled Pinned Locked Moved Mobile and Embedded
androidhtmlressource
8 Posts 2 Posters 4.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • diduD Offline
    diduD Offline
    didu
    wrote on last edited by didu
    #1

    Hi everyone,

    I have create a "About" MessageDialog in qml with a text in html that use the '<img>' html subset.
    http://doc.qt.io/qt-4.8/richtext-html-subset.html

    This dialog correctly display the image in Desktop (Windows/Linux/Mac) but in Android I get a "blue cube".

    Does anyone have a idea ?
    (I use Qt 5.4)

    MessageDialog {
        id: aboutDialog
        title: "About"
        text: 'Client Version: ' + Qt.application.version + '<br>'
              + '<img src=":/images/ic_launcher.png"><br>'
        icon: StandardIcon.Information
        onAccepted: visible = false
        visible: true
    }
    
    1 Reply Last reply
    0
    • Malek_KhlifM Offline
      Malek_KhlifM Offline
      Malek_Khlif
      wrote on last edited by
      #2

      Try this

      text: 'Client Version: ' + Qt.application.version + '<br>'
      + '<img src="qrc:///images/ic_launcher.png"><br>'

      I Love Qt &lt;3

      diduD 1 Reply Last reply
      0
      • diduD Offline
        diduD Offline
        didu
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • Malek_KhlifM Malek_Khlif

          Try this

          text: 'Client Version: ' + Qt.application.version + '<br>'
          + '<img src="qrc:///images/ic_launcher.png"><br>'

          diduD Offline
          diduD Offline
          didu
          wrote on last edited by
          #4

          @Malek_Khlif said:

          Try this

          text: 'Client Version: ' + Qt.application.version + '<br>'
          + '<img src="qrc:///images/ic_launcher.png"><br>'

          I have the same result :'(

          1 Reply Last reply
          0
          • Malek_KhlifM Offline
            Malek_KhlifM Offline
            Malek_Khlif
            wrote on last edited by
            #5

            can you show me your ressource file ?

            I Love Qt &lt;3

            1 Reply Last reply
            0
            • diduD Offline
              diduD Offline
              didu
              wrote on last edited by
              #6

              @Malek_Khlif said:

              can you show me your ressource file ?

              <RCC>
                  <qresource prefix="/images">
                      <file>About.ico</file>
                      <file>ic_launcher.png</file>
                  </qresource>
              </RCC>
              
              1 Reply Last reply
              0
              • Malek_KhlifM Offline
                Malek_KhlifM Offline
                Malek_Khlif
                wrote on last edited by
                #7

                @didu said:

                <RCC>
                <qresource prefix="/images">
                <file>About.ico</file>
                <file>ic_launcher.png</file>
                </qresource>
                </RCC>

                Edit this resource:

                <RCC>
                <qresource prefix="/images">
                <file>About.ico</file>
                <file alias"ic_launcher.png">ic_launcher.png</file>
                </qresource>
                </RCC>

                I Love Qt &lt;3

                1 Reply Last reply
                0
                • diduD Offline
                  diduD Offline
                  didu
                  wrote on last edited by didu
                  #8

                  @Malek_Khlif said:

                  @didu said:

                  <RCC>
                  <qresource prefix="/images">
                  <file>About.ico</file>
                  <file>ic_launcher.png</file>
                  </qresource>
                  </RCC>

                  Edit this resource:

                  <RCC>
                  <qresource prefix="/images">
                  <file>About.ico</file>
                  <file alias"ic_launcher.png">ic_launcher.png</file>
                  </qresource>
                  </RCC>

                  Also same result :(
                  Otherwise I have other pictures in same qrc that show perfectly on both platforms !
                  The only difference is that I use html to display this one !
                  Does anyone have succeed to display on android with html like I do ?

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved