Qt Forum

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

    Solved PlaceHolder in ComboBox

    QML and Qt Quick
    combobox placeholder
    1
    2
    675
    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.
    • G
      gabor53 last edited by

      Hi,
      Is there an easy way to add placeholder text to a ComboBox?
      I am sure it has to do something with the index, but I was unable to figure out how to do it.
      Thank you for your help.

      1 Reply Last reply Reply Quote 0
      • G
        gabor53 last edited by

        I figured it out:

        displayText: currentIndex === -1 ? "Choose ..." : currentIndex
        
        1 Reply Last reply Reply Quote 1
        • First post
          Last post