Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. using local server path in QML
Forum Updated to NodeBB v4.3 + New Features

using local server path in QML

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 506 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.
  • F Offline
    F Offline
    filipdns
    wrote on last edited by
    #1

    Hello,

    I need to access to folder from my server with path:

    //DGS1109N007/Echanges/Affichage/Display/Messages/

    it working fine in c++
    example:

    QFile::remove"//DGS1109N007/Echanges/soft/Kardex/Databases/4967df1f72da4cc275387bc5c81774de.ini");
    

    but qml don't accept it with "file://///DGS1109N007/Echanges/Affichage/Display/Messages/image.jpg"

    I try to create string variable with:

    property string filepath:"//DGS1109N007/Echanges/Affichage/Display/Messages/image.jpg"
    

    and do:

    Image{
    source:"file:///"+filepath
    }
    

    but no success
    I need to display an Image, how can I do it please?

    Thank you very much for your help

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      @filipdns said in using local server path in QML:

      "file:///"

      Did you get a chance to use the API Qt.resolvedUrl("file:///") method ? like follows.

      source: Qt.resolvedUrl("file:///")
      

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      F 1 Reply Last reply
      2
      • dheerendraD dheerendra

        @filipdns said in using local server path in QML:

        "file:///"

        Did you get a chance to use the API Qt.resolvedUrl("file:///") method ? like follows.

        source: Qt.resolvedUrl("file:///")
        
        F Offline
        F Offline
        filipdns
        wrote on last edited by
        #3

        @dheerendra Hello, thanks it's working fine with:

        property string filepath:"//DGS1109N007/Echanges/Affichage/Display/Messages/image.jpg"
        
        source: Qt.resolvedUrl("file:"+filepath)```
        
        with Qt.resolvedUrl don't put /// after file:
        Pablo J. RoginaP 1 Reply Last reply
        0
        • F filipdns

          @dheerendra Hello, thanks it's working fine with:

          property string filepath:"//DGS1109N007/Echanges/Affichage/Display/Messages/image.jpg"
          
          source: Qt.resolvedUrl("file:"+filepath)```
          
          with Qt.resolvedUrl don't put /// after file:
          Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #4

          @filipdns if your issue is solved, please don't forget to mark you post as such! thanks.

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          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