How do I display a integer value ( from a function) in a TextEdit box in Qt? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do I display a integer value ( from a function) in a TextEdit box in Qt?

I have a TextEdit box in my Qt GUI and I'm trying to display an integer value in it from a function when a button is pressed in the GUI. My person class has Age as a private data member and has public getters and setters. setText only takes QString as an argument https://code.sololearn.com/cvJcB0D69dYI/?ref=app

16th Apr 2018, 4:46 PM
Dylan
1 Answer
0
You can create a QString from a std::string, with that method you can use std::to_string to convert an int to a string and then to a QString
21st Jan 2019, 10:26 PM
Abel Louis
Abel Louis - avatar