QDesignerClient Class Reference

#include <qdesigner_server.h>

Inheritance diagram for QDesignerClient:

Inheritance graph
[legend]
Collaboration diagram for QDesignerClient:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 53 of file qdesigner_server.h.

Public Member Functions

 QDesignerClient (quint16 port, QObject *parent=0)
virtual ~QDesignerClient ()

Private Slots

void readFromSocket ()

Private Attributes

QTcpSocketm_socket


Constructor & Destructor Documentation

QDesignerClient::QDesignerClient ( quint16  port,
QObject parent = 0 
)

Definition at line 108 of file qdesigner_server.cpp.

References QObject::connect(), QAbstractSocket::connectToHost(), QHostAddress::LocalHost, m_socket, readFromSocket(), SIGNAL, and SLOT.

00109 : QObject(parent)
00110 {
00111     m_socket = new QTcpSocket(this);
00112     m_socket->connectToHost(QHostAddress::LocalHost, port);
00113     connect(m_socket, SIGNAL(readyRead()),
00114                 this, SLOT(readFromSocket()));
00115  
00116 }

Here is the call graph for this function:

QDesignerClient::~QDesignerClient (  )  [virtual]

Definition at line 118 of file qdesigner_server.cpp.

References QAbstractSocket::close(), QAbstractSocket::flush(), and m_socket.

00119 {
00120     m_socket->close();
00121     m_socket->flush();
00122 }

Here is the call graph for this function:


Member Function Documentation

void QDesignerClient::readFromSocket (  )  [private, slot]

Definition at line 124 of file qdesigner_server.cpp.

References QAbstractSocket::canReadLine(), QFile::exists(), QString::fromUtf8(), QString::isNull(), m_socket, qDesigner, QIODevice::readLine(), and QString::replace().

Referenced by QDesignerClient().

00125 {
00126     QString file = QString();
00127     while (m_socket->canReadLine()) {
00128         QString file = QString::fromUtf8(m_socket->readLine());
00129         if (!file.isNull()) {
00130             file = file.replace(QLatin1String("\n"), QLatin1String(""));
00131             file = file.replace(QLatin1String("\r"), QLatin1String(""));
00132             if (QFile::exists(file))
00133                 qDesigner->postEvent(qDesigner, new QFileOpenEvent(file));
00134         }
00135     }
00136 }


Member Data Documentation

QTcpSocket* QDesignerClient::m_socket [private]

Definition at line 64 of file qdesigner_server.h.

Referenced by QDesignerClient(), readFromSocket(), and ~QDesignerClient().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 17:15:07 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1