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