Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How can I load an image?
Forum Updated to NodeBB v4.3 + New Features

How can I load an image?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
10 Posts 4 Posters 5.1k Views 2 Watching
  • 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.
  • J Offline
    J Offline
    jdent
    wrote on last edited by
    #1

    I am in QtCreator 3.5.1 open source and I cannot open an image into the MainForm.ui.qml. I placed the image in the window by using the QtCreator Designer... I get the error:

    QML Image: Cannot open: qrc:/horizontalpercentbarseries-icon.png

    What could be happening?

    Thanks
    Juan

    tomyT 1 Reply Last reply
    0
    • douglasD Offline
      douglasD Offline
      douglas
      wrote on last edited by
      #2

      have you checked if the path is correct?

      1 Reply Last reply
      0
      • J jdent

        I am in QtCreator 3.5.1 open source and I cannot open an image into the MainForm.ui.qml. I placed the image in the window by using the QtCreator Designer... I get the error:

        QML Image: Cannot open: qrc:/horizontalpercentbarseries-icon.png

        What could be happening?

        Thanks
        Juan

        tomyT Offline
        tomyT Offline
        tomy
        wrote on last edited by tomy
        #3

        @jdent said:

        I am in QtCreator 3.5.1 open source and I cannot open an image into the MainForm.ui.qml. I placed the image in the window by using the QtCreator Designer... I get the error:

        QML Image: Cannot open: qrc:/horizontalpercentbarseries-icon.png

        What could be happening?

        Thanks
        Juan

        Hi Juan,

        This is the way I used:

        1- Open your project in Qt creator IDE and switch to the Projects mode.
        2- Right click on the MainForm.ui.qml and click on Show in Explorer. The Windows explorer opens (I assume you are using a Windows machine).
        3- Copy your image and paste it into that window.
        4- Get back to your IDE and double click on MainForm.ui.qml. It takes you to IDE Designer.
        5- Go to Library mode and then click on Resources. Your image is there! Drag and drop it into your main window.
        Hope this helps. :-)

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jdent
          wrote on last edited by jdent
          #4

          the file is in resources but it STILL refuses to load..

          qrc:/MainForm.ui.qml:27:5: QML Image: Cannot open: qrc:/horizontalpercentbarseries-icon.png

          Any ideas?

          Thanks,
          Juan

          1 Reply Last reply
          0
          • tomyT Offline
            tomyT Offline
            tomy
            wrote on last edited by
            #5

            Can you please take a screenshot of you screen showing Projects and Resources in Design mode?

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jdent
              wrote on last edited by
              #6

              Screen shot of Design mode: (file:///Users/juandent/Desktop/Qt.jpg)

              Does it help?

              Thanks
              Juan

              1 Reply Last reply
              0
              • J Offline
                J Offline
                jdent
                wrote on last edited by
                #7

                Sorry, but how can I put the screenshot here?

                1 Reply Last reply
                0
                • Ni.SumiN Offline
                  Ni.SumiN Offline
                  Ni.Sumi
                  wrote on last edited by Ni.Sumi
                  #8

                  Hi @jdent

                  Upload it at http://postimage.org/ here share the link. Or do share through dropbox .

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    jdent
                    wrote on last edited by
                    #9

                    http://s20.postimg.org/n6xa59l2l/image.jpg

                    1 Reply Last reply
                    0
                    • Ni.SumiN Offline
                      Ni.SumiN Offline
                      Ni.Sumi
                      wrote on last edited by Ni.Sumi
                      #10

                      Hi @jdent

                      Be sure that you have your image and qml file are in resource (*** .qrc).
                      And code :

                      Image
                      {
                      source: "images/imageName.png"

                      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