Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmltranslation_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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
4#ifndef QQMLTRANSLATION_P_H
5#define QQMLTRANSLATION_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qstring.h>
19
20#include <private/qv4qmlcontext_p.h>
21
23
24class Q_QML_EXPORT QQmlTranslation
25{
26public:
27 class Q_QML_EXPORT QsTrData
28 {
31 QByteArray comment;
32 int number;
33
34 public:
35 QsTrData(const QString &fileNameForContext, const QString &text, const QString &comment,
36 int number);
37 QString translate() const;
38 QString serializeForQmltc() const;
39 QString idForQmlDebug() const;
40 };
41
42 class Q_QML_EXPORT QsTrIdData
43 {
45 int number;
46
47 public:
48 QsTrIdData(const QString &id, int number);
49 QString translate() const;
50 QString serializeForQmltc() const;
51 QString idForQmlDebug() const;
52 };
53
54 // The static analyzer hates std::monostate in std::variant because
55 // that results in various uninitialized memory "problems". Just use
56 // std::nullptr_t to indicate "empty".
57 using Data = std::variant<std::nullptr_t, QsTrData, QsTrIdData>;
58
59private:
60 Data data;
61
62public:
63 QQmlTranslation(const Data &d);
65 QString translate() const;
66 QString serializeForQmltc() const;
67 QString idForQmlDebug() const;
68
69 static QString contextFromQmlFilename(const QString &qmlFilename);
70};
71
73
74#endif // QQMLTRANSLATION_P_H
\inmodule QtCore
Definition qbytearray.h:57
std::variant< std::nullptr_t, QsTrData, QsTrIdData > Data
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString text
Combined button and popup list for selecting options.
static void * context
GLenum GLuint id
[7]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static bool translate(xcb_connection_t *connection, xcb_window_t child, xcb_window_t parent, int *x, int *y)