[Qt-interest] QDir - How to get the latest Open Directory

Aaron Lewis aaron.lewis1989 at gmail.com
Tue Apr 6 14:33:51 CEST 2010


If you want to get the path of a file (last file u opened)

Try with:

	QFileInfo::absolutePath ()

Sample Code:

    QFile file("/usr/adm/ck"); // There's Some other contruct functions
, up to you
    QFileInfo f(file);
    qDebug() << f.absolutePath();

Hope it helps ;-)

On 04/06/2010 07:58 PM, Lucas Pereira Caixeta wrote:
> Guys,
> 
> I opened a file, now I need to take the path of this file. How do I do that?
> I could just get the QDir:: HOMEPATH ();. What I needed was a "QDir::
> lastPath" where I'd get the last accessed path.
> For when I open a file and want to open another already appear the directory
> where the files are.
> 
> I'm using Linux.
> 
> Thank you for your help now.
> 
> 
> 
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest


-- 
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode



More information about the Qt-interest-old mailing list