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
4#ifndef QUILOADER_P_H
5#define QUILOADER_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 <QtUiTools/qtuitoolsglobal.h>
19#include <QtCore/qbytearray.h>
20#include <QtCore/qmetatype.h>
21
22QT_FORWARD_DECLARE_CLASS(QDataStream)
23
24// This file is here for use by the form preview in Linguist. If you change anything
25// here or in the code which uses it, remember to adapt Linguist accordingly.
26
27#define PROP_GENERIC_PREFIX "_q_notr_"
28#define PROP_TOOLITEMTEXT "_q_toolItemText_notr"
29#define PROP_TOOLITEMTOOLTIP "_q_toolItemToolTip_notr"
30#define PROP_TABPAGETEXT "_q_tabPageText_notr"
31#define PROP_TABPAGETOOLTIP "_q_tabPageToolTip_notr"
32#define PROP_TABPAGEWHATSTHIS "_q_tabPageWhatsThis_notr"
33
34QT_BEGIN_NAMESPACE
35
36class Q_UITOOLS_EXPORT QUiTranslatableStringValue
37{
38public:
39 QByteArray value() const { return m_value; }
40 void setValue(const QByteArray &value) { m_value = value; }
41 QByteArray qualifier() const { return m_qualifier; }
42 void setQualifier(const QByteArray &qualifier) { m_qualifier = qualifier; }
43
44 QString translate(const QByteArray &className, bool idBased) const;
45
46private:
47 QByteArray m_value;
48 QByteArray m_qualifier; // Comment or ID for id-based tr().
49};
50
51#ifndef QT_NO_DATASTREAM
52Q_UITOOLS_EXPORT QDataStream &operator<<(QDataStream &out, const QUiTranslatableStringValue &s);
53Q_UITOOLS_EXPORT QDataStream &operator>>(QDataStream &in, QUiTranslatableStringValue &s);
54#endif // QT_NO_DATASTREAM
55
56struct QUiItemRolePair {
57 int realRole;
58 int shadowRole;
59};
60
61#ifdef QFORMINTERNAL_NAMESPACE
62namespace QFormInternal
63{
64#endif
65
66extern const Q_UITOOLS_EXPORT QUiItemRolePair qUiItemRoles[];
67
68#ifdef QFORMINTERNAL_NAMESPACE
69}
70#endif
71
72QT_END_NAMESPACE
73
74Q_DECLARE_METATYPE(QUiTranslatableStringValue)
75
76
77#endif // QUILOADER_P_H
78

source code of qttools/src/uitools/quiloader_p.h