Qt Forum

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

    Solved How to disable a TextField

    QML and Qt Quick
    2
    3
    1516
    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.
    • F
      Fabian Sturm last edited by

      I would like to disable a TextField depending on the value of a variable. I thought I could do something like:

      TextField {
        disabled: varname ? false : true
      }
      

      But it seems that does not exist?

      ? 1 Reply Last reply Reply Quote 0
      • ?
        A Former User @Fabian Sturm last edited by A Former User

        Hi! The property you want to use is enabled:

        TextField {
            enabled: varname ? true : false
        }
        
        1 Reply Last reply Reply Quote 1
        • F
          Fabian Sturm last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • First post
            Last post