Home > Mobile >  QT data structure to accomplish for the implementation of the problems in the address book
QT data structure to accomplish for the implementation of the problems in the address book

Time:10-10

I recently used data structure of singly linked lists and QT wrote a directory of the Demo, the following problems during implementation to find information, a big doubt dispels doubts:
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* 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; //results in application to lose market did not show, out of the window interface in the application loses again after such printed
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,
  •  Tags:  
  • Qt
  • Related