feat: add disconnect behaviour

This commit is contained in:
semenov
2024-09-10 17:47:52 +03:00
parent c779e3c210
commit a831e29ddc
17 changed files with 110 additions and 61 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_MainWindow_t {
QByteArrayData data[25];
char stringdata0[439];
QByteArrayData data[26];
char stringdata0[460];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
@@ -56,7 +56,8 @@ QT_MOC_LITERAL(20, 361, 29), // "on_languageComboBox_activated"
QT_MOC_LITERAL(21, 391, 4), // "arg1"
QT_MOC_LITERAL(22, 396, 17), // "slotDisableNotify"
QT_MOC_LITERAL(23, 414, 19), // "slotConnectionState"
QT_MOC_LITERAL(24, 434, 4) // "flag"
QT_MOC_LITERAL(24, 434, 4), // "flag"
QT_MOC_LITERAL(25, 439, 20) // "slotServerDisconnect"
},
"MainWindow\0sigInitializeClient\0\0"
@@ -72,7 +73,7 @@ QT_MOC_LITERAL(24, 434, 4) // "flag"
"on_connectButton_clicked\0"
"on_languageComboBox_activated\0arg1\0"
"slotDisableNotify\0slotConnectionState\0"
"flag"
"flag\0slotServerDisconnect"
};
#undef QT_MOC_LITERAL
@@ -82,7 +83,7 @@ static const uint qt_meta_data_MainWindow[] = {
8, // revision
0, // classname
0, 0, // classinfo
14, 14, // methods
15, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
@@ -90,22 +91,23 @@ static const uint qt_meta_data_MainWindow[] = {
5, // signalCount
// signals: name, argc, parameters, tag, flags
1, 2, 84, 2, 0x06 /* Public */,
7, 1, 89, 2, 0x06 /* Public */,
10, 0, 92, 2, 0x06 /* Public */,
11, 0, 93, 2, 0x06 /* Public */,
12, 1, 94, 2, 0x06 /* Public */,
1, 2, 89, 2, 0x06 /* Public */,
7, 1, 94, 2, 0x06 /* Public */,
10, 0, 97, 2, 0x06 /* Public */,
11, 0, 98, 2, 0x06 /* Public */,
12, 1, 99, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
14, 0, 97, 2, 0x08 /* Private */,
15, 0, 98, 2, 0x08 /* Private */,
16, 0, 99, 2, 0x08 /* Private */,
17, 0, 100, 2, 0x08 /* Private */,
18, 0, 101, 2, 0x08 /* Private */,
19, 0, 102, 2, 0x08 /* Private */,
20, 1, 103, 2, 0x08 /* Private */,
22, 0, 106, 2, 0x08 /* Private */,
23, 1, 107, 2, 0x08 /* Private */,
14, 0, 102, 2, 0x08 /* Private */,
15, 0, 103, 2, 0x08 /* Private */,
16, 0, 104, 2, 0x08 /* Private */,
17, 0, 105, 2, 0x08 /* Private */,
18, 0, 106, 2, 0x08 /* Private */,
19, 0, 107, 2, 0x08 /* Private */,
20, 1, 108, 2, 0x08 /* Private */,
22, 0, 111, 2, 0x08 /* Private */,
23, 1, 112, 2, 0x08 /* Private */,
25, 0, 115, 2, 0x08 /* Private */,
// signals: parameters
QMetaType::Void, 0x80000000 | 3, 0x80000000 | 5, 4, 6,
@@ -124,6 +126,7 @@ static const uint qt_meta_data_MainWindow[] = {
QMetaType::Void, QMetaType::QString, 21,
QMetaType::Void,
QMetaType::Void, QMetaType::Bool, 24,
QMetaType::Void,
0 // eod
};
@@ -148,6 +151,7 @@ void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id,
case 11: _t->on_languageComboBox_activated((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 12: _t->slotDisableNotify(); break;
case 13: _t->slotConnectionState((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 14: _t->slotServerDisconnect(); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
@@ -232,13 +236,13 @@ int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 14)
if (_id < 15)
qt_static_metacall(this, _c, _id, _a);
_id -= 14;
_id -= 15;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 14)
if (_id < 15)
qt_static_metacall(this, _c, _id, _a);
_id -= 14;
_id -= 15;
}
return _id;
}

Binary file not shown.

View File

@@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_TCPClient_t {
QByteArrayData data[13];
char stringdata0[158];
QByteArrayData data[14];
char stringdata0[178];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
@@ -41,17 +41,18 @@ QT_MOC_LITERAL(5, 48, 11), // "QTcpSocket*"
QT_MOC_LITERAL(6, 60, 6), // "socket"
QT_MOC_LITERAL(7, 67, 18), // "sigConnectionState"
QT_MOC_LITERAL(8, 86, 4), // "flag"
QT_MOC_LITERAL(9, 91, 15), // "sigGetXmlAnswer"
QT_MOC_LITERAL(10, 107, 18), // "slotMessageEntered"
QT_MOC_LITERAL(11, 126, 17), // "slotConnectNotify"
QT_MOC_LITERAL(12, 144, 13) // "slotReadyRead"
QT_MOC_LITERAL(9, 91, 19), // "sigServerDisconnect"
QT_MOC_LITERAL(10, 111, 15), // "sigGetXmlAnswer"
QT_MOC_LITERAL(11, 127, 18), // "slotMessageEntered"
QT_MOC_LITERAL(12, 146, 17), // "slotConnectNotify"
QT_MOC_LITERAL(13, 164, 13) // "slotReadyRead"
},
"TCPClient\0sigSendDebugLog\0\0message\0"
"sigRecognize\0QTcpSocket*\0socket\0"
"sigConnectionState\0flag\0sigGetXmlAnswer\0"
"slotMessageEntered\0slotConnectNotify\0"
"slotReadyRead"
"sigConnectionState\0flag\0sigServerDisconnect\0"
"sigGetXmlAnswer\0slotMessageEntered\0"
"slotConnectNotify\0slotReadyRead"
};
#undef QT_MOC_LITERAL
@@ -61,28 +62,30 @@ static const uint qt_meta_data_TCPClient[] = {
8, // revision
0, // classname
0, 0, // classinfo
7, 14, // methods
8, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
4, // signalCount
5, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 49, 2, 0x06 /* Public */,
4, 1, 52, 2, 0x06 /* Public */,
7, 1, 55, 2, 0x06 /* Public */,
9, 1, 58, 2, 0x06 /* Public */,
1, 1, 54, 2, 0x06 /* Public */,
4, 1, 57, 2, 0x06 /* Public */,
7, 1, 60, 2, 0x06 /* Public */,
9, 0, 63, 2, 0x06 /* Public */,
10, 1, 64, 2, 0x06 /* Public */,
// slots: name, argc, parameters, tag, flags
10, 1, 61, 2, 0x0a /* Public */,
11, 0, 64, 2, 0x0a /* Public */,
12, 0, 65, 2, 0x08 /* Private */,
11, 1, 67, 2, 0x0a /* Public */,
12, 0, 70, 2, 0x0a /* Public */,
13, 0, 71, 2, 0x08 /* Private */,
// signals: parameters
QMetaType::Void, QMetaType::QString, 3,
QMetaType::Void, 0x80000000 | 5, 6,
QMetaType::Void, QMetaType::Bool, 8,
QMetaType::Void,
QMetaType::QByteArray, QMetaType::QString, 2,
// slots: parameters
@@ -102,11 +105,12 @@ void TCPClient::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, v
case 0: _t->sigSendDebugLog((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 1: _t->sigRecognize((*reinterpret_cast< QTcpSocket*(*)>(_a[1]))); break;
case 2: _t->sigConnectionState((*reinterpret_cast< bool(*)>(_a[1]))); break;
case 3: { QByteArray _r = _t->sigGetXmlAnswer((*reinterpret_cast< QString(*)>(_a[1])));
case 3: _t->sigServerDisconnect(); break;
case 4: { QByteArray _r = _t->sigGetXmlAnswer((*reinterpret_cast< QString(*)>(_a[1])));
if (_a[0]) *reinterpret_cast< QByteArray*>(_a[0]) = std::move(_r); } break;
case 4: _t->slotMessageEntered((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 5: _t->slotConnectNotify(); break;
case 6: _t->slotReadyRead(); break;
case 5: _t->slotMessageEntered((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 6: _t->slotConnectNotify(); break;
case 7: _t->slotReadyRead(); break;
default: ;
}
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
@@ -143,10 +147,17 @@ void TCPClient::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, v
return;
}
}
{
using _t = void (TCPClient::*)();
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&TCPClient::sigServerDisconnect)) {
*result = 3;
return;
}
}
{
using _t = QByteArray (TCPClient::*)(QString );
if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&TCPClient::sigGetXmlAnswer)) {
*result = 3;
*result = 4;
return;
}
}
@@ -182,13 +193,13 @@ int TCPClient::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 7)
if (_id < 8)
qt_static_metacall(this, _c, _id, _a);
_id -= 7;
_id -= 8;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 7)
if (_id < 8)
qt_static_metacall(this, _c, _id, _a);
_id -= 7;
_id -= 8;
}
return _id;
}
@@ -215,11 +226,17 @@ void TCPClient::sigConnectionState(bool _t1)
}
// SIGNAL 3
void TCPClient::sigServerDisconnect()
{
QMetaObject::activate(this, &staticMetaObject, 3, nullptr);
}
// SIGNAL 4
QByteArray TCPClient::sigGetXmlAnswer(QString _t1)
{
QByteArray _t0{};
void *_a[] = { const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t0))), const_cast<void*>(reinterpret_cast<const void*>(std::addressof(_t1))) };
QMetaObject::activate(this, &staticMetaObject, 3, _a);
QMetaObject::activate(this, &staticMetaObject, 4, _a);
return _t0;
}
QT_WARNING_POP

Binary file not shown.

Binary file not shown.

Binary file not shown.