Results 1 to 1 of 1

Thread: Adding my own file deletion method to QFileDialog.getSaveFileName

  1. #1
    Join Date
    Jan 2018
    Posts
    1
    Qt products
    Platforms
    MacOS X Unix/X11 Windows

    Default Adding my own file deletion method to QFileDialog.getSaveFileName

    I'm writing a plugin for QGis (a geospatial software), using PyQT4
    I need to let the user save its processing result to a "shapefile", and the dialog should propose to overwrite the filename if it already exists.

    The output file format is "shapefile" which is made of 3 or more files with different extension (*.shp, *.shx, *.dbf).
    The problem is that QFileDialog.getSaveFileName detects if the file "*.shp" exists, and proposes to delete it, which creates problem.
    I would like to overload the existing deleteFile method with my own method to check if the file is not already open in the software, and which files to delete if not already open.

    My question is:
    - can I implement my own delete function
    - can I have an example?

    Bruno
    Last edited by bubu.italia; 23rd January 2018 at 16:22. Reason: to mention I'm using PyQt4

Similar Threads

  1. QFileDialog::getSaveFileName doesn't show file name.
    By cydside in forum Qt Programming
    Replies: 3
    Last Post: 23rd July 2009, 11:18
  2. problem with QFileDialog::getSaveFileName
    By navi1084 in forum Qt Programming
    Replies: 4
    Last Post: 26th June 2009, 08:38
  3. Replies: 6
    Last Post: 17th April 2009, 11:09
  4. Replies: 2
    Last Post: 28th March 2009, 11:11
  5. file name returned by QFileDialog::getSaveFileName()
    By Lexrst in forum Qt Programming
    Replies: 2
    Last Post: 20th June 2008, 17:38

Tags for this Thread

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.