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
qquickvaluetypes.cpp
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#include <private/qquickvaluetypes_p.h>
5
6#include <qtquickglobal.h>
7#include <private/qqmlvaluetype_p.h>
8#include <private/qqmlstringconverters_p.h>
9#include <private/qcolorspace_p.h>
10#include <private/qfont_p.h>
11
13
18
20{
21 return params.isString() ? QColor::fromString(params.toString()) : QVariant();
22}
23
25{
26 return v.name(v.alpha() != 255 ? QColor::HexArgb : QColor::HexRgb);
27}
28
30{
31 return QQml_colorProvider()->lighter(this->v, factor);
32}
33
35{
36 return QQml_colorProvider()->darker(this->v, factor);
37}
38
43
45{
46 return QQml_colorProvider()->tint(this->v, tintColor);
47}
48
50{
51 return v.redF();
52}
53
55{
56 return v.greenF();
57}
58
60{
61 return v.blueF();
62}
63
65{
66 return v.alphaF();
67}
68
70{
71 return v.hsvHueF();
72}
73
75{
76 return v.hsvSaturationF();
77}
78
80{
81 return v.valueF();
82}
83
85{
86 return v.hslHueF();
87}
88
90{
91 return v.hslSaturationF();
92}
93
95{
96 return v.lightnessF();
97}
98
100{
101 return v.isValid();
102}
103
105{
106 v.setRedF(r);
107}
108
110{
111 v.setGreenF(g);
112}
113
115{
116 v.setBlueF(b);
117}
118
120{
121 v.setAlphaF(a);
122}
123
125{
126 float hue, saturation, value, alpha;
127 v.getHsvF(&hue, &saturation, &value, &alpha);
128 v.setHsvF(hsvHue, saturation, value, alpha);
129}
130
132{
133 float hue, saturation, value, alpha;
134 v.getHsvF(&hue, &saturation, &value, &alpha);
135 v.setHsvF(hue, hsvSaturation, value, alpha);
136}
137
139{
140 float hue, saturation, value, alpha;
141 v.getHsvF(&hue, &saturation, &value, &alpha);
142 v.setHsvF(hue, saturation, hsvValue, alpha);
143}
144
146{
147 float hue, saturation, lightness, alpha;
148 v.getHslF(&hue, &saturation, &lightness, &alpha);
149 v.setHslF(hslHue, saturation, lightness, alpha);
150}
151
153{
154 float hue, saturation, lightness, alpha;
155 v.getHslF(&hue, &saturation, &lightness, &alpha);
156 v.setHslF(hue, hslSaturation, lightness, alpha);
157}
158
160{
161 float hue, saturation, lightness, alpha;
162 v.getHslF(&hue, &saturation, &lightness, &alpha);
163 v.setHslF(hue, saturation, hslLightness, alpha);
164}
165
167{
168 if (params.isString())
169 return QQmlStringConverters::valueTypeFromNumberString<QVector2D, 2, u','>(params.toString());
170 if (params.isArray())
171 return QVector2D(params.property(0).toNumber(), params.property(1).toNumber());
172 return QVariant();
173}
174
176{
177 return QString(QLatin1String("QVector2D(%1, %2)")).arg(v.x()).arg(v.y());
178}
179
181{
182 return v.x();
183}
184
186{
187 return v.y();
188}
189
191{
192 v.setX(x);
193}
194
196{
197 v.setY(y);
198}
199
201{
202 return QVector2D::dotProduct(v, vec);
203}
204
206{
207 return v * vec;
208}
209
211{
212 return v * scalar;
213}
214
216{
217 return v + vec;
218}
219
221{
222 return v - vec;
223}
224
229
231{
232 return v.length();
233}
234
236{
237 return v.toVector3D();
238}
239
241{
242 return v.toVector4D();
243}
244
246{
247 qreal absEps = qAbs(epsilon);
248 if (qAbs(v.x() - vec.x()) > absEps)
249 return false;
250 if (qAbs(v.y() - vec.y()) > absEps)
251 return false;
252 return true;
253}
254
256{
257 return qFuzzyCompare(v, vec);
258}
259
261{
262 if (params.isString()) {
263 return QQmlStringConverters::valueTypeFromNumberString<QVector3D, 3, u',', u','>(
264 params.toString());
265 }
266
267 if (params.isArray()) {
268 return QVector3D(params.property(0).toNumber(), params.property(1).toNumber(),
269 params.property(2).toNumber());
270 }
271 return QVariant();
272}
273
275{
276 return QString(QLatin1String("QVector3D(%1, %2, %3)")).arg(v.x()).arg(v.y()).arg(v.z());
277}
278
280{
281 return v.x();
282}
283
285{
286 return v.y();
287}
288
290{
291 return v.z();
292}
293
295{
296 v.setX(x);
297}
298
300{
301 v.setY(y);
302}
303
305{
306 v.setZ(z);
307}
308
313
315{
316 return QVector3D::dotProduct(v, vec);
317}
318
320{
321 return (QVector4D(v, 1) * m).toVector3DAffine();
322}
323
325{
326 return v * vec;
327}
328
330{
331 return v * scalar;
332}
333
335{
336 return v + vec;
337}
338
340{
341 return v - vec;
342}
343
348
350{
351 return v.length();
352}
353
355{
356 return v.toVector2D();
357}
358
360{
361 return v.toVector4D();
362}
363
365{
366 qreal absEps = qAbs(epsilon);
367 if (qAbs(v.x() - vec.x()) > absEps)
368 return false;
369 if (qAbs(v.y() - vec.y()) > absEps)
370 return false;
371 if (qAbs(v.z() - vec.z()) > absEps)
372 return false;
373 return true;
374}
375
377{
378 return qFuzzyCompare(v, vec);
379}
380
382{
383 if (params.isString()) {
384 return QQmlStringConverters::valueTypeFromNumberString<QVector4D, 4, u',', u',', u','>(
385 params.toString());
386 }
387
388 if (params.isArray()) {
389 return QVector4D(params.property(0).toNumber(), params.property(1).toNumber(),
390 params.property(2).toNumber(), params.property(3).toNumber());
391 }
392
393 return QVariant();
394}
395
397{
398 return QString(QLatin1String("QVector4D(%1, %2, %3, %4)")).arg(v.x()).arg(v.y()).arg(v.z()).arg(v.w());
399}
400
402{
403 return v.x();
404}
405
407{
408 return v.y();
409}
410
412{
413 return v.z();
414}
415
417{
418 return v.w();
419}
420
422{
423 v.setX(x);
424}
425
427{
428 v.setY(y);
429}
430
432{
433 v.setZ(z);
434}
435
437{
438 v.setW(w);
439}
440
442{
443 return QVector4D::dotProduct(v, vec);
444}
445
447{
448 return v * vec;
449}
450
452{
453 return v * m;
454}
455
457{
458 return v * scalar;
459}
460
462{
463 return v + vec;
464}
465
467{
468 return v - vec;
469}
470
475
477{
478 return v.length();
479}
480
482{
483 return v.toVector2D();
484}
485
487{
488 return v.toVector3D();
489}
490
492{
493 qreal absEps = qAbs(epsilon);
494 if (qAbs(v.x() - vec.x()) > absEps)
495 return false;
496 if (qAbs(v.y() - vec.y()) > absEps)
497 return false;
498 if (qAbs(v.z() - vec.z()) > absEps)
499 return false;
500 if (qAbs(v.w() - vec.w()) > absEps)
501 return false;
502 return true;
503}
504
506{
507 return qFuzzyCompare(v, vec);
508}
509
511{
512 if (params.isString()) {
513 return QQmlStringConverters::valueTypeFromNumberString<QQuaternion, 4, u',', u',', u','>(
514 params.toString());
515 }
516
517 if (params.isArray()) {
518 return QQuaternion(params.property(0).toNumber(), params.property(1).toNumber(),
519 params.property(2).toNumber(), params.property(3).toNumber());
520 }
521
522 return QVariant();
523}
524
526{
527 return QString(QLatin1String("QQuaternion(%1, %2, %3, %4)")).arg(v.scalar()).arg(v.x()).arg(v.y()).arg(v.z());
528}
529
531{
532 return v.scalar();
533}
534
536{
537 return v.x();
538}
539
541{
542 return v.y();
543}
544
546{
547 return v.z();
548}
549
551{
552 v.setScalar(scalar);
553}
554
556{
557 v.setX(x);
558}
559
561{
562 v.setY(y);
563}
564
566{
567 v.setZ(z);
568}
569
571{
572 return QQuaternion::dotProduct(v, q);
573}
574
576{
577 return v * q;
578}
579
581{
582 return v * vec;
583}
584
586{
587 return v * factor;
588}
589
591{
592 return v + q;
593}
594
596{
597 return v - q;
598}
599
601{
602 return v.normalized();
603}
604
606{
607 return v.inverted();
608}
609
611{
612 return v.conjugated();
613}
614
616{
617 return v.length();
618}
619
621{
622 return v.toEulerAngles();
623}
624
626{
627 return v.toVector4D();
628}
629
631{
632 qreal absEps = qAbs(epsilon);
633 if (qAbs(v.scalar() - q.scalar()) > absEps)
634 return false;
635 if (qAbs(v.x() - q.x()) > absEps)
636 return false;
637 if (qAbs(v.y() - q.y()) > absEps)
638 return false;
639 if (qAbs(v.z() - q.z()) > absEps)
640 return false;
641 return true;
642}
643
645{
646 return qFuzzyCompare(v, q);
647}
648
650{
651 if (params.isNull() || params.isUndefined())
652 return QMatrix4x4();
653
654 if (params.isString()) {
656 u',', u',', u',', u',', u',', u',',
657 u',', u',', u',', u',', u',', u','>(
658 params.toString());
659 }
660
661 if (params.isArray() && params.property(QStringLiteral("length")).toInt() == 16) {
662 return QMatrix4x4(params.property(0).toNumber(),
663 params.property(1).toNumber(),
664 params.property(2).toNumber(),
665 params.property(3).toNumber(),
666 params.property(4).toNumber(),
667 params.property(5).toNumber(),
668 params.property(6).toNumber(),
669 params.property(7).toNumber(),
670 params.property(8).toNumber(),
671 params.property(9).toNumber(),
672 params.property(10).toNumber(),
673 params.property(11).toNumber(),
674 params.property(12).toNumber(),
675 params.property(13).toNumber(),
676 params.property(14).toNumber(),
677 params.property(15).toNumber());
678 }
679
680 return QVariant();
681}
682
684{
685 return v * m;
686}
687
689{
690 return v * vec;
691}
692
694{
695 return v.map(vec);
696}
697
699{
700 return v * factor;
701}
702
704{
705 return v + m;
706}
707
709{
710 return v - m;
711}
712
714{
715 return v.row(n);
716}
717
719{
720 return v.column(m);
721}
722
724{
725 return v.determinant();
726}
727
732
737
739{
740 return v.map(p);
741}
742
744{
745 return v.mapRect(r);
746}
747
749{
750 qreal absEps = qAbs(epsilon);
751 for (int i = 0; i < 4; ++i) {
752 for (int j = 0; j < 4; ++j) {
753 if (qAbs(v(i,j) - m(i,j)) > absEps) {
754 return false;
755 }
756 }
757 }
758 return true;
759}
760
762{
763 return qFuzzyCompare(v, m);
764}
765
789
809 float shearX, float scaleY,
810 float translateX, float translateY)
811{
812 return QMatrix4x4(scaleX, shearX, 0, translateX,
813 shearY, scaleY, 0, translateY,
814 0, 0, 1, 0,
815 0, 0, 0, 1);
816}
817
824QMatrix4x4 QQuickPlanarTransform::fromTranslate(float translateX, float translateY)
825{
826 QMatrix4x4 xf;
827 xf.translate(translateX, translateY);
828 return xf;
829}
830
839QMatrix4x4 QQuickPlanarTransform::fromScale(float scaleX, float scaleY, float originX, float originY)
840{
841 QMatrix4x4 xf;
842 xf.translate(originX, originY);
843 xf.scale(scaleX, scaleY);
844 xf.translate(-originX, -originY);
845 return xf;
846}
847
856QMatrix4x4 QQuickPlanarTransform::fromRotate(float angle, float originX, float originY)
857{
858 QMatrix4x4 xf;
859 xf.translate(originX, originY);
860 xf.rotate(angle, 0, 0, 1);
861 xf.translate(-originX, -originY);
862 return xf;
863}
864
873QMatrix4x4 QQuickPlanarTransform::fromShear(float shearX, float shearY, float originX, float originY)
874{
875 QMatrix4x4 xf;
876 xf.translate(originX, originY);
877 xf *= QMatrix4x4(1, shearX, 0, 0, shearY, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
878 xf.translate(-originX, -originY);
879 return xf;
880}
881
882template<typename T>
883void setFontProperty(QFont &font, void (QFont::*setter)(T value), QString name,
884 const QJSValue &params, bool *ok)
885{
887
888 if constexpr (std::is_same_v<T, bool>) {
889 if (value.isBool()) {
890 (font.*setter)(value.toBool());
891 *ok = true;
892 }
893 } else if constexpr (std::is_same_v<
894 typename std::remove_cv<typename std::remove_reference<T>::type>::type,
895 QString>) {
896 if (value.isString()) {
897 (font.*setter)(value.toString());
898 *ok = true;
899 }
900 } else if constexpr (std::is_integral_v<T> || std::is_enum_v<T>) {
901 if (value.isNumber()) {
902 (font.*setter)(T(value.toInt()));
903 *ok = true;
904 }
905 } else if constexpr (std::is_floating_point_v<T>) {
906 if (value.isNumber()) {
907 (font.*setter)(value.toNumber());
908 *ok = true;
909 }
910 }
911}
912
914{
915 if (!params.isObject())
916 return QVariant();
917
918 bool ok = false;
919 QFont ret;
920
933
934 const QJSValue vlspac = params.property(QStringLiteral("letterSpacing"));
935 if (vlspac.isNumber()) {
936 ret.setLetterSpacing(QFont::AbsoluteSpacing, vlspac.toNumber());
937 ok = true;
938 }
939
940 const QJSValue vshaping = params.property(QStringLiteral("preferShaping"));
941 if (vshaping.isBool()) {
942 const bool enable = vshaping.toBool();
943 const QFont::StyleStrategy strategy = ret.styleStrategy();
944 if (enable)
945 ret.setStyleStrategy(QFont::StyleStrategy(strategy & ~QFont::PreferNoShaping));
946 else
947 ret.setStyleStrategy(QFont::StyleStrategy(strategy | QFont::PreferNoShaping));
948 ok = true;
949 }
950
951 return ok ? ret : QVariant();
952}
953
955{
956 return QString(QLatin1String("QFont(%1)")).arg(v.toString());
957}
958
960{
961 return v.family();
962}
963
965{
966 v.setFamily(family);
967}
968
970{
971 return v.styleName();
972}
973
975{
976 v.setStyleName(style);
977}
978
980{
981 return v.bold();
982}
983
985{
986 v.setBold(b);
987}
988
990{
991 return v.weight();
992}
993
995{
996 v.setWeight(QFont::Weight(w));
997}
998
1000{
1001 return v.italic();
1002}
1003
1005{
1006 v.setItalic(b);
1007}
1008
1010{
1011 return v.underline();
1012}
1013
1015{
1016 v.setUnderline(b);
1017}
1018
1020{
1021 return v.overline();
1022}
1023
1025{
1026 v.setOverline(b);
1027}
1028
1030{
1031 return v.strikeOut();
1032}
1033
1035{
1036 v.setStrikeOut(b);
1037}
1038
1040{
1041 if (v.pointSizeF() == -1) {
1042 return v.pixelSize() * qreal(72.) / qreal(qt_defaultDpi());
1043 }
1044 return v.pointSizeF();
1045}
1046
1048{
1049 if ((v.resolveMask() & QFont::SizeResolved) && v.pixelSize() != -1) {
1050 qWarning() << "Both point size and pixel size set. Using pixel size.";
1051 return;
1052 }
1053
1054 if (size >= 0.0) {
1055 v.setPointSizeF(size);
1056 }
1057}
1058
1060{
1061 if (v.pixelSize() == -1) {
1062 return (v.pointSizeF() * qt_defaultDpi()) / qreal(72.);
1063 }
1064 return v.pixelSize();
1065}
1066
1068{
1069 if (size >0) {
1070 if ((v.resolveMask() & QFont::SizeResolved) && v.pointSizeF() != -1)
1071 qWarning() << "Both point size and pixel size set. Using pixel size.";
1072 v.setPixelSize(size);
1073 }
1074}
1075
1080
1085
1087{
1088 return v.letterSpacing();
1089}
1090
1095
1097{
1098 return v.wordSpacing();
1099}
1100
1102{
1103 v.setWordSpacing(size);
1104}
1105
1110
1115
1117{
1118 return v.kerning();
1119}
1120
1122{
1123 v.setKerning(b);
1124}
1125
1127{
1128 return (v.styleStrategy() & QFont::PreferNoShaping) == 0;
1129}
1130
1132{
1133 if (enable)
1134 v.setStyleStrategy(static_cast<QFont::StyleStrategy>(v.styleStrategy() & ~QFont::PreferNoShaping));
1135 else
1136 v.setStyleStrategy(static_cast<QFont::StyleStrategy>(v.styleStrategy() | QFont::PreferNoShaping));
1137}
1138
1140{
1141 v.clearVariableAxes();
1142 for (auto [variableAxisName, variableAxisValue] : variableAxes.asKeyValueRange()) {
1143 const auto maybeTag = QFont::Tag::fromString(variableAxisName);
1144 if (!maybeTag) {
1145 qWarning() << "Invalid variable axis" << variableAxisName << "ignored";
1146 continue;
1147 }
1148
1149 bool ok;
1150 float value = variableAxisValue.toFloat(&ok);
1151 if (!ok) {
1152 qWarning() << "Variable axis" << variableAxisName << "value" << variableAxisValue << "is not a floating point value.";
1153 continue;
1154 }
1155
1156 v.setVariableAxis(*maybeTag, value);
1157 }
1158}
1159
1161{
1163 for (const auto &tag : v.variableAxisTags())
1164 ret.insert(QString::fromUtf8(tag.toString()), v.variableAxisValue(tag));
1165
1166 return ret;
1167}
1168
1170{
1171 v.clearFeatures();
1172 for (auto [featureName, featureValue] : features.asKeyValueRange()) {
1173 const auto maybeTag = QFont::Tag::fromString(featureName);
1174 if (!maybeTag) {
1175 qWarning() << "Invalid font feature" << featureName << "ignored";
1176 continue;
1177 }
1178
1179 bool ok;
1180 quint32 value = featureValue.toUInt(&ok);
1181 if (!ok) {
1182 qWarning() << "Font feature" << featureName << "value" << featureValue << "is not an integer.";
1183 continue;
1184 }
1185
1186 v.setFeature(*maybeTag, value);
1187 }
1188}
1189
1191{
1193 for (const auto &tag : v.featureTags())
1194 ret.insert(QString::fromUtf8(tag.toString()), v.featureValue(tag));
1195
1196 return ret;
1197}
1198
1200{
1201 return (v.styleStrategy() & QFont::ContextFontMerging) != 0;
1202}
1203
1205{
1206 if (enable)
1207 v.setStyleStrategy(static_cast<QFont::StyleStrategy>(v.styleStrategy() | QFont::ContextFontMerging));
1208 else
1209 v.setStyleStrategy(static_cast<QFont::StyleStrategy>(v.styleStrategy() & ~QFont::ContextFontMerging));
1210}
1211
1213{
1214 if (!params.isObject())
1215 return QVariant();
1216
1217
1218 const QJSValue vName = params.property(QStringLiteral("namedColorSpace"));
1219 if (vName.isNumber())
1220 return QColorSpace((QColorSpace::NamedColorSpace)vName.toInt());
1221
1222 const QJSValue vPri = params.property(QStringLiteral("primaries"));
1223 const QJSValue vTra = params.property(QStringLiteral("transferFunction"));
1224 if (!vPri.isNumber() || !vTra.isNumber())
1225 return QVariant();
1226
1227 QColorSpace::Primaries pri = static_cast<QColorSpace::Primaries>(vPri.toInt());
1228 QColorSpace::TransferFunction tra = static_cast<QColorSpace::TransferFunction>(vTra.toInt());
1229 float gamma = 0.0f;
1231 const QJSValue vGam = params.property(QStringLiteral("gamma"));
1232 if (!vGam.isNumber())
1233 return QVariant();
1234 gamma = vGam.toNumber();
1235 }
1236
1237 return QColorSpace(pri, tra, gamma);
1238}
1239
1250
1255
1257{
1258 v.setPrimaries((QColorSpace::Primaries)primariesId);
1259}
1260
1265
1270
1272{
1273 return v.gamma();
1274}
1275
1277{
1278 v.setTransferFunction(v.transferFunction(), gamma);
1279}
1280
1282
1283#include "moc_qquickvaluetypes_p.cpp"
static const QColorSpacePrivate * get(const QColorSpace &colorSpace)
The QColorSpace class provides a color space abstraction.
Definition qcolorspace.h:21
Primaries
Predefined sets of primary colors.
Definition qcolorspace.h:32
NamedColorSpace
Predefined color spaces.
Definition qcolorspace.h:24
TransferFunction
Predefined transfer functions or gamma curves.
Definition qcolorspace.h:40
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
static QColor fromString(QAnyStringView name) noexcept
Definition qcolor.cpp:980
@ HexArgb
Definition qcolor.h:36
@ HexRgb
Definition qcolor.h:36
\reentrant
Definition qfont.h:22
void setPointSize(int)
Sets the point size to pointSize.
Definition qfont.cpp:985
void setStrikeOut(bool)
If enable is true, sets strikeout on; otherwise sets strikeout off.
Definition qfont.cpp:1315
Capitalization
Definition qfont.h:97
void setCapitalization(Capitalization)
Definition qfont.cpp:1725
void setWordSpacing(qreal spacing)
Definition qfont.cpp:1690
void setFamily(const QString &)
Sets the family name of the font.
Definition qfont.cpp:835
@ AbsoluteSpacing
Definition qfont.h:108
@ SizeResolved
Definition qfont.h:115
void setKerning(bool)
Enables kerning for this font if enable is true; otherwise disables it.
Definition qfont.cpp:1375
void setPixelSize(int)
Sets the font size to pixelSize pixels, with a maxiumum size of an unsigned 16-bit integer.
Definition qfont.cpp:1049
void setBold(bool)
If enable is true sets the font's weight to \l{Weight}{QFont::Bold}; otherwise sets the weight to \l{...
Definition qfont.h:373
void setHintingPreference(HintingPreference hintingPreference)
Definition qfont.cpp:957
void setItalic(bool b)
Sets the style() of the font to QFont::StyleItalic if enable is true; otherwise the style is set to Q...
Definition qfont.h:381
void setUnderline(bool)
If enable is true, sets underline on; otherwise sets underline off.
Definition qfont.cpp:1262
HintingPreference
Definition qfont.h:55
StyleStrategy
The style strategy tells the \l{QFont}{font matching} algorithm what type of fonts should be used to ...
Definition qfont.h:38
@ PreferNoShaping
Definition qfont.h:49
@ ContextFontMerging
Definition qfont.h:50
Weight
Qt uses a weighting scale from 1 to 1000 compatible with OpenType.
Definition qfont.h:63
void setWeight(Weight weight)
Sets the weight of the font to weight, using the scale defined by \l QFont::Weight enumeration.
Definition qfont.cpp:1205
The QJSValue class acts as a container for Qt/JavaScript data types.
Definition qjsvalue.h:31
bool toBool() const
Returns the boolean value of this QJSValue, using the conversion rules described in \l{ECMA-262} sect...
Definition qjsvalue.cpp:546
QJSValue property(const QString &name) const
Returns the value of this QJSValue's property with the given name.
iterator insert(const Key &key, const T &value)
Definition qmap.h:688
auto asKeyValueRange() &
Definition qmap.h:614
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
QMatrix4x4 transposed() const
Returns this matrix, transposed about its diagonal.
QMatrix4x4 inverted(bool *invertible=nullptr) const
Returns the inverse of this matrix.
QPoint map(const QPoint &point) const
Maps point by multiplying this matrix by point.
Definition qmatrix4x4.h:908
void translate(const QVector3D &vector)
Multiplies this matrix by another that translates coordinates by the components of vector.
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:217
virtual QVariant lighter(const QVariant &, qreal)
virtual QVariant tint(const QVariant &, const QVariant &)
virtual QVariant darker(const QVariant &, qreal)
virtual QVariant alpha(const QVariant &, qreal)
The QQuaternion class represents a quaternion consisting of a vector and scalar.
static QVariant create(const QJSValue &params)
void setNamedColorSpace(QQuickColorSpaceEnums::NamedColorSpace namedColorSpace)
QQuickColorSpaceEnums::NamedColorSpace namedColorSpace
QQuickColorSpaceEnums::TransferFunction transferFunction
void setPrimaries(QQuickColorSpaceEnums::Primaries primariesId)
QQuickColorSpaceEnums::Primaries primaries
void setTransferFunction(QQuickColorSpaceEnums::TransferFunction transferFunction)
Q_INVOKABLE QVariant alpha(qreal value) const
Q_INVOKABLE QVariant lighter(qreal factor=1.5) const
Q_INVOKABLE QQuickColorValueType(const QString &string)
Q_INVOKABLE QString toString() const
static QVariant create(const QJSValue &params)
Q_INVOKABLE QVariant darker(qreal factor=2.0) const
Q_INVOKABLE QVariant tint(QVariant factor) const
void setLetterSpacing(qreal spacing)
void setStyleName(const QString &)
QQuickFontEnums::Capitalization capitalization
void setCapitalization(QQuickFontEnums::Capitalization)
void setContextFontMerging(bool b)
void setFeatures(const QVariantMap &features)
void setVariableAxes(const QVariantMap &variableAxes)
QQuickFontEnums::HintingPreference hintingPreference
void setPointSize(qreal size)
void setHintingPreference(QQuickFontEnums::HintingPreference)
Q_INVOKABLE QString toString() const
void setWordSpacing(qreal spacing)
static QVariant create(const QJSValue &value)
void setFamily(const QString &)
static QVariant create(const QJSValue &params)
Q_INVOKABLE QMatrix4x4 minus(const QMatrix4x4 &m) const
Q_INVOKABLE QMatrix4x4 times(const QMatrix4x4 &m) const
Q_INVOKABLE QVector4D column(int m) const
Q_INVOKABLE qreal determinant() const
Q_INVOKABLE bool fuzzyEquals(const QMatrix4x4 &m, qreal epsilon) const
Q_INVOKABLE QPointF map(const QPointF p) const
Q_INVOKABLE QRectF mapRect(const QRectF r) const
Q_INVOKABLE QVector4D row(int n) const
Q_INVOKABLE QMatrix4x4 plus(const QMatrix4x4 &m) const
Q_INVOKABLE QMatrix4x4 transposed() const
Q_INVOKABLE QMatrix4x4 inverted() const
static Q_INVOKABLE QMatrix4x4 fromScale(float scaleX, float scaleY, float originX=0, float originY=0)
\qmlmethod matrix4x4 PlanarTransform::fromScale(real scaleX, real scaleY, real originX,...
static Q_INVOKABLE QMatrix4x4 fromAffineMatrix(float scaleX, float shearY, float shearX, float scaleY, float translateX, float translateY)
\qmlmethod matrix4x4 PlanarTransform::fromAffineMatrix(real scaleX, real shearY, ...
static Q_INVOKABLE QMatrix4x4 fromShear(float shearX, float shearY, float originX=0, float originY=0)
\qmlmethod matrix4x4 PlanarTransform::fromShear(float shearX, float shearY, float originX,...
QQuickPlanarTransform(QObject *parent=nullptr)
\qmltype PlanarTransform \inqmlmodule QtQuick
static Q_INVOKABLE QMatrix4x4 fromRotate(float angle, float originX=0, float originY=0)
\qmlmethod matrix4x4 PlanarTransform::fromRotate(real angle, real originX, real originY)
static Q_INVOKABLE QMatrix4x4 fromTranslate(float translateX, float translateY)
\qmlmethod matrix4x4 PlanarTransform::fromTranslate(real translateX, real translateY)
Q_INVOKABLE QQuaternion times(const QQuaternion &q) const
Q_INVOKABLE QVector4D toVector4d() const
Q_INVOKABLE qreal dotProduct(const QQuaternion &q) const
Q_INVOKABLE QString toString() const
Q_INVOKABLE qreal length() const
Q_INVOKABLE QQuaternion inverted() const
Q_INVOKABLE QQuaternion minus(const QQuaternion &q) const
Q_INVOKABLE QQuaternion conjugated() const
Q_INVOKABLE QQuaternion normalized() const
static QVariant create(const QJSValue &params)
Q_INVOKABLE QQuaternion plus(const QQuaternion &q) const
Q_INVOKABLE bool fuzzyEquals(const QQuaternion &q, qreal epsilon) const
Q_INVOKABLE QVector3D toEulerAngles() const
Q_INVOKABLE bool fuzzyEquals(const QVector2D &vec, qreal epsilon) const
static QVariant create(const QJSValue &params)
Q_INVOKABLE QString toString() const
Q_INVOKABLE qreal dotProduct(const QVector2D &vec) const
Q_INVOKABLE QVector4D toVector4d() const
Q_INVOKABLE QVector2D times(const QVector2D &vec) const
Q_INVOKABLE QVector2D minus(const QVector2D &vec) const
Q_INVOKABLE QVector2D normalized() const
Q_INVOKABLE QVector3D toVector3d() const
Q_INVOKABLE qreal length() const
Q_INVOKABLE QVector2D plus(const QVector2D &vec) const
Q_INVOKABLE QString toString() const
Q_INVOKABLE QVector3D normalized() const
Q_INVOKABLE qreal length() const
static QVariant create(const QJSValue &params)
Q_INVOKABLE QVector3D minus(const QVector3D &vec) const
Q_INVOKABLE qreal dotProduct(const QVector3D &vec) const
Q_INVOKABLE QVector3D times(const QMatrix4x4 &m) const
Q_INVOKABLE bool fuzzyEquals(const QVector3D &vec, qreal epsilon) const
Q_INVOKABLE QVector3D plus(const QVector3D &vec) const
Q_INVOKABLE QVector4D toVector4d() const
Q_INVOKABLE QVector3D crossProduct(const QVector3D &vec) const
Q_INVOKABLE QVector2D toVector2d() const
Q_INVOKABLE QVector4D plus(const QVector4D &vec) const
Q_INVOKABLE qreal dotProduct(const QVector4D &vec) const
Q_INVOKABLE QString toString() const
Q_INVOKABLE QVector3D toVector3d() const
Q_INVOKABLE qreal length() const
Q_INVOKABLE QVector2D toVector2d() const
Q_INVOKABLE bool fuzzyEquals(const QVector4D &vec, qreal epsilon) const
static QVariant create(const QJSValue &params)
Q_INVOKABLE QVector4D normalized() const
Q_INVOKABLE QVector4D times(const QVector4D &vec) const
Q_INVOKABLE QVector4D minus(const QVector4D &vec) const
\inmodule QtCore\reentrant
Definition qrect.h:484
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:6018
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
Definition qstring.cpp:8870
\inmodule QtCore
Definition qvariant.h:65
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:31
float length() const noexcept
Returns the length of the vector from the origin.
Definition qvectornd.h:519
QVector2D normalized() const noexcept
Returns the normalized unit vector form of this vector.
Definition qvectornd.h:529
static constexpr float dotProduct(QVector2D v1, QVector2D v2) noexcept
Returns the dot product of v1 and v2.
Definition qvectornd.h:604
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
float length() const noexcept
Returns the length of the vector from the origin.
Definition qvectornd.h:690
QVector3D normalized() const noexcept
Returns the normalized unit vector form of this vector.
Definition qvectornd.h:695
static constexpr float dotProduct(QVector3D v1, QVector3D v2) noexcept
Returns the dot product of v1 and v2.
Definition qvectornd.h:770
static constexpr QVector3D crossProduct(QVector3D v1, QVector3D v2) noexcept
Returns the cross-product of vectors v1 and v2, which is normal to the plane spanned by v1 and v2.
Definition qvectornd.h:775
The QVector4D class represents a vector or vertex in 4D space.
Definition qvectornd.h:330
QVector4D normalized() const noexcept
Returns the normalized unit vector form of this vector.
Definition qvectornd.h:910
float length() const noexcept
Returns the length of the vector from the origin.
Definition qvectornd.h:900
static constexpr float dotProduct(QVector4D v1, QVector4D v2) noexcept
Returns the dot product of v1 and v2.
Definition qvectornd.h:988
T valueTypeFromNumberString(const QString &s, bool *ok=nullptr)
Combined button and popup list for selecting options.
AudioChannelLayoutTag tag
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:333
Q_GUI_EXPORT int qt_defaultDpi()
Definition qfont.cpp:140
#define qWarning
Definition qlogging.h:166
return ret
constexpr T qAbs(const T &t)
Definition qnumeric.h:328
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
const GLfloat * m
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLboolean r
[2]
GLenum type
GLfloat angle
GLboolean enable
GLboolean GLboolean g
GLuint name
GLfloat n
GLint y
void ** params
const GLubyte * c
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]
GLfloat GLfloat GLfloat alpha
Definition qopenglext.h:418
GLsizei const GLchar *const * string
[0]
Definition qopenglext.h:694
static bool fromString(const QMetaObject *mo, QString s, Allocate &&allocate)
Q_AUTOTEST_EXPORT QQmlColorProvider * QQml_colorProvider(void)
static const qreal epsilon
void setFontProperty(QFont &font, void(QFont::*setter)(T value), QString name, const QJSValue &params, bool *ok)
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
#define QStringLiteral(str)
unsigned int quint32
Definition qtypes.h:50
double qreal
Definition qtypes.h:187