Qt createor when I debug the program step by step, sometimes it step backward
Unsolved
General and Desktop
-
My environment is windows 10, Qt creator 4.6.2, the compiler is minGW 32 bit , when I debug my program , when it runs into the follow function, :
static bool FileIsExist(QString strFile) { QFile tempFile(strFile);**//Line 1** return tempFile.exists();**//Line 2** }
the program execute sequence is Line1 ---> Line2------>Line1----> Line2, and this cause the function return false value, why this happen , waitting for your help
-
Hi
That is normal. :)
It shows when destructors / clean up is called. -
Hi and welcome to devnet,
On a side note, you can remove that function.
QFile
already provides it, see the QFile::exists static method.