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. How to trace the instructions of the code in Qt Creator
Forum Updated to NodeBB v4.3 + New Features

How to trace the instructions of the code in Qt Creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 4 Posters 3.1k Views 3 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.
  • tomyT Offline
    tomyT Offline
    tomy
    wrote on last edited by
    #1

    Hi all,
    Using Visual Studio we could trace each line of the code in C++ to find out the source of a problem. Is these any possibility in Qt Creator please?

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

      Hi,

      Do you mean the debugger ?

      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
      • tomyT Offline
        tomyT Offline
        tomy
        wrote on last edited by
        #3

        Hi,

        Yes I think.
        We would use the Debug tab of VS 2015, F11, F10 for step-over and step-into.

        jsulmJ 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Then you have to install the debugging tools provided from the Microsoft web site. Visual Studio comes with an "integrated debugger" that you can't use from the outside.

          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
          • tomyT tomy

            Hi,

            Yes I think.
            We would use the Debug tab of VS 2015, F11, F10 for step-over and step-into.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @tomy Yes, you can debug in QtCreator. If you're using MinGW Qt version then you already can debug. If you're using Microsoft C++ compiler then, as @SGaist said, you first need to install debugging tools from Microsoft.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2
            • tomyT Offline
              tomyT Offline
              tomy
              wrote on last edited by
              #6

              Thank you two.
              Yes I use MinGW and F10 and F11 work but not as expected!
              I can't trace the lines of code. :(
              I have few functions in My_First_Calculator.cpp that I want to trace the code lines of one method of it but whenever I press F10 or F11 no lines will be traced. That is, it seems useless.
              How do you trace your codes please?

              jsulmJ 1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Silly question but are you using a debug build ?

                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
                0
                • tomyT tomy

                  Thank you two.
                  Yes I use MinGW and F10 and F11 work but not as expected!
                  I can't trace the lines of code. :(
                  I have few functions in My_First_Calculator.cpp that I want to trace the code lines of one method of it but whenever I press F10 or F11 no lines will be traced. That is, it seems useless.
                  How do you trace your codes please?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @tomy So, you place a break point and start debugging with F5? And it does not stop at the breakpoint? Or it stops there but F10/11 does not work? Or what? Your description is unclear.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • tomyT Offline
                    tomyT Offline
                    tomy
                    wrote on last edited by
                    #9

                    Sorry guys, I'm so new in Qt. I apologize for bothering.

                    I just when into the function I would want to trace its lines and the pressed F11 and F10 like these.

                    But apparently I should run the app using F5. Is it right? If so how to place a break point? I don't know this?
                    And will it this way be possible to see the values of variables e.g., chars, string, ints and etc?

                    FlotisableF 1 Reply Last reply
                    0
                    • tomyT tomy

                      Sorry guys, I'm so new in Qt. I apologize for bothering.

                      I just when into the function I would want to trace its lines and the pressed F11 and F10 like these.

                      But apparently I should run the app using F5. Is it right? If so how to place a break point? I don't know this?
                      And will it this way be possible to see the values of variables e.g., chars, string, ints and etc?

                      FlotisableF Offline
                      FlotisableF Offline
                      Flotisable
                      wrote on last edited by
                      #10

                      @tomy
                      to place a breakpoint, just click the left of editor's line number, it will show a red point.
                      and I think you can read official document about debug mode

                      1 Reply Last reply
                      1
                      • tomyT Offline
                        tomyT Offline
                        tomy
                        wrote on last edited by
                        #11

                        Yeah I think I found most of the things.
                        But another question: Is a QStringList in Qt equivalent to stringstream in C++?

                        jsulmJ FlotisableF 2 Replies Last reply
                        0
                        • tomyT tomy

                          Yeah I think I found most of the things.
                          But another question: Is a QStringList in Qt equivalent to stringstream in C++?

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by jsulm
                          #12

                          @tomy No. QStringList is a list of strings, same as QList<QString>.
                          http://doc.qt.io/qt-5.7/qtextstream.html

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          1
                          • tomyT tomy

                            Yeah I think I found most of the things.
                            But another question: Is a QStringList in Qt equivalent to stringstream in C++?

                            FlotisableF Offline
                            FlotisableF Offline
                            Flotisable
                            wrote on last edited by
                            #13

                            @tomy
                            QStringList is inherited from QList<QString>, it does not have relationship with stream.
                            read QStringList document for more information.
                            I'm not familiar with stringstream, but maybe QTextStream is a choice.

                            by the way, the question is not related to the topic

                            1 Reply Last reply
                            1

                            • Login

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