Question

I have QMessageBox defined as

m_setting2 = new QMessageBox();
m_setting2->setWindowTitle("NOTE");
m_setting2->setText("RESETTING PREFERENTIAL VALUE TO ");
m_setting2->show();

where m_setting2 is my QMessageBox*.

Now after VALUE TO in setText I want to add an argument which is an integer taken from QLineEdit. This integer is stored in valuee.

So how can i print that integer after VALUE TO.

Somewhere I saw that it should be something like QString.("%1").arg(valuee) but it's not working.

Please help me out and thanks for any type of concern.

Was it helpful?

Solution

int value = 5;
QString text = QString("RESETTING PREFERENTIAL VALUE TO %1").arg(value);
m_setting2->setText(text);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top