Hi,

Your current width is 0 (so thats why its hidden), you need to set width for 
example like:

TextField {

                y: 100

                width: parent.width

                focus: true

                placeholderText: "Please enter the answer here"

                inputMethodHints: Qt.ImhDigitsOnly

           }
And inputMethodHints starts with lowercase i. But on current version of SDK it 
currently does nothing.
You need to wait for next SDK release where it has been fixed.

re, Jonni

________________________________
From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Superpelican [superpeli...@zoho.com]
Sent: Saturday, April 27, 2013 8:03 PM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] TextField Silica Component's placeholderText property 
doesn't work


Hello fellow mailing list members,

I'm reasonably new to programming and Qt/QML.
I know the basics of C++ and QML. And I'm
trying to create simple Sailfish OS QML/C++ app.

I've already written a CLI version of my application in C++
that contains the logic. So I will use that code as base for my Saifish app.

I'm now creating the QML/Silica UI and the UI includes a single line TextField 
component for entering integers. However I noticed that placeholderText isn't 
shown, which makes it almost impossible for the user to see theTextField. When 
I set the text property of the TextField I can however see the text in the 
emulator. The relevant code basically looks like this:

TextField{
x: parent.Center
y: 100
focus: true
placeholderText: "Please enter the answer here"
InputMethodHints: Qt.ImhDigitsOnly
}

Also it seems that the InputMethodHint also doesn't work: I just get a general 
keyboard. No special digits only keypad, it doesn't even start on the 
number/special character tab of the keyboard.

Are these things Silica Component bugs?
_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to