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. [SOLVED]File path in QML
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]File path in QML

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 2.2k 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.
  • J Offline
    J Offline
    Javeria
    wrote on last edited by
    #1

    I'm displaying the images using list
    @property var imagesListModel: ["file:/original.jpg","file:/11.jpg","file:/test (1).jpg","file:/test (2).jpg","file:/test (3).jpg","file:/test (4).jpg","file:/test (5).jpg"]
    @
    This works if the the images are in the C: file but i cant display the images if i use the path of these images directly
    like in C: which i need to fix as i have to save the image of this path in a QImage object, is there nay way i can ifx these problem?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      clochydd
      wrote on last edited by
      #2

      Hi,
      how do you use the pathname?
      You should use slash /, not backslash . "file:///c:/images/original.jpg"

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Javeria
        wrote on last edited by
        #3

        yeh i use the same slash / its works for D: disk but not C:

        1 Reply Last reply
        0
        • C Offline
          C Offline
          clochydd
          wrote on last edited by
          #4

          Can you post both variables - for C: and D:?

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Javeria
            wrote on last edited by
            #5

            ITs works now if i use file:/ and then C: s path, Thanks!

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dasRicardo
              wrote on last edited by
              #6

              Please add [SOLVED] to your thread titles of all your solved threads.

              **Sorry for my english :)

              PLEASE ADD [SOLVED] TO YOUR THREAD TITLE IF IT'S SOLVED.**

              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