Results 1 to 4 of 4

Thread: Creating a new folder in QML

  1. #1
    Join Date
    May 2013
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Android

    Red face Creating a new folder in QML

    Hi friends,
    I want to create a new folder in Qml…So i found out it via Qt…..so i want to integrate this below Qt C++ with Qml…..How is it possible…

    QDir dir(“path/to/dir”);
    if (!dir.exists()) { dir.mkpath(”.”);
    }
    Or else,is there any options for creating new folder directly in Qml…Please suggest a solutions.Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Creating a new folder in QML

    QML has no direct access to the filesystem. If you need such functionality you have to expose it to the QML engine from C++.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2013
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Android

    Red face Re: Creating a new folder in QML

    Quote Originally Posted by wysota View Post
    QML has no direct access to the filesystem. If you need such functionality you have to expose it to the QML engine from C++.
    Sorry for late reply Mr.Wysota.I have tried only by passing strings,but i don't know how to do it...Can u please show me example..

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Creating a new folder in QML

    Create a subclass of QObject and expose all the functionality you need as slots of the subclass. Then expose the object to QML engine's root context using QQmlContext::setContextProperty().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 0
    Last Post: 13th October 2010, 04:27
  2. Replies: 5
    Last Post: 21st May 2010, 01:48
  3. My qt folder is so big!!!Help
    By chinaeli in forum Newbie
    Replies: 3
    Last Post: 22nd January 2010, 10:22
  4. Replies: 1
    Last Post: 19th January 2010, 21:35
  5. Create folder
    By vishesh in forum Qt Programming
    Replies: 1
    Last Post: 13th March 2007, 21:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.