How to convert int to QString?

后端 未结 8 857
面向向阳花
面向向阳花 2021-01-29 18:36

Is there a QString function which takes an int and outputs it as a QString?

8条回答
  •  广开言路
    2021-01-29 18:46

    In it's simplest form, use the answer of Georg Fritzsche

    For a bit advanced, you can use this,

    QString QString::arg ( int a, int fieldWidth = 0, int base = 10, const QChar & fillChar = QLatin1Char( ' ' ) ) const
    

    Get the documentation and an example here..

提交回复
热议问题