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 12 Feb 2016, 00:58 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

    T 1 Reply Last reply 12 Feb 2016, 07:52
    0
    • D Offline
      D Offline
      douglas
      wrote on 12 Feb 2016, 07:24 last edited by
      #2

      have you checked if the path is correct?

      1 Reply Last reply
      0
      • J jdent
        12 Feb 2016, 00:58

        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

        T Offline
        T Offline
        tomy
        wrote on 12 Feb 2016, 07:52 last edited by tomy 2 Dec 2016, 07:54
        #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 12 Feb 2016, 18:29 last edited by jdent 2 Dec 2016, 18:30
          #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
          • T Offline
            T Offline
            tomy
            wrote on 13 Feb 2016, 09:48 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 13 Feb 2016, 21:17 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 13 Feb 2016, 21:19 last edited by
                #7

                Sorry, but how can I put the screenshot here?

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  Ni.Sumi
                  wrote on 13 Feb 2016, 21:23 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 13 Feb 2016, 21:31 last edited by
                    #9

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

                    1 Reply Last reply
                    0
                    • N Offline
                      N Offline
                      Ni.Sumi
                      wrote on 13 Feb 2016, 21:32 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

                      6/10

                      13 Feb 2016, 21:17

                      • Login

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