2

In my code, I found one qDebug()<<s; didn't output the content given to it. It's very strange, so I output s.length(). It says 135254, so I'm wondering whether there is a limitation of length which is shorter than 135254? I have read the source header and do not find the result.

zzy
  • 1,771
  • 1
  • 13
  • 48
  • I am not sure about any size restriction I have printed larger json data using qDebug. Just my thought. I understand qDebug output will get truncated when '\0' character is encountered. You could check if your variable s contains that character. – Mugunth Jul 31 '15 at 02:06
  • @Mugunth The s I output is QString, I thinks it has no problem. – zzy Jul 31 '15 at 02:12
  • 1
    Try it out. It'll be faster than waiting for an answer. And then you get to post your own answer and get sweet, sweet upvotes :) – Kuba hasn't forgotten Monica Jul 31 '15 at 12:30

1 Answers1

1

i noticed something similar...

This might narrow it down a bit (using Qt 5.5.1 with Windows mingw):

45000 character trace did not show up in qDebug.

10000 character trace did show up in qDebug.

I was able to qDebug my 45000 characters as 5 separate qDebug calls, each was something like this:

qDebug()<<foo.mid(20000, 10000);

then piece them together in a text editor. it may have been a little nicer to use qDebug's noQuotes feature too, but i don't need to run my script again today so I'm not prettying it up right now.

SketchBookGames
  • 464
  • 8
  • 14
  • The most strange thing is that it output all content (135254 length) after that day, I didn't change any words of my code. – zzy Mar 29 '16 at 01:10