-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwindow.h
48 lines (39 loc) · 1.2 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*************************************************************************
**
** (C) Copyright 2013 Reach Technology Inc.
**
** This code is protected by international copyright laws. This file may
** only be used in accordance with a license and cannot be used on
** hardware other than supplied by Reach Technology Inc. We appreciate
** your understanding and fairness.
**
*************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QDeclarativeView>
#include <QDeclarativeContext>
#include <QtNetwork>
#include <QTimer>
class MainWindow : public QDeclarativeView
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void init();
public slots:
void sendMessage(const QString &message);
private slots:
void onSocketConnected();
void onSocketDisconnected();
void onSocketError(QLocalSocket::LocalSocketError);
void onSocketReadyRead();
void onSocketStateChange(QLocalSocket::LocalSocketState );
void tryConnect();
void onConnectTimerTimeout();
private:
QLocalSocket *m_socket;
QTimer *m_connectTimer;
};
#endif // MAINWINDOW_H