Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved Debugging Qt source in Netbeans 8.1: how to inspect QStrings etc?

    3rd Party Software
    2
    4
    1764
    Loading More Posts
    • 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.
    • nulluse
      nulluse last edited by nulluse

      Netbeans uses gdb to debug C++ code by default.
      This https://wiki.qt.io/IDE_Debug_Helpers describes how QStrings can be supported in several IDEs, but not in gdb/Netbeans.
      This recommends creating a macro file for gdb: https://zhjxue.wordpress.com/2009/03/14/how-to-show-value-of-qstring-in-gdb/
      And this speaks of supporting Qt5 QString differences (but not other classes): http://silmor.de/qtstuff.printqstring.php

      Would be nice if Qt could put out a guide for inspecting the Qt classes in gdb, which is a kind of popular debugger.

      1 Reply Last reply Reply Quote 0
      • nulluse
        nulluse last edited by nulluse

        A somewhat related question:

        If I dump debug info using qDebug() to the Netbeans output window, it dumps w/o carriage return.
        The next line is offset to the end of the previous and everything looks like stairs running out into the right side of the screen.
        Should I append CR to every line or is there anything in configuration I should set up for CR to be added automatically?

        Looks like this:

        abc
           def
              ghi
                 etc 
        
        1 Reply Last reply Reply Quote 0
        • andr
          andr last edited by

          There is no option to globally change the end-of-line behaviour of qDebug.

          The missing interpretation of return of the carriage must be Netbeans doing. This does not happen in a normal terminal, nor in any other IDE I am aware of.

          1 Reply Last reply Reply Quote 1
          • nulluse
            nulluse last edited by

            Looks like this is Netbeans thing indeed, as it treats OS output regarding it not being able to start the program the same way.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post