[Qt-interest] FileFilter
Predrag Manojlovic
pedjaman at gmail.com
Wed Oct 28 16:02:31 CET 2009
Hi,
Yes i tried that but that is bad approach. Here is explanation:
If user type name without extension, dialog won't warn for overwrite if
file with extension exists. He will check if file without extension
exists. So, if i modify file name after dialog returns by adding
extension I must check again if file with new name exists and redisplay
Save dialog again or something.
That looks bad in application and makes people confused. In almost all
windows systems (Win, X11, osx) is possible to force extension natively
so i guess such flag is missing here.
Main problem is checking for overwrite.
Any solution for this?
Regards
Predrag
André Somers wrote:
> Hi,
>
> The purpose is at least that you can easily view the other files with the
> same extension in the folder you want to save to. Seriously, how hard is it
> to check the returned file name and make sure that it ends on the filtered
> extension after the dialog returns? I'll tell you: it's a one liner (ok,
> two, if you like that code layout better).
>
> André
>
>
> -----Oorspronkelijk bericht-----
> Van: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] Namens Predrag Manojlovic
> Verzonden: woensdag 28 oktober 2009 1:32
> Aan: qt-interest at trolltech.com
> Onderwerp: Re: [Qt-interest] FileFilter
>
> I think he ahs same problem like me:
>
> How to force dialog to extension specified in filter? If you type file
> name without extension... filter is ignored and file is saved without
> extension. What's the purpose of filter then?
>
> Regards
> Predrag
>
> Malyushytsky, Alex wrote:
>>>> fileDialog.setNameFilter("*.dat");
>> Your answer is not answering his question.
>> He wants to use static getSaveFileName, which does not even give you a
> pointer to the QFileDialog object, so he can't use setNameFilter.
>> But the answer is still given in documentation.
>>
>> Regards,
>> Alex
>>
>> -----Original Message-----
>> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Robert McVicar
>> Sent: Friday, March 20, 2009 5:16 AM
>> To: Sujan Dasmahapatra
>> Cc: qt-interest at trolltech.com
>> Subject: Re: [Qt-interest] FileFilter
>>
>> fileDialog.setNameFilter("*.dat");
>>
>> This information is available at
>> http://doc.trolltech.com/4.4/qfiledialog.html
>>
>>
>> Sujan Dasmahapatra wrote:
>>> QString fileName = QFileDialog::getSaveFileName(this);
>>>
>>>
>>>
>>> I am getting the file dialog using the above code but, I want to put a
>>> file filter with *.dat.So only the .dat files I want how would I put
>>> a file filter ?
>>>
>>> Can anyone tell me plss..
>>>
>>>
>>>
>>>
>>>
>>> Kind regards,
>>> LM Glasfiber R&D (India) Pvt. Ltd.
>>>
>>> Sujan Dasmahapatra
>>> Project Engineer - CFD
>>>
>>> Telephone: +91 80 66470248
>>> Mobile:
>>> E-mail: sdh at lmglasfiber.com <mailto:sdh at lmglasfiber.com>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --------------------------------------------------------------
>>>
>>> This e-mail and any attachments are confidential. If you are not the
>>> named or intended recipient, please notify the sender immediately and
>>> do not disclose the contents to any other person, use it for any
>>> purpose or store or copy the information in any medium. Any
>>> unauthorized disclosure, use or storage is prohibited and might be
>>> unlawful.
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>
>> This email and any files transmitted with it are confidential and are
> intended solely for the use of the individual or entity to whom they are
> addressed. If you are not the original recipient or the person responsible
> for delivering the email to the intended recipient, be advised that you have
> received this email in error, and that any use, dissemination, forwarding,
> printing, or copying of this email is strictly prohibited. If you received
> this email in error, please immediately notify the sen
>> der and delete the original.
>>
>>
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>>
> ----------------------------------------------------------------------------
> -----------------------
>> Weidlinger Associates, Inc. made the following annotations.
>>
>> "This message and any attachments are solely for the intended recipient
> and may contain confidential or privileged information. If you are not the
> intended recipient, any disclosure, copying, use, or distribution of the
> information included in this message and any attachments is prohibited. If
> you have received this communication in error, please notify us by reply
> e-mail and immediately and permanently delete this message and any
> attachments. Thank you."
>> "Please consider our environment before printing this email."
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list