Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: QT
Hi All,
 
I am using QFileDialog::getSaveFileName method to get a save dailog. It asks for new file name. When i give "abc:c" as a file name it pops up a message stating "The file name is invalid. But in case if i give file name as "abc?c" or "anc*c". It doesn't give any error. Though the dialog doesn't accept that input file name but it doesn't give any error.
 
Please let me know what can i do to get a error message in case of "abc?c" or "anc*c" as a file name.
 
Thanks in advance
Posted 27-Sep-12 22:06pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I would guess that is because the ? and * are used as wild-card indicators in filenames. You would need to test for them yourself.
  Permalink  
Comments
sourabhmehta at 28-Sep-12 4:43am
   
Thanks for the reply.
I agree with your explanation, But how can i check for existence of ? or *. Since this QT widget itself takes care of other invalid characters. Moreover in case of ? or * characters the dialog doesn't return anything. Otherwise i would have checked for these characters in the returned string.
 
Do you have any idea how can i achieve this.
Richard MacCutchan at 28-Sep-12 5:06am
   
This is an issue with Windows, as I said above. I have just tried something similar using a simple Win32 program and the ? in the name just restricts the dialog to showing any names which match. The user must then select a specific name to get the dialog to proceed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Kornfeld Eliyahu Peter 265
1 Sergey Alexandrovich Kryukov 202
2 George Jonsson 185
3 King Fisher 185
4 CPallini 155
0 OriginalGriff 6,223
1 DamithSL 4,724
2 Maciej Los 4,196
3 Kornfeld Eliyahu Peter 3,894
4 Sergey Alexandrovich Kryukov 3,496


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 28 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100