Results 1 to 3 of 3

Thread: copy the file from the filedialog and paste into into a different directory

  1. #1
    Join Date
    Dec 2011
    Location
    Bangalore,India
    Posts
    38
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default copy the file from the filedialog and paste into into a different directory

    Hi,

    i just want to copy a csv file from source- desktop(example)(the file is free from all the permissions) by selecting the file from the selection window using QFileDialog the file selected must be copied into a new location(directory) after clicking the Ok button from the file dialog.

    Any one please let me know how to proceed with it. ica just able to open the file dialog and select the file.

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: copy the file from the filedialog and paste into into a different directory

    QFile::copy().

    Cheers,
    _

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

    kulsekarr (3rd February 2015)

  4. #3
    Join Date
    Apr 2013
    Location
    Prague
    Posts
    258
    Thanks
    3
    Thanked 65 Times in 59 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: copy the file from the filedialog and paste into into a different directory

    Please, read the documentation first. As anda_skoa has noticed, copying files: QFile::copy(). As to the dialogs, there are predefined dialogs QFileDialog::getOpenFileName() and QFileDialog::getSavedFileName(). The dialogs are static methods of QFileDialog, you don't need to add anything, just call them.

  5. The following user says thank you to Radek for this useful post:

    kulsekarr (3rd February 2015)

Similar Threads

  1. Replies: 1
    Last Post: 5th May 2011, 04:47
  2. Replies: 2
    Last Post: 15th July 2010, 13:45
  3. copy and paste
    By hubipet in forum Qt Tools
    Replies: 1
    Last Post: 17th July 2009, 07:19
  4. using cut(), copy(), paste()
    By systemz89 in forum Newbie
    Replies: 5
    Last Post: 18th December 2007, 15:47
  5. Replies: 4
    Last Post: 24th February 2006, 11:30

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.