Called from QLINEEDIT:SETVALIDATOR(0)
METHOD QLineEdit:setValidator( ... )
SWITCH PCount()
CASE 1
DO CASE
CASE hb_isObject( hb_pvalue( 1 ) )
RETURN Qt_QLineEdit_setValidator( ::pPtr, ... )
ENDCASE
EXIT
ENDSWITCH
RETURN __hbqt_error()
it wants one parameter of type hbqt....
"void QLineEdit::setValidator ( const QValidator * v )
Sets this line edit to only accept input that the validator, v, will
accept. This allows you to place any arbitrary constraints on the text
which may be entered.
If v == 0, setValidator() removes the current input validator. The
initial setting is to have no input validator (i.e. any input is
accepted up to maxLength())."
Regards,
Bacco
Viktor
I agree that sending NIL should remove the validator, but I think we
can stick to Qt accepting 0 also with same effect, so the Qt
documentation still applies and it costs one "If" or "elseif" in the
middle of many others.
Just in case, how is the current planning/goals of migrating the
current HBQt Ifs to C++?
Accepting zero means and extra pass of validation, plus
it's not natural in .prg programs for 0 to mean NIL. Also,
what if someone passes 99? Should it RTE? It looks unusual
practice to allow certain types with certain values, so
IMO allowing numeric 0 introduced ambiguity.
If you means moving C++ code directly to .prg, and we assume
that 0 is represented by NULL in correct C++ code, the
easiest is to do '#define NULL NIL' in the .prg and the problem is
solved, without adding strangeness and complication to HBQT code.
> Just in case, how is the current planning/goals of migrating the
> current HBQt Ifs to C++?
I don't know, nobody seemed interested in any remaining
open questions, so apparently it's stalled. Anyhow it remains
one of the important moves to do, before calling HBQT
stable (plus eliminating those raw pointers).
Viktor