[SailfishDevel] TextField Silica Component's placeholderText property doesn't work

Jonni Rainisto jonni.rainisto at jollamobile.com
Sun Apr 28 17:34:54 UTC 2013


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-bounces at lists.sailfishos.org [devel-bounces at lists.sailfishos.org] on behalf of Superpelican [superpelican at zoho.com]
Sent: Saturday, April 27, 2013 8:03 PM
To: devel at 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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sailfishos.org/pipermail/devel/attachments/20130428/d16c5973/attachment.html>


More information about the Devel mailing list