TypeError: Type error ?

  • Hello I've this problem, the code below generate the error in object but all data types are absolutly the same (int with int and string with string) no visible type conflict, any ideas?

    if(phoneCompositionNumber.number_inputted < phoneCompositionNumber.max_character_input){
    /Update string when character pressed/
    phoneCompositionNumber.string_textbox = phoneCompositionNumber.string_textbox.substring(0,phoneCompositionNumber.position_cursor) + toString(btnText) + phoneCompositionNumber.string_textbox.substring(phoneCompositionNumber.position_cursor, phoneCompositionNumber.string_textbox.length)
    /Update position cursor/
    /Update string display plus display pointer textbox/
    console.log(phoneCompositionNumber.string_textbox+" + "+phoneCompositionNumber.position_cursor)
    phoneCompositionNumber.textbox.text = phoneCompositionNumber.string_textbox
    phoneCompositionNumber.textbox.cursorPosition = phoneCompositionNumber.position_cursor
    phoneCompositionNumber.number_inputted ++

  • Moderators


    Can you tell what is the exact line no. where the error occurs ?
    It must have been printed in the console before Type Error. Some thing like this
    Test.qml:28: TypeError: Type error

  • 10 and 11

  • Moderators

    Ok, Questions:

    1. What is position_cursor and number_inputted ?
    2. What are its Data Types ?
    3. How are they declared ?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.