/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* added to the directory in the data to find relevant information such as
* input name -- -- -- -- -- - & gt; Display the phone number
* enter the phone number -- -- -- -- -- - & gt; Display name
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Void MainWindow: : on_search_clicked ()//input name or phone number is show another information
{
Node * currentNode=new Node;//create a new node
PList - & gt; GetElem (0, currentNode);//get added to the contacts of the first element node
Cout<& lt;" 1 "& lt;
QString qs_Name=UI - & gt; The name - & gt; The text ();
QString qs_Phone=UI - & gt; Phone - & gt; The text ();
If (qs_Name. IsEmpty () & amp; & Qs_Phone. IsEmpty ())//and cannot get in these conditions like
{
//hint to enter search information
}
If ((! Qs_Name. IsEmpty ()) & amp; & (qs_Phone. IsEmpty ()))
{
//by name check phone
If (currentNode - & gt; Data. The name!=qstr2str (qs_Name))
{
CurrentNode=currentNode - & gt; Next;
Cout
}
The else
{
Qs_Phone=str2qstr (currentNode - & gt; Data. The phone);
}
}
If (qs_Name. IsEmpty () & amp; & ! Qs_Phone. IsEmpty ())
{
//by phone to check name
If (currentNode - & gt; Data. The phone!=qstr2str (qs_Phone))
{
CurrentNode=currentNode - & gt; Next;
}
The else
{
Qs_Name=str2qstr (currentNode - & gt; Data. The name);
}
}
}
CodePudding user response:
I can't see what you want to ask,Want to see in qtcreator debug window real-time debugging information, please use qDebug () debug output,