Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved how to get int value from QString data

    General and Desktop
    2
    3
    491
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • taek seo
      taek seo last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • P
        Paul Colby last edited by

        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.

        1 Reply Last reply Reply Quote 1
        • taek seo
          taek seo last edited by

          thank you so much!!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post