How to print more than one QStrings on QtextEdit

e-monlinux

Lets say we have a variable called X and we do some operations on it. now for printing it on the QtextEdit I want to print it like this cout on console:

cout << "The value of X is " << X << endl;

But the setText function only prints out a QString not both "the value of ... " and X.

Andreas Fester

You can use a QTextStream to write data into a QString similar to cout:

int X = 42;

QString str;
QTextStream out(&str);
out << "The value of X is " << X << endl;

qDebug() << str;

Output:

"The value of X is 42
" 

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to Print more than one page in C#

From Dev

How to print more than one div at the same time in same pdf?

From Dev

How to cat and print formatted more than one file?

From Dev

sed print more than one matches in a line

From Dev

Print more than one row in Crystal Report

From Dev

Print sums of more than one column in Linux

From Dev

Print more than one page with Printable on Java

From Dev

How can I combine two QStrings into one?

From Dev

print content of more than one file in a zip archive

From Dev

Why can't I print more than one string?

From Dev

Print more than one result in SQL Data Reader

From Dev

print more than one output for a particular condition in python

From Dev

How to load more than one div at a time

From Dev

How to output more than one column

From Dev

How to call ManagementObject with more than one parameter?

From Dev

How to use componentsSeparatedByString with more than one

From Dev

how to excute more than one for loop in xquery

From Dev

How to declare more than one option for SCNPhysicsShape

From Dev

How to index more than one entity in ApacheSolr

From Dev

How to add more than one scheme in xcodebuild?

From Dev

How to disable more than one scroll function?

From Dev

`.split()` how to save space more than one?

From Dev

How to apply javascript to more than one class?

From Dev

How to split the terminal into more than one "view"?

From Dev

How to cd into more than one directory?

From Dev

How to join more than one table rails

From Dev

How to annotate more than one value in Django

From Dev

How to use more than one shader program?

From Dev

How to require more than one cookie htaccess

Related Related

HotTag

Archive