source: trunk/examples/network/remotecontrol/startup.cpp

Last change on this file was 2, checked in by dmik, 20 years ago

Imported xplatform parts of the official release 3.3.1 from Trolltech

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1#include "startup.h"
2#include "remotectrlimpl.h"
3#include "maindialog.h"
4#include "ipcserver.h"
5
6#include <qsocket.h>
7#include <qlabel.h>
8
9static const Q_UINT16 ipcPort = 54923;
10
11StartUp::StartUp()
12{
13 remoteCtrl = 0;
14 mainDialog = 0;
15
16 socket = new QSocket( this );
17 connect( socket, SIGNAL(connected()), SLOT(startRemoteCtrl()) );
18 connect( socket, SIGNAL(error(int)), SLOT(startMainDialog()) );
19 socket->connectToHost( "localhost", ipcPort );
20}
21
22StartUp::~StartUp()
23{
24 delete remoteCtrl;
25 delete mainDialog;
26}
27
28void StartUp::startRemoteCtrl()
29{
30 remoteCtrl = new RemoteCtrlImpl( socket );
31 remoteCtrl->show();
32}
33
34void StartUp::startMainDialog()
35{
36 mainDialog = new MainDialog();
37 mainDialog->show();
38
39 IpcServer *server = new IpcServer( ipcPort, this );
40
41 connect( server, SIGNAL(receivedText(const QString&)),
42 mainDialog->description, SLOT(setText(const QString&)) );
43 connect( server, SIGNAL(receivedPixmap(const QPixmap&)),
44 mainDialog->image, SLOT(setPixmap(const QPixmap&)) );
45}
Note: See TracBrowser for help on using the repository browser.