Skip to content

Commit e7f17c6

Browse files
authored
docs: fix title format (socketio#297)
1 parent 36a8cd4 commit e7f17c6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

examples/QT/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In this tutorial we’ll learn how to create a QT chat application that communicates with a [Socket.IO Node.JS chat server](https://github.com/Automattic/socket.io/tree/master/examples/chat).
44

5-
###Introduction
5+
### Introduction
66
To follow along, start by cloning the repository: [socket.io-client-cpp](https://github.com/socketio/socket.io-client-cpp).
77
Using:
88

@@ -39,7 +39,7 @@ SioChatDemo
3939
|__mainwindow.ui
4040
```
4141

42-
###Import SioClient and config compile options.
42+
### Import SioClient and config compile options.
4343
Let's copy the SioClient into the QT project as a subfolder `sioclient`.
4444

4545
Edit `SioChatDemo.pro` to config paths and compile options, simply add:
@@ -82,7 +82,7 @@ else:win32:CONFIG(debug, debug|release): LIBS += -L`our Win32 boost static lib f
8282
else:unix: LIBS += -L`our osx boost static lib folder` -lboost
8383
```
8484

85-
###Make up mainwindow ui.
85+
### Make up mainwindow ui.
8686
Make up a simple ui by drag and drop widget from `Widget box` in left side.
8787

8888
We finally end up with this:
@@ -101,7 +101,7 @@ It contains:
101101

102102
* a `QPushButton` at the bottomright for sending message, named `sendBtn`
103103

104-
###Add Slots in mainwindow
104+
### Add Slots in mainwindow
105105
Slots need to be added in `mainwindow` class to handle UI events.They are
106106

107107
* click login button
@@ -122,7 +122,7 @@ public Q_SLOTS:
122122
void OnMessageReturn();
123123
```
124124

125-
###Connect UI event signal and slots together
125+
### Connect UI event signal and slots together
126126
Open `mainwindow.ui` in Design mode. switch to `signals/slots` mode by check `Menu->Edit->Edit Signals/Slots`
127127

128128
By press left mouse on widget and drag on to the window (cursor will become a sign of electrical ground), to open the connection editor.
@@ -135,7 +135,7 @@ We finally end up with this:
135135

136136
![QT signals&slots](https://cldup.com/Vsb-UXG3FC.jpg)
137137

138-
###Adding UI refresh Signals/Slots
138+
### Adding UI refresh Signals/Slots
139139
`sio::client`'s callbacks are not in UI thread. However, UI is required to be updated by those callbacks, so we need some `Signal` for non-UI thread to "request" `Slots` functions been called in UI thread. Say if we want to signal `QListWidgetItem` being added, add:
140140

141141
```C++
@@ -160,7 +160,7 @@ Then connect them in `MainWindow` constructor.
160160
connect(this,SIGNAL(RequestAddListItem(QListWidgetItem*)),this,SLOT(AddListItem(QListWidgetItem*)));
161161
```
162162
163-
###Init sio::client in MainWindow
163+
### Init sio::client in MainWindow
164164
For single window applications, simply let `MainWindow` class holding the `sio::client` object:
165165
166166
declare a `unique_ptr` member of `sio::client` and Several event handling functions in `mainwindow.h`
@@ -214,7 +214,7 @@ MainWindow::MainWindow(QWidget *parent) :
214214
}
215215
```
216216
217-
###Managing connection state
217+
### Managing connection state
218218
We have several connection listeners for connection events.
219219
220220
First we want to send login message once we're connected, get the default `socket` from `client` to do that.
@@ -256,7 +256,7 @@ MainWindow::~MainWindow()
256256
}
257257
```
258258

259-
###Handle socket.io events
259+
### Handle socket.io events
260260
We'll need to handle socket.io events in our functions bind to socket.io events.
261261
For example, we need to show received messages to the `listView`
262262

@@ -278,7 +278,7 @@ void MainWindow::OnNewMessage(std::string const& name,message::ptr const& data,b
278278
}
279279
```
280280
281-
###Sending chat message
281+
### Sending chat message
282282
When `sendBtn` is clicked, we need to send the text in `messageEdit` to chatroom.
283283
Add code to `SendBtnClicked()`:
284284
@@ -301,7 +301,7 @@ void MainWindow::SendBtnClicked()
301301
}
302302
```
303303

304-
###Further reading
304+
### Further reading
305305
You can run [Demo project](https://github.com/socketio/socket.io-client-cpp/tree/master/examples/QT/SioChatDemo) to have a closer look.
306306
Before running, please follow the [instructions](../../README.md#with_cmake) to make the sioclient library.
307307

0 commit comments

Comments
 (0)