Results 1 to 4 of 4

Thread: qDebug - how to avoid CRCL (newline character)?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: qDebug - how to avoid CRCL (newline character)?

    Thanks!

    1. What if I have got several different things which I'd like to output to qDebug? Those are in different parts of the code but are short enough to be stored in one single line. In other words, is there any way to write "qDebug << backspace_character" in order to delete CR/CL characters of new line?

    2. And the second question, more connected with object-oriented programming. I've got files created automatically by QT Creator: main.cpp, mainwindow.h, mainwindow.cpp. There are also files which I have added: mydata.h, mydata.cpp. In the file mydata.cpp I have function breadth() for breadth search algorithm. I use qDebug() inside this breadth() function. However I use it many times in different places of the code. What if I wanted to use one function, e.g. showDebugInfo(variables which are declared inside the breadth function to be given by reference) and call it inside breadth() function? I mean, where should I declare this showDebugInfo(...) function? (Because it would be like function called from inside the function which is method of the class - it makes me confused). And how to give those other variables as reference to that function? I've got such a code at this moment:

    Qt Code:
    1. qDebug() << "Value of n = " << n;
    2. qDebug() << "distances: " << distances;
    3. //...
    To copy to clipboard, switch view to plain text mode 

    where distances is QList<int> distances; and there are more lists like this in my qDebug part of the code.

    Regards!
    Last edited by johnyjj2; 16th January 2011 at 10:17.

Similar Threads

  1. about newline
    By drizzlefsh in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2009, 18:21
  2. Character by Character (Unicode?) File Reading
    By mclark in forum Qt Programming
    Replies: 4
    Last Post: 22nd April 2009, 15:28
  3. How to read QStringList character by character
    By iamjayanth in forum Qt Programming
    Replies: 4
    Last Post: 3rd April 2009, 11:25
  4. QTextBrowser NewLine
    By QbelcorT in forum Qt Programming
    Replies: 1
    Last Post: 17th January 2009, 08:34
  5. Windows newline
    By indifference in forum Qt Programming
    Replies: 1
    Last Post: 29th August 2007, 01:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.