How to convert QString to int?

前端 未结 7 1965
执念已碎
执念已碎 2021-02-01 12:10

I have a QString in my sources. So I need to convert it to integer without \"Kb\".

I tried Abcd.toInt() but it does not work

7条回答
  •  一向
    一向 (楼主)
    2021-02-01 12:31

    On the comments:

    sscanf(Abcd, "%f %s", &f,&s);
    

    Gives an Error.

    This is the right way:

    sscanf(Abcd, "%f %s", &f,qPrintable(s));
    

提交回复
热议问题