Skip navigation.
Home
The QNX Community Portal

View topic - PtNumericInteger mask issue

Page 1 of 1

PtNumericInteger mask issue

PostPosted: Wed Feb 06, 2013 6:41 am
by lullaby
Hi all,

I have a doubt regarding PtNumericInteger Widget. I understood that PtNumericInteger accepts only integer values. But when I write a sample application for testing, I found that if I type any other characters also, it is visible in the PtNumericInteger widget and if I move on to the next widget in my sample window, the value automatically changes to zero if there are no digits typed.

But I need the PtNumericInteger to discard other characters like alphabets, special characters etc and only the digits which are typed should be visible. I have tried to implement it programmatically by registering a changedcallback. But if any other characters is typed into the PtNumericInteger widget, i found that the changedcallback is not getting called.

So could anyone please help me with any suggestions to solve this issue?

Thanks,
Lullaby

Re: PtNumericInteger mask issue

PostPosted: Wed Feb 06, 2013 7:18 am
by maschoen
If the Numeric Integer widget doesn't support your needs, you might want to look at combining a text widget with custom editing and some up-down buttons of your own. That is if you need the up-down buttons.

Re: PtNumericInteger mask issue

PostPosted: Wed Feb 06, 2013 12:16 pm
by lullaby
Ok. Thank you, Maschoen.
So is it confirmed that PtNumericInteger will cause other characters typed to be visible in the widget until the cursor moves to another widget?

Re: PtNumericInteger mask issue

PostPosted: Wed Feb 06, 2013 6:41 pm
by maschoen
lullaby wrote:Ok. Thank you, Maschoen.
So is it confirmed that PtNumericInteger will cause other characters typed to be visible in the widget until the cursor moves to another widget?


I don't think that's the case, but you can try it and see.

Re: PtNumericInteger mask issue

PostPosted: Thu Feb 07, 2013 4:46 am
by lullaby
What I have tried out is already posted in the first post.
I couldn't find any flags to hide these non-digit characters in PtNumericInteger widget.
Also the registered changedcallback function doesn't help me if I typed any non-digit characters in PtNumericInteger widget. That is why, I posted my doubt here.
I think no possibilities with PtNumericInteger widget. May be, I am wrong because of my lack of knowledge. Please correct me if I am wrong.


Thanks,
Lullaby.