📄 form1_func.h
字号:
/****************************************************************************** ui.h extension file, included from the uic-generated form implementation.**** If you want to add, delete, or rename functions or slots, use** Qt Designer to update this file, preserving your code.**** You should not define a constructor or destructor in this file.** Instead, write your code in functions called init() and destroy().** These will automatically be called by the form's constructor and** destructor.*****************************************************************************/#include <sys/types.h>#include <unistd.h>#include "form1.h"void Form1::onConnect(){int numbytes;char item[100];char* p;char* q;p = q = buf;MUReceiveSocket=new QSocketDevice(QSocketDevice::Stream);//if (MUReceiveSocket == -1)// printf ("######### error !");their_addr.setAddress(lineEdit1->text());printf ("&&&& %d",lineEdit1->text());MUReceiveSocket->connect(their_addr,atoi(PORT));if((numbytes=MUReceiveSocket->readBlock(buf, MAXDATASIZE)) != -1) { buf[numbytes]='\0'; printf("Received: %s \n",buf);}delete MUReceiveSocket;listBox1->clear();while((q=strchr(p,'#'))!=NULL){ strncpy(item,p,q-p); item[q-p]='\0'; listBox1->insertItem(item); printf("hehe !"); p = (++q); cout<<item<<endl;}}void Form1::onPlay(){pid_t pid;pid = fork();if(pid==0){char name[100];name[0]='\0';strcat(name,"http://");strcat(name,lineEdit1->text());strcat(name,":");strcat(name,PORT);strcat(name,"/");strcat(name,listBox1->currentText());cout<<name<<endl;execl("/bin/ls","ls","-l",NULL);}else wait();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -