Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmldebugtranslationclient.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
7
8#include <QDebug>
9
10#include <private/qqmldebugconnector_p.h>
11#include <private/qversionedpacket_p.h>
12
14
16 : QQmlDebugClient(QLatin1String("DebugTranslation"), client)
17{
18}
19
20void QQmlDebugTranslationClient::messageReceived(const QByteArray &message)
21{
22 QVersionedPacket<QQmlDebugConnector> packet(message);
23 QQmlDebugTranslation::Reply type;
24
25 packet >> type;
26 switch (type) {
27 case QQmlDebugTranslation::Reply::TranslationIssues: {
28 packet >> translationIssues;
29 break;
30 }
31 case QQmlDebugTranslation::Reply::LanguageChanged: {
32 languageChanged = true;
33 break;
34 }
35 case QQmlDebugTranslation::Reply::TranslatableTextOccurrences: {
36 packet >> qmlElements;
37 break;
38 }
39 case QQmlDebugTranslation::Reply::StateList: {
40 packet >> qmlStates;
41 break;
42 }
43
44 default:
45 qWarning() << "TestDebugTranslationClient: received unknown command: " << static_cast<int>(type);
46 break;
47 }
48}
49
50QT_END_NAMESPACE
51
52#include "moc_qqmldebugtranslationclient_p.cpp"
virtual void messageReceived(const QByteArray &message) override
Combined button and popup list for selecting options.