Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Loading image with Qmlscene
Forum Updated to NodeBB v4.3 + New Features

Loading image with Qmlscene

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 903 Views 1 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.
  • G Offline
    G Offline
    Guigiidre
    wrote on last edited by
    #1

    Hi all, I don't understand why when I try to run a simple qml file with the qml scene tool , I have the message "cannot open file://..."
    but when I run the c++ code loading the qml with the Qml Application Engine, everything is oK.

    Is it impossible to display images with the qml scene ?

    Thank you in advance for your answer.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Are you sure the paths are correct? Do you run qmlscene and your app from the same working directory?

      (Z(:^

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Guigiidre
        wrote on last edited by
        #3

        I run qmlscene from c:\Qt\5.11.3\mingw53\bin
        my working directory is in C:\REPO\test\build-test_qmlscene-Desktop_Qt_5_11_3_MinGW_32bit-Debug
        Which path do I have to change ?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Run qmlscene from C:\REPO\test\build-test_qmlscene-Desktop_Qt_5_11_3_MinGW_32bit-Debug, same as you run your app. Or add that folder to QML import path using -I flag. More info: https://doc.qt.io/qt-5/qtquick-qmlscene.html

          That is assuming that you are using relative paths to load QML. If you're using QRC qmlscene won't work.

          (Z(:^

          1 Reply Last reply
          0
          • G Offline
            G Offline
            Guigiidre
            wrote on last edited by
            #5

            I have added import ' . ' at th beginning of the qml file and now it works !

            @sierdzio thank you for your help

            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