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. Access default image path

Access default image path

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 2.0k 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.
  • C Offline
    C Offline
    csgib
    wrote on last edited by
    #1

    Hi,
    I search how access the pathname on the default folder of image with qml ? For an example i have used a camera + video output to capture an image. By default the program save the picture in the default directory on the OS, linux, android, etc ....

    But i would like to know the default path. I see the QStandardPaths but don't understand hos use it.

    Thanks

    Stéphane

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean you don't know how to use it from QML ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        csgib
        wrote on last edited by
        #3

        Hi,

        Exactly. finally find a solution from main.cpp , but i hope there is a solution directly from qml and not using c++. See what i find :

            const QStringList imgloc = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation);
            QUrl wlimgloc;
        
            wlimgloc = QString("%1").arg(imgloc.first());
        
            QQmlApplicationEngine engine;
        
            engine.rootContext()->setContextProperty("montoto", wlimgloc);
            engine.load(QUrl(QLatin1String("qrc:/main.qml")));
        

        Thanks

        Stéphane

        1 Reply Last reply
        1
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Since 5.8 there's the StandardPaths QML Type.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2

          • Login

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