[Kde-bindings] QtRuby setValidator
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Thu Mar 25 11:16:50 UTC 2004
On Thursday 25 March 2004 10:52, IMOBACH GONZALEZ SOSA wrote:
> Hi all,
>
> first of all, sorry: I have to do a newbie question ;)
>
> I'm trying to use the QValidator class and I've found a little trouble: I
> don't know how to use it :-P
>
> Here is my code:
>
> @lineEdit.setValidator(Qt::QDoubleValidator.new(@lineEdit))
This should be Qt::DoubleValidator.new - perhaps thats the problem. It looks
as though it should be ok apart from that.
But I only fixed mutable string args in method calls being correctly updated
after the call recently, so you might need the most recent QtRuby version in
the cvs. If it doesn't work, maybe could you post complete example code to
make any problems easier to reproduce?
> Noneless to say that lineEdit is an LineEdit instance (right, this is
> another question[1]). This code throws me an error:
>
> unresolved method call (ArgumentError)
>
> I've tried passing the two arguments to QDoubleValidator constructor, but
> it didn't work.
>
> Anybody could help me, please?
>
> Thanks in advance.
>
> [1] The other question is: I'm using rbuic to generate the ruby code for
> the interface, and it use Qt::LineEdit instead Qt:QLineEdit. Is it right?
Yes, all the Qt classes are renamed without the initial Q, so Qt::LineEdit is
correct.
> PD: Alex, Richard: thank you for your previous answers... rbqtapi is just I
> needed.
More information about the Kde-bindings
mailing list