×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2012
    Posts
    3

    Copying files in QML

    Hi! How to copy for example c:/text.txt to e:/example_folder/text.txt in QML? Please send example code if you can

  2. #2
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,025

    Re: Copying files in QML

    I don't think that is allowed in QML but definitely in your Qt code you can do so : http://doc.qt.digia.com/4.7/qfile.html#copy

  3. #3
    Registered User
    Join Date
    Dec 2012
    Posts
    3

    Re: Copying files in QML

    Ok, thanks you very much :-)
    Is possible to copy all folders? No only one files?

  4. #4
    Registered User
    Join Date
    Jun 2012
    Posts
    43

    Re: Copying files in QML

    check the StringHelper example to know how to access Qt/C++ functions from a QtQuick UI.

    If you use this example add a function like:

    Q_INVOKABLE void copy(QString source, QString target)
    {
    QFile::copy(source, target);
    }

    and paste #include <QFile> in your header.

    Now you can copy like this:
    onClicked: StringHelper.copy("C://data/Test.txt", "C://data/Test2.txt")

    really easy.
    I wrote an simple helper class for QtQuick, but I am not sure, maybe it not allowed to post here.

    Check: http://forum.symbian-developers.net/...s-for-qtquick/

Similar Threads

  1. Copying files from PC to phone
    By eugbug in forum General Development Questions
    Replies: 0
    Last Post: 2009-06-11, 21:33
  2. copying files during startup.
    By e_prakhar in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2006-12-19, 11:42
  3. Files Copying Monitor
    By tslu69 in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2005-10-25, 03:51
  4. copying files between nokia 9500 and windows
    By mario09 in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2005-05-24, 10:57
  5. Copying sound files
    By daredevilWin in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2005-05-18, 16:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×