Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

how to get int value from QString data



  • hi!

    i have QString data :
    test.cpp:131: error: ?testFunc01? was not declared in this scope
    test.cpp:17: error: variable or field ?_temp? declared void
    test.cpp:82: error: two or more data types in declaration of ?testFunc01?
    etc..

    and i want int value : 131, 17, 82 -is line number

    how to get line number value?



  • Hi @taek-seo,

    and i want int value : 131, 17, 82 -is line number

    Something like:

    int lineNumber = lineString.split(':').at(1).toInt();
    

    Of course you should do some error / bounds checking too.

    Cheers.



  • thank you so much!!


Log in to reply