QFileInfo problem

15 views
Skip to first unread message

Luigi Ferraris

unread,
Apr 2, 2016, 10:26:58 AM4/2/16
to QtContribs
Hi Pritpal,
I found a problem using QFileInfo. I have coded
LOCAL oFileInfo
oFileInfo := QFileInfo( "
the_name_of_the_file" )
? hb_ValToExp( oFileInfo:exists() )


last row show false but the_name_of_the_file (I'm sure) exists; it is in the same path of the program.

So I try this code
LOCAL oFileInfo
oFileInfo := QFileInfo(
)
oFileInfo:setFile( "the_name_of_the_file" )
? hb_ValToExp( oFileInfo:exists() )

last row show true as expected.

Can be due to argument conversion? I'm speaking about hb_parstr_utf8 into the QFileInfo.qth constructor.
Instead setFile is coded as void setFile ( const QString & file ) perhaps conversion is done somewhere (I don't know); I only see this difference.

Regards
Luigi Ferraris
Reply all
Reply to author
Forward
0 new messages