[Qt-interest] Strange problem with QFile
邵度
shao.tu at gmail.com
Tue Jul 7 03:55:37 CEST 2009
You specify a relative path instead of a absolute path in QFile constructor.
So, the exact path is determined by your current working directory.
2009/7/7 Patric <userqt at gmail.com>
> Another thing I have noticed...
> My installation creates a shortcut on my Desktop.
>
> It seems that when I run the program from the shortcut, QFile makes the
> file on the Desktop. When I run it from the exe in the installation folder,
> it will make the file in that directory.
>
> Any ideas how to avoid this ??
>
> Best regards,
> Patric
>
> ----- Original Message -----
> *From:* Patric <userqt at gmail.com>
> *To:* qt-interest at trolltech.com
> *Sent:* Tuesday, July 07, 2009 4:35 AM
> *Subject:* Strange problem with QFile
>
> Hi,
> I have strange problem here.
>
> QFile devicesFile(devices.txt);
>
> I use this to create a file. When I start my program from QT Creator, the
> file is saved in the workspace\Project\debug or release folder. So it's not
> a problem.
>
> But when I made my installation package, this file is now saved on my
> desktop instead of my program installation directory.
> Does anyone know where might be the reason for this ?
>
> Regards,
> Patric
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090707/868b69bf/attachment.html
More information about the Qt-interest-old
mailing list