Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. TypeError: Type error ?
Forum Updated to NodeBB v4.3 + New Features

TypeError: Type error ?

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 4.8k Views 1 Watching
  • 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.
  • P Offline
    P Offline
    Parisdue
    wrote on last edited by
    #1

    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?

    @//phoneCompositionNumber.
    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/
    phoneCompositionNumber.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 ++
    }@

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      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
      @

      157

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Parisdue
        wrote on last edited by
        #3

        10 and 11

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          Ok, Questions:

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

          157

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved