Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 19
Registered: ‎02-17-2013
My Device: Z30
My Carrier: Telekom Germany
Accepted Solution

TextInputProperties::submitted() has not been tagged as a Qt signal; make sure all parameter types are fully qualified

Hi,

 

I'm having trouble with handling the submitted() signal.

 

I have created a custom control which contains one ore more TextAreas.

Now I need to connect the submitted signal, but I'm getting this warning.

TextInputProperties::submitted() has not been tagged as a Qt signal; make sure all parameter types are fully qualified

 

Even if I use exact the same code from the example under TextInputProperties

TextArea* pTextArea = newTextArea();

pTextArea->input()->setSubmitKey(SubmitKey::Connect);

QObject::connect(pTextArea->input(), SIGNAL(submitted()), this, SLOT(onSubmitted()));

I'm geetting the same warning.

 

Browsing to textinputproperties.h shows that there is only the following signal defined:

void submitted(bb::cascades::AbstractTextControl *submitter);

 

How can I handle the submit signal properly?

 

Thanks a lot

Thorsten

 

 

 

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: TextInputProperties::submitted() has not been tagged as a Qt signal; make sure all parameter types are fully qualified

Hi,

 

It looks like the example is incorrect. This should work:

 

QObject::connect(pTextArea->input(),
  SIGNAL(submitted(bb::cascades::AbstractTextControl*)),
  this,
  SLOT(onSubmitted(bb::cascades::AbstractTextControl*));

…

public slots:

void onSubmitted(bb::cascades::AbstractTextControl *submitter);

 


Andrey Fidrya, @zmeyc on twitter
New Developer
Posts: 19
Registered: ‎02-17-2013
My Device: Z30
My Carrier: Telekom Germany

Re: TextInputProperties::submitted() has not been tagged as a Qt signal; make sure all parameter types are fully qualified

Thanks a lot Zmey

New Developer
Posts: 19
Registered: ‎02-17-2013
My Device: Z30
My Carrier: Telekom Germany

Re: TextInputProperties::submitted() has not been tagged as a Qt signal; make sure all parameter types are fully qualified

[ Edited ]

Now I'm able to connect to the submitted(bb::cascades::AbstractTextControl*) signal

 

But unfortunately this does not solve my problem fully

 

Here is what I'm wanna do.

Adding (one or more) TextAreas from C++. In each TextArea the user shall enter a word or a line. If h

e hits the enter key on the virtual keyboard, the input shall be validated. For validation I'm using onTextChanged().

 

Here is how I create the TextArea(s).

 

mTextArea = TextArea::create()
	.inputMode(TextAreaInputMode::Text)
	.text("");

mTextArea->input()->setFlags(	
	TextInputFlag::AutoCapitalizationOff |
	TextInputFlag::AutoCorrectionOff |
	TextInputFlag::AutoPeriodOff  |
	TextInputFlag::PredictionOff |
	TextInputFlag::SpellCheckOff |
	TextInputFlag::VirtualKeyboard |
	TextInputFlag::WordSubstitutionOff );

mTextArea->input()->setSubmitKey(SubmitKey::Done);//EnterKey);
mTextArea->input()->setSubmitKeyFocusBehavior(SubmitKeyFocusBehavior::Default);

bool res = QObject::connect(mTextArea, SIGNAL(textChanged(QString)), this, SLOT(onTextChanged(QString)));
res = QObject::connect(mTextArea->input(), SIGNAL(submitted(bb::cascades::AbstractTextControl*)), this, SLOT(onSubmitted(bb::cascades::AbstractTextControl*)));

I can see that the onSubmitted(bb::cascades::AbstractTextControl*) is emitted but the sending control still keeps the focus and onTextChanged() is not emitted.

Only if I hit somewhere else on the screen and so move the focus, the control looses the focus and onTextChanged() is emitted.

 

What do I need to change in order to move the focus to the next control and validate the input, if the user pressed the submit key.

 

I know, there is also TextField availablem which would not show this behaviour (to my understanding) but this is not choosen for other reasons.

 

Thanks a lot

 

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: TextInputProperties::submitted() has not been tagged as a Qt signal; make sure all parameter types are fully qualified

[ Edited ]

Maybe calling onTextChanged function directly from onSubmitted handler will work?

 

The focus should switch to the next control if focus behavior is set to Next:

 

mTextArea->input()->setSubmitKeyFocusBehavior(SubmitKeyFocusBehavior::Next);

Andrey Fidrya, @zmeyc on twitter
Highlighted
New Developer
Posts: 19
Registered: ‎02-17-2013
My Device: Z30
My Carrier: Telekom Germany

Re: TextInputProperties::submitted() has not been tagged as a Qt signal; make sure all parameter types are fully qualified

[ Edited ]

No, that does not help.

 

I tried all 4 possible values for setSubmitKeyFocusBehavior but none had the wanted effect.