Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt createor when I debug the program step by step, sometimes it step backward

Qt createor when I debug the program step by step, sometimes it step backward

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 546 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hanfei410
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      That is normal. :)
      It shows when destructors / clean up is called.

      1 Reply Last reply
      2
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        On a side note, you can remove that function. QFile already provides it, see the QFile::exists static method.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved