Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qtest_widgets.h
Go to the documentation of this file.
1
// Copyright (C) 2016 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
QTEST_WIDGETS_H
5
#
define
QTEST_WIDGETS_H
6
7
// enable WIDGETS features
8
#
ifndef
QT_WIDGETS_LIB
9
#
define
QT_WIDGETS_LIB
10
#
endif
11
#
if
0
12
#
pragma
qt_class
(
QtTestWidgets
)
13
#
endif
14
15
#
include
<
QtTest
/
qtest_gui
.
h
>
16
17
#
if
0
18
// inform syncqt
19
#
pragma
qt_no_master_include
20
#
endif
21
22
#
include
<
QtWidgets
/
QSizePolicy
>
23
#
include
<
QtCore
/
QMetaEnum
>
24
25
QT_BEGIN_NAMESPACE
26
27
namespace
QTest
28
{
29
30
//
31
// QSizePolicy & friends:
32
//
33
34
namespace
Internal
35
{
36
37
inline
const
char
*
toString
(QSizePolicy::Policy p)
38
{
39
static
const
QMetaEnum me = QSizePolicy::staticMetaObject.enumerator(QSizePolicy::staticMetaObject.indexOfEnumerator(
"Policy"
));
40
return
me.valueToKey(
int
(p));
41
}
42
43
inline
QByteArray
toString
(QSizePolicy::ControlTypes ct)
44
{
45
static
const
QMetaEnum me = QSizePolicy::staticMetaObject.enumerator(QSizePolicy::staticMetaObject.indexOfEnumerator(
"ControlTypes"
));
46
return
me.valueToKeys(
int
(ct.toInt()));
47
}
48
49
inline
QByteArray
toString
(QSizePolicy sp)
50
{
51
static
const
char
comma[] =
", "
;
52
return
QByteArray(
"QSizePolicy("
)
53
+ Internal::toString(sp.horizontalPolicy()) + comma
54
+ Internal::toString(sp.verticalPolicy()) + comma
55
+ QByteArray::number(sp.horizontalStretch()) + comma
56
+ QByteArray::number(sp.verticalStretch()) + comma
57
+ Internal::toString(QSizePolicy::ControlTypes(sp.controlType())) + comma
58
+
"height for width: "
+ (sp.hasHeightForWidth() ?
"yes"
:
"no"
) + comma
59
+
"width for height: "
+ (sp.hasWidthForHeight() ?
"yes"
:
"no"
) + comma
60
+ (sp.retainSizeWhenHidden() ?
""
:
"don't "
) +
"retain size when hidden"
61
+
')'
;
62
}
63
64
}
// namespace Internal
65
}
// namespace QTest
66
67
inline
char
*
toString
(QSizePolicy::Policy p)
68
{
69
return
qstrdup(QTest::Internal::toString(p));
70
}
71
72
inline
char
*
toString
(QSizePolicy::ControlTypes ct)
73
{
74
return
qstrdup(QTest::Internal::toString(ct).constData());
75
}
76
77
inline
char
*
toString
(QSizePolicy::ControlType ct)
78
{
79
return
toString(QSizePolicy::ControlTypes(ct));
80
}
81
82
inline
char
*
toString
(QSizePolicy sp)
83
{
84
return
qstrdup(QTest::Internal::toString(sp).constData());
85
}
86
87
QT_END_NAMESPACE
88
89
#
endif
QTest::Internal
Definition
qtestsupport_core.h:22
QTest::Internal::toString
const char * toString(QSizePolicy::Policy p)
Definition
qtest_widgets.h:37
QTest
[15]
Definition
qtestsupport_core.h:15
toString
char * toString(QNetworkReply::NetworkError code)
Definition
qtest_network.h:48
qtbase
src
testlib
qtest_widgets.h
Generated on
for Qt by
1.18.0