[Qt-interest] File names from the command line

Pere Constans constans at molspaces.com
Tue Dec 9 15:55:49 CET 2008


Hi,

A Dimarts 09 Desembre 2008, Anthony Serdyukov va escriure:
> Try to play with QFileInfo somehow.

This is how I have it

QFileInfo f(arguments.at(j));          
QDir::toNativeSeparators(f.absoluteFilePath());

but it doesn't work. I tried QDir also. No luck either.

The thing is that (non-native) QFileDialog does convert it (
selectFile()) and returns the expanded strings. So, the functionality is 
there, somewhere in the library... but I don't know how to get it from the 
API.


> > When an application receives the file name from the command line, in
> > Windows,
> > the string is in upper case letters, and abbreviated with ~ characters. I
> > use
> > this file name to set the window title, so it doesn't look much
> > aesthetic.
> >
> > Is there any way to convert this name to a more readable string,
> > from  'C:DOCUMENTS~\...' to 'C:\Documents and Settings\...' ?




More information about the Qt-interest-old mailing list