#include
#include "widget.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Widget w;
QTextCodec::setCodecForTr(QTextCodec::codecForLocale());
#if defined(Q_WS_S60)
w.showMaximized();
#else
w.show();
#endif
return a.exec();
}
Widget
#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
this->resize(850,550);
ui->textEdit->setFocusPolicy(Qt::StrongFocus);
ui->textBrowser->setFocusPolicy(Qt::NoFocus);
ui->textEdit->setFocus();
ui->textEdit->installEventFilter(this);
udpSocket = new QUdpSocket(this);
port = 45454;
udpSocket->bind(port,QUdpSocket::ShareAddress
| QUdpSocket::ReuseAddressHint);
connect(udpSocket,SIGNAL(readyRead()),this,SLOT(processPendingDatagrams())); sendMessage(NewParticipant);
server = new TcpServer(this);
connect(server,SIGNAL(sendFileName(QString)),this,SLOT(sentFileName(QString)));