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. Debugging in Qt program in Qt Creator
Forum Updated to NodeBB v4.3 + New Features

Debugging in Qt program in Qt Creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 237 Views 1 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.
  • Swati777999S Offline
    Swati777999S Offline
    Swati777999
    wrote on last edited by
    #1

    Hi All,

    I have recently started learning Qt and using Qt Creator IDE. I would like to know ways to debug a program [apart from putting commands for display through debug() .

    Thanks in advance!

    “ In order to be irreplaceable, one must always be different” – Coco Chanel

    Pl45m4P 1 Reply Last reply
    0
    • Swati777999S Swati777999

      Hi All,

      I have recently started learning Qt and using Qt Creator IDE. I would like to know ways to debug a program [apart from putting commands for display through debug() .

      Thanks in advance!

      Pl45m4P Online
      Pl45m4P Online
      Pl45m4
      wrote on last edited by
      #2

      @Swati777999

      Dont quite understand your question.
      You debug by starting your debugger... set breakpoints, check function calls / stack trace or content of your pointers and variables...
      Depends on what happens. If your program crashes or if it's not doing what you expect.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by mrjj
        #3

        I have added the following to my .pro file .

        message ("removed all subdirs here Nov 17 no differnce ")

        SUBDIRS += \
        #    ../../../../../BACKUP/CAT-28-3/PROJECTS/CAT_FT857_BLUETOOTH/CAT_FT857_BLUETOOTH_MAIN_PROJECT/TEST_MDI/TEST_MDI.promessage(:dupressdd complier warningsd  \
        #    ../../EXAMPLES_COPY_5.x/Examples/Qt-6.2.0/bluetooth/btchat/btchat.pro \
        #    ../../Examples/Qt-5.15.2/bluetooth/btscanner/btscanner.pro
        message("supress all warnings ")
        QMAKE_CXXFLAGS += -w
        #QMAKE_CXXFLAGS_WARN_OFF
        message ("verbose output compiler ")
        QMAKE_LFLAGS += -v
        message ("verbose output linker ")
        QMAKE_CXXFLAGS += -Wl, --verbose
        
        message (" disable qDebug messages")
        #//CONFIG += console
        #DEFINES += QT_NO_DEBUG_OUTPUT
        

        It is somewhat redundant or stupid , take your pick.
        I use heavily

        #ifdef BYPASS
        useless old code but sometime prevents making same mistake
        #endif

        then old stand by
        #define DEBUG

        #ifdef DEBUG
        trace / debug notes
        ....
        #endif

        Best debug tool

        for(;;)
        comment your code

        PS
        Anybody care to add how to "remove all break points", senior moment.

        PPS
        I cannot be held responsible for the messed-up text...

        1 Reply Last reply
        0

        • Login

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