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. QML placeholder

QML placeholder

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 9.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.
  • M Offline
    M Offline
    mititelud
    wrote on last edited by
    #1

    hello,
    how can you use a placeholder for a TextInput or a tooltip in qml?

    :)

    1 Reply Last reply
    0
    • C Offline
      C Offline
      cosmam
      wrote on last edited by
      #2

      You can use the "QtQuick Controls module":http://qt-project.org/doc/qt-5/qtquickcontrols-index.html and use a TextField instead of a plain TextInput. The TextField has a property for placeholder text.

      I am not sure what you mean on doing it for the tooltip, though.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mititelud
        wrote on last edited by
        #3

        i've used tooltip in html and javascript and such. it's a textdisplay when you hover on stuff...or something like that...anyway...

        it qml TextField is not recognized, don't know why.
        all I got starting with text is Text, TextInput and TextEdit.

        thanks for the hint :)

        :)

        1 Reply Last reply
        0
        • C Offline
          C Offline
          cosmam
          wrote on last edited by
          #4

          Ah, I think my sleep-adled brain didn't understand what you meant - I thought you meant placeholder text in a tooltip.

          I edited my previous post to correct the link (I am, obviously, new here, though not new to Qt), which should be able to provide you detailed help, but I can give a quick overview.

          At the top of whatever qml file you need this functionality in, add: "import QtQuick.Controls 1.1"

          Then you should be able to use TextField, which includes placeholder text as a property. I am still not sure how to do a tooltip on such items.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mititelud
            wrote on last edited by
            #5

            even with the import of qtquick 1.1, it does not show me the TextField element :(

            :)

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              Hi, it's QtQuick.Controls 1.1, not QtQuick 1.1.

              Also, this page might be useful: http://qt-project.org/doc/qt-5/qml-qtquick-controls-textfield.html

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              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