how to converting an int to a QString?
-
wrote on 2 Sept 2016, 13:43 last edited by
Hello there, i need a call of QLabel.setText() which displays an int type.
I have tried:my_label->setText( QString(std::to_string(my_int)));
and got this error message:/home/sven/develop/Qt/tictactoe/configurationdialog.cpp:40: error: no matching function for call to ‘QString::QString(std::__cxx11::string)
I have no clue how i could convert ad hoc from 'int' to 'QString'.
^
-
Hello there, i need a call of QLabel.setText() which displays an int type.
I have tried:my_label->setText( QString(std::to_string(my_int)));
and got this error message:/home/sven/develop/Qt/tictactoe/configurationdialog.cpp:40: error: no matching function for call to ‘QString::QString(std::__cxx11::string)
I have no clue how i could convert ad hoc from 'int' to 'QString'.
^
-
wrote on 2 Sept 2016, 13:49 last edited by
Thanks. I should dive deeper into Qt Core facilities :)
-
wrote on 2 Sept 2016, 14:07 last edited by
@raven-worx
Should be rather
QString::setNum(), or at my case: QLabel::setNum() -
wrote on 2 Sept 2016, 14:13 last edited by
<Rude>http://bfy.tw/7VrJ</Rude>
-
<Rude>http://bfy.tw/7VrJ</Rude>
wrote on 2 Sept 2016, 17:09 last edited bySorry, I've overlooked the static section of QString doc. :-(
1/6