I am using Qtcreator and always when I need to display large string, it's trimmed, see screenshot:
Is there any way to display whole QString? Note that using Open view contents in editor doesn't help either, it's same there.
In Qt Creator, you can use the left pane of the Debugger Log view for that purpose. When you press Ctrl+Enter, the contents of the line under the text cursor are sent directly to the native debugger. Alternatively, you can use the line edit at the bottom of the view. Output is displayed in the right pane of the Debugger Log view.
To open the string visualizer, you must be paused during debugging. Hover over a variable that has a plain text, XML, HTML, or JSON string value, and select the magnifying glass icon . In the string visualizer window, the Expression field shows the variable or expression you're hovering over, and the Value field shows the string value.
Also, the debugger displays access data for QFileInfo and provides access to the real contents of QVariant. Right-click in the Locals or the Expressions view to open a context menu that provides additional options for viewing data. The available options depend on the type of the current items, and are provided by the Debugging Helpers.
Tell the debugger what to show using the DebuggerDisplay Attribute (C#, Visual Basic, F#, C++/CLI) The DebuggerDisplayAttribute controls how an object, property, or field is displayed in the debugger variable windows. This attribute can be applied to types, delegates, properties, fields, and assemblies.
There is a setting under "Tools -> Options -> Debugger -> (Locals & Expressions or General (depending on your creator version))" that limits the string length to default 10000 characters.
This is the best answer: https://stackoverflow.com/a/52298088/9256941
"In Local and Expressions, right click on the variable and click on Change Value Display Format, then under Change Display for type QString click on Separate Window"
Seems to be a limitation of the Qt Creator UI that cuts the displayed length of strings.
qDebug() << yourString;
seems to work for me, I can see my whole string in the application output panel :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With