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. How to disable a TextField
QtWS25 Last Chance

How to disable a TextField

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 2.8k Views
  • 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 Offline
    F Offline
    Fabian Sturm
    wrote on last edited by
    #1

    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
    0
    • F Fabian Sturm

      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?

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by A Former User
      #2

      Hi! The property you want to use is enabled:

      TextField {
          enabled: varname ? true : false
      }
      
      1 Reply Last reply
      1
      • F Offline
        F Offline
        Fabian Sturm
        wrote on last edited by
        #3
        This post is deleted!
        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