Results 1 to 4 of 4

Thread: Copying a file

  1. #1
    Join Date
    Sep 2009
    Posts
    34
    Thanks
    28
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Copying a file

    Hi there folks,

    Just wondering how can copy a file from a given location (a given path), to another using Qt?

    Sample code would be highly appreciated.

    Thanks in advance,

    Nefastious

  2. #2
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Thanks
    38
    Thanked 19 Times in 19 Posts
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: Copying a file

    Check QFile

  3. The following user says thank you to jano_alex_es for this useful post:

    Nefastious (26th October 2009)

  4. #3
    Join Date
    Aug 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Copying a file

    Qt Code:
    1. QFile file(put your file name which one want to copy);
    2. file.copy(put your file name with directory where u want to place else it will save in current directory);
    To copy to clipboard, switch view to plain text mode 
    Kavin

  5. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Copying a file

    Quote Originally Posted by kavinsiva View Post
    Qt Code:
    1. QFile file(put your file name which one want to copy);
    2. file.copy(put your file name with directory where u want to place else it will save in current directory);
    To copy to clipboard, switch view to plain text mode 
    actually, there is static function QFile::copy.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Read binary from file
    By weldpua2008 in forum Newbie
    Replies: 2
    Last Post: 3rd April 2009, 23:50
  2. Can you specify a file engine?
    By skimber in forum Qt Programming
    Replies: 2
    Last Post: 18th September 2008, 15:54
  3. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  4. Replies: 2
    Last Post: 5th September 2007, 22:31
  5. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21

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.