Qt 6.x
The Qt SDK
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/qcolorspace_p.h>
9#include <private/qfont_p.h>
10
12
15{
16}
17
19{
20 return params.isString() ? QColor::fromString(params.toString()) : QVariant();
21}
22
24{
25 return v.name(v.alpha() != 255 ? QColor::HexArgb : QColor::HexRgb);
26}
27
29{
30 return QQml_colorProvider()->lighter(this->v, factor);
31}
32
34{
35 return QQml_colorProvider()->darker(this->v, factor);
36}
37
39{
40 return QQml_colorProvider()->alpha(this->v, value);
41}
42
44{
45 return QQml_colorProvider()->tint(this->v, tintColor);
46}
47
49{
50 return v.redF();
51}
52
54{
55 return v.greenF();
56}
57
59{
60 return v.blueF();
61}
62
64{
65 return v.alphaF();
66}
67
69{
70 return v.hsvHueF();
71}
72
74{
75 return v.hsvSaturationF();
76}
77
79{
80 return v.valueF();
81}
82
84{
85 return v.hslHueF();
86}
87
89{
90 return v.hslSaturationF();
91}
92
94{
95 return v.lightnessF();
96}
97
99{
100 return v.isValid();
101}
102
104{
105 v.setRedF(r);
106}
107
109{
110 v.setGreenF(g);
111}
112
114{
115 v.setBlueF(b);
116}
117
119{
120 v.setAlphaF(a);
121}
122
124{
125 float hue, saturation, value, alpha;
126 v.getHsvF(&hue, &saturation, &value, &alpha);
127 v.setHsvF(hsvHue, saturation, value, alpha);
128}
129
131{
132 float hue, saturation, value, alpha;
133 v.getHsvF(&hue, &saturation, &value, &alpha);
134 v.setHsvF(hue, hsvSaturation, value, alpha);
135}
136
138{
139 float hue, saturation, value, alpha;
140 v.getHsvF(&hue, &saturation, &value, &alpha);
141 v.setHsvF(hue, saturation, hsvValue, alpha);
142}
143
145{
146 float hue, saturation, lightness, alpha;
147 v.getHslF(&hue, &saturation, &lightness, &alpha);
148 v.setHslF(hslHue, saturation, lightness, alpha);
149}
150
152{
153 float hue, saturation, lightness, alpha;
154 v.getHslF(&hue, &saturation, &lightness, &alpha);
155 v.setHslF(hue, hslSaturation, lightness, alpha);
156}
157
159{
160 float hue, saturation, lightness, alpha;
161 v.getHslF(&hue, &saturation, &lightness, &alpha);
162 v.setHslF(hue, saturation, hslLightness, alpha);
163}
164
165template<typename T, int NumParams>
167{
168 Q_STATIC_ASSERT_X(NumParams == 2 || NumParams == 3 || NumParams == 4 || NumParams == 16,
169 "Unsupported number of params; add an additional case below if necessary.");
170
171 if (s.count(u',') != NumParams - 1)
172 return QVariant();
173
175 bool ok = true;
176 for (qsizetype prev = 0, next = s.indexOf(u','), length = s.size(); ok && prev < length;) {
177 parameters.append(s.mid(prev, next - prev).toFloat(&ok));
178 prev = next + 1;
179 next = (parameters.size() == NumParams - 1) ? length : s.indexOf(u',', prev);
180 }
181
182 if (!ok)
183 return QVariant();
184
185 if constexpr (NumParams == 2) {
186 return T(parameters[0], parameters[1]);
187 } else if constexpr (NumParams == 3) {
188 return T(parameters[0], parameters[1], parameters[2]);
189 } else if constexpr (NumParams == 4) {
190 return T(parameters[0], parameters[1], parameters[2], parameters[3]);
191 } else if constexpr (NumParams == 16) {
192 return T(parameters[0], parameters[1], parameters[2], parameters[3],
193 parameters[4], parameters[5], parameters[6], parameters[7],
194 parameters[8], parameters[9], parameters[10], parameters[11],
195 parameters[12], parameters[13], parameters[14], parameters[15]);
196 } else {
197 Q_UNREACHABLE();
198 }
199
200 return QVariant();
201}
202
204{
205 if (params.isString())
206 return createValueTypeFromNumberString<QVector2D, 2>(params.toString());
207 if (params.isArray())
208 return QVector2D(params.property(0).toNumber(), params.property(1).toNumber());
209 return QVariant();
210}
211
213{
214 return QString(QLatin1String("QVector2D(%1, %2)")).arg(v.x()).arg(v.y());
215}
216
218{
219 return v.x();
220}
221
223{
224 return v.y();
225}
226
228{
229 v.setX(x);
230}
231
233{
234 v.setY(y);
235}
236
238{
239 return QVector2D::dotProduct(v, vec);
240}
241
243{
244 return v * vec;
245}
246
248{
249 return v * scalar;
250}
251
253{
254 return v + vec;
255}
256
258{
259 return v - vec;
260}
261
263{
264 return v.normalized();
265}
266
268{
269 return v.length();
270}
271
273{
274 return v.toVector3D();
275}
276
278{
279 return v.toVector4D();
280}
281
283{
284 qreal absEps = qAbs(epsilon);
285 if (qAbs(v.x() - vec.x()) > absEps)
286 return false;
287 if (qAbs(v.y() - vec.y()) > absEps)
288 return false;
289 return true;
290}
291
293{
294 return qFuzzyCompare(v, vec);
295}
296
298{
299 if (params.isString())
300 return createValueTypeFromNumberString<QVector3D, 3>(params.toString());
301
302 if (params.isArray()) {
303 return QVector3D(params.property(0).toNumber(), params.property(1).toNumber(),
304 params.property(2).toNumber());
305 }
306 return QVariant();
307}
308
310{
311 return QString(QLatin1String("QVector3D(%1, %2, %3)")).arg(v.x()).arg(v.y()).arg(v.z());
312}
313
315{
316 return v.x();
317}
318
320{
321 return v.y();
322}
323
325{
326 return v.z();
327}
328
330{
331 v.setX(x);
332}
333
335{
336 v.setY(y);
337}
338
340{
341 v.setZ(z);
342}
343
345{
346 return QVector3D::crossProduct(v, vec);
347}
348
350{
351 return QVector3D::dotProduct(v, vec);
352}
353
355{
356 return (QVector4D(v, 1) * m).toVector3DAffine();
357}
358
360{
361 return v * vec;
362}
363
365{
366 return v * scalar;
367}
368
370{
371 return v + vec;
372}
373
375{
376 return v - vec;
377}
378
380{
381 return v.normalized();
382}
383
385{
386 return v.length();
387}
388
390{
391 return v.toVector2D();
392}
393
395{
396 return v.toVector4D();
397}
398
400{
401 qreal absEps = qAbs(epsilon);
402 if (qAbs(v.x() - vec.x()) > absEps)
403 return false;
404 if (qAbs(v.y() - vec.y()) > absEps)
405 return false;
406 if (qAbs(v.z() - vec.z()) > absEps)
407 return false;
408 return true;
409}
410
412{
413 return qFuzzyCompare(v, vec);
414}
415
417{
418 if (params.isString())
419 return createValueTypeFromNumberString<QVector4D, 4>(params.toString());
420
421 if (params.isArray()) {
422 return QVector4D(params.property(0).toNumber(), params.property(1).toNumber(),
423 params.property(2).toNumber(), params.property(3).toNumber());
424 }
425
426 return QVariant();
427}
428
430{
431 return QString(QLatin1String("QVector4D(%1, %2, %3, %4)")).arg(v.x()).arg(v.y()).arg(v.z()).arg(v.w());
432}
433
435{
436 return v.x();
437}
438
440{
441 return v.y();
442}
443
445{
446 return v.z();
447}
448
450{
451 return v.w();
452}
453
455{
456 v.setX(x);
457}
458
460{
461 v.setY(y);
462}
463
465{
466 v.setZ(z);
467}
468
470{
471 v.setW(w);
472}
473
475{
476 return QVector4D::dotProduct(v, vec);
477}
478
480{
481 return v * vec;
482}
483
485{
486 return v * m;
487}
488
490{
491 return v * scalar;
492}
493
495{
496 return v + vec;
497}
498
500{
501 return v - vec;
502}
503
505{
506 return v.normalized();
507}
508
510{
511 return v.length();
512}
513
515{
516 return v.toVector2D();
517}
518
520{
521 return v.toVector3D();
522}
523
525{
526 qreal absEps = qAbs(epsilon);
527 if (qAbs(v.x() - vec.x()) > absEps)
528 return false;
529 if (qAbs(v.y() - vec.y()) > absEps)
530 return false;
531 if (qAbs(v.z() - vec.z()) > absEps)
532 return false;
533 if (qAbs(v.w() - vec.w()) > absEps)
534 return false;
535 return true;
536}
537
539{
540 return qFuzzyCompare(v, vec);
541}
542
544{
545 if (params.isString())
546 return createValueTypeFromNumberString<QQuaternion, 4>(params.toString());
547
548 if (params.isArray()) {
549 return QQuaternion(params.property(0).toNumber(), params.property(1).toNumber(),
550 params.property(2).toNumber(), params.property(3).toNumber());
551 }
552
553 return QVariant();
554}
555
557{
558 return QString(QLatin1String("QQuaternion(%1, %2, %3, %4)")).arg(v.scalar()).arg(v.x()).arg(v.y()).arg(v.z());
559}
560
562{
563 return v.scalar();
564}
565
567{
568 return v.x();
569}
570
572{
573 return v.y();
574}
575
577{
578 return v.z();
579}
580
582{
583 v.setScalar(scalar);
584}
585
587{
588 v.setX(x);
589}
590
592{
593 v.setY(y);
594}
595
597{
598 v.setZ(z);
599}
600
602{
603 return QQuaternion::dotProduct(v, q);
604}
605
607{
608 return v * q;
609}
610
612{
613 return v * vec;
614}
615
617{
618 return v * factor;
619}
620
622{
623 return v + q;
624}
625
627{
628 return v - q;
629}
630
632{
633 return v.normalized();
634}
635
637{
638 return v.inverted();
639}
640
642{
643 return v.conjugated();
644}
645
647{
648 return v.length();
649}
650
652{
653 return v.toEulerAngles();
654}
655
657{
658 return v.toVector4D();
659}
660
662{
663 qreal absEps = qAbs(epsilon);
664 if (qAbs(v.scalar() - q.scalar()) > absEps)
665 return false;
666 if (qAbs(v.x() - q.x()) > absEps)
667 return false;
668 if (qAbs(v.y() - q.y()) > absEps)
669 return false;
670 if (qAbs(v.z() - q.z()) > absEps)
671 return false;
672 return true;
673}
674
676{
677 return qFuzzyCompare(v, q);
678}
679
681{
682 if (params.isNull() || params.isUndefined())
683 return QMatrix4x4();
684
685 if (params.isString())
686 return createValueTypeFromNumberString<QMatrix4x4, 16>(params.toString());
687
688 if (params.isArray() && params.property(QStringLiteral("length")).toInt() == 16) {
689 return QMatrix4x4(params.property(0).toNumber(),
690 params.property(1).toNumber(),
691 params.property(2).toNumber(),
692 params.property(3).toNumber(),
693 params.property(4).toNumber(),
694 params.property(5).toNumber(),
695 params.property(6).toNumber(),
696 params.property(7).toNumber(),
697 params.property(8).toNumber(),
698 params.property(9).toNumber(),
699 params.property(10).toNumber(),
700 params.property(11).toNumber(),
701 params.property(12).toNumber(),
702 params.property(13).toNumber(),
703 params.property(14).toNumber(),
704 params.property(15).toNumber());
705 }
706
707 return QVariant();
708}
709
711{
712 return v * m;
713}
714
716{
717 return v * vec;
718}
719
721{
722 return v.map(vec);
723}
724
726{
727 return v * factor;
728}
729
731{
732 return v + m;
733}
734
736{
737 return v - m;
738}
739
741{
742 return v.row(n);
743}
744
746{
747 return v.column(m);
748}
749
751{
752 return v.determinant();
753}
754
756{
757 return v.inverted();
758}
759
761{
762 return v.transposed();
763}
764
766{
767 return v.map(p);
768}
769
771{
772 return v.mapRect(r);
773}
774
776{
777 qreal absEps = qAbs(epsilon);
778 for (int i = 0; i < 4; ++i) {
779 for (int j = 0; j < 4; ++j) {
780 if (qAbs(v(i,j) - m(i,j)) > absEps) {
781 return false;
782 }
783 }
784 }
785 return true;
786}
787
789{
790 return qFuzzyCompare(v, m);
791}
792
793template<typename T>
794void setFontProperty(QFont &font, void (QFont::*setter)(T value), QString name,
795 const QJSValue &params, bool *ok)
796{
798
799 if constexpr (std::is_same_v<T, bool>) {
800 if (value.isBool()) {
801 (font.*setter)(value.toBool());
802 *ok = true;
803 }
804 } else if constexpr (std::is_same_v<
805 typename std::remove_cv<typename std::remove_reference<T>::type>::type,
806 QString>) {
807 if (value.isString()) {
808 (font.*setter)(value.toString());
809 *ok = true;
810 }
811 } else if constexpr (std::is_integral_v<T> || std::is_enum_v<T>) {
812 if (value.isNumber()) {
813 (font.*setter)(T(value.toInt()));
814 *ok = true;
815 }
816 } else if constexpr (std::is_floating_point_v<T>) {
817 if (value.isNumber()) {
818 (font.*setter)(value.toNumber());
819 *ok = true;
820 }
821 }
822}
823
825{
826 if (!params.isObject())
827 return QVariant();
828
829 bool ok = false;
830 QFont ret;
831
844
845 const QJSValue vlspac = params.property(QStringLiteral("letterSpacing"));
846 if (vlspac.isNumber()) {
847 ret.setLetterSpacing(QFont::AbsoluteSpacing, vlspac.toNumber());
848 ok = true;
849 }
850
851 const QJSValue vshaping = params.property(QStringLiteral("preferShaping"));
852 if (vshaping.isBool()) {
853 const bool enable = vshaping.toBool();
854 const QFont::StyleStrategy strategy = ret.styleStrategy();
855 if (enable)
856 ret.setStyleStrategy(QFont::StyleStrategy(strategy & ~QFont::PreferNoShaping));
857 else
858 ret.setStyleStrategy(QFont::StyleStrategy(strategy | QFont::PreferNoShaping));
859 ok = true;
860 }
861
862 return ok ? ret : QVariant();
863}
864
866{
867 return QString(QLatin1String("QFont(%1)")).arg(v.toString());
868}
869
871{
872 return v.family();
873}
874
876{
877 v.setFamily(family);
878}
879
881{
882 return v.styleName();
883}
884
886{
887 v.setStyleName(style);
888}
889
891{
892 return v.bold();
893}
894
896{
897 v.setBold(b);
898}
899
901{
902 return v.weight();
903}
904
906{
907 v.setWeight(QFont::Weight(w));
908}
909
911{
912 return v.italic();
913}
914
916{
917 v.setItalic(b);
918}
919
921{
922 return v.underline();
923}
924
926{
927 v.setUnderline(b);
928}
929
931{
932 return v.overline();
933}
934
936{
937 v.setOverline(b);
938}
939
941{
942 return v.strikeOut();
943}
944
946{
947 v.setStrikeOut(b);
948}
949
951{
952 if (v.pointSizeF() == -1) {
953 return v.pixelSize() * qreal(72.) / qreal(qt_defaultDpi());
954 }
955 return v.pointSizeF();
956}
957
959{
960 if ((v.resolveMask() & QFont::SizeResolved) && v.pixelSize() != -1) {
961 qWarning() << "Both point size and pixel size set. Using pixel size.";
962 return;
963 }
964
965 if (size >= 0.0) {
966 v.setPointSizeF(size);
967 }
968}
969
971{
972 if (v.pixelSize() == -1) {
973 return (v.pointSizeF() * qt_defaultDpi()) / qreal(72.);
974 }
975 return v.pixelSize();
976}
977
979{
980 if (size >0) {
981 if ((v.resolveMask() & QFont::SizeResolved) && v.pointSizeF() != -1)
982 qWarning() << "Both point size and pixel size set. Using pixel size.";
983 v.setPixelSize(size);
984 }
985}
986
988{
989 return (QQuickFontEnums::Capitalization)v.capitalization();
990}
991
993{
994 v.setCapitalization((QFont::Capitalization)c);
995}
996
998{
999 return v.letterSpacing();
1000}
1001
1003{
1004 v.setLetterSpacing(QFont::AbsoluteSpacing, size);
1005}
1006
1008{
1009 return v.wordSpacing();
1010}
1011
1013{
1014 v.setWordSpacing(size);
1015}
1016
1018{
1019 return QQuickFontEnums::HintingPreference(v.hintingPreference());
1020}
1021
1023{
1024 v.setHintingPreference(QFont::HintingPreference(hintingPreference));
1025}
1026
1028{
1029 return v.kerning();
1030}
1031
1033{
1034 v.setKerning(b);
1035}
1036
1038{
1039 return (v.styleStrategy() & QFont::PreferNoShaping) == 0;
1040}
1041
1043{
1044 if (enable)
1045 v.setStyleStrategy(static_cast<QFont::StyleStrategy>(v.styleStrategy() & ~QFont::PreferNoShaping));
1046 else
1047 v.setStyleStrategy(static_cast<QFont::StyleStrategy>(v.styleStrategy() | QFont::PreferNoShaping));
1048}
1049
1051{
1052 v.clearFeatures();
1053 for (auto it = features.constBegin(); it != features.constEnd(); ++it) {
1054 QString featureName = it.key();
1055 quint32 tag = QFont::stringToTag(featureName.toUtf8());
1056 if (tag == 0) {
1057 qWarning() << "Invalid font feature" << featureName << "ignored";
1058 continue;
1059 }
1060
1061 bool ok;
1062 quint32 value = it.value().toUInt(&ok);
1063 if (!ok) {
1064 qWarning() << "Font feature value" << it.value() << "is not an integer.";
1065 continue;
1066 }
1067
1068 v.setFeature(tag, value);
1069 }
1070}
1071
1073{
1075 for (quint32 tag : v.featureTags()) {
1077
1078 ret.insert(featureName, v.featureValue(tag));
1079 }
1080
1081 return ret;
1082}
1083
1085{
1086 if (!params.isObject())
1087 return QVariant();
1088
1089
1090 const QJSValue vName = params.property(QStringLiteral("namedColorSpace"));
1091 if (vName.isNumber())
1093
1094 const QJSValue vPri = params.property(QStringLiteral("primaries"));
1095 const QJSValue vTra = params.property(QStringLiteral("transferFunction"));
1096 if (!vPri.isNumber() || !vTra.isNumber())
1097 return QVariant();
1098
1099 QColorSpace::Primaries pri = static_cast<QColorSpace::Primaries>(vPri.toInt());
1101 float gamma = 0.0f;
1103 const QJSValue vGam = params.property(QStringLiteral("gamma"));
1104 if (!vGam.isNumber())
1105 return QVariant();
1106 gamma = vGam.toNumber();
1107 }
1108
1109 return QColorSpace(pri, tra, gamma);
1110}
1111
1113{
1114 if (const auto *p = QColorSpacePrivate::get(v))
1115 return (QQuickColorSpaceEnums::NamedColorSpace)p->namedColorSpace;
1117}
1119{
1121}
1122
1124{
1125 return (QQuickColorSpaceEnums::Primaries)v.primaries();
1126}
1127
1129{
1130 v.setPrimaries((QColorSpace::Primaries)primariesId);
1131}
1132
1134{
1135 return (QQuickColorSpaceEnums::TransferFunction)v.transferFunction();
1136}
1137
1139{
1140 v.setTransferFunction((QColorSpace::TransferFunction)transferFunction, v.gamma());
1141}
1142
1144{
1145 return v.gamma();
1146}
1147
1149{
1150 v.setTransferFunction(v.transferFunction(), gamma);
1151}
1152
1154
1155#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:20
static QByteArray tagToString(quint32 tag)
Definition qfont.cpp:2409
void setPointSize(int)
Sets the point size to pointSize.
Definition qfont.cpp:970
void setStrikeOut(bool)
If enable is true, sets strikeout on; otherwise sets strikeout off.
Definition qfont.cpp:1300
Capitalization
Definition qfont.h:94
void setCapitalization(Capitalization)
Definition qfont.cpp:1702
void setWordSpacing(qreal spacing)
Definition qfont.cpp:1667
void setFamily(const QString &)
Sets the family name of the font.
Definition qfont.cpp:814
@ AbsoluteSpacing
Definition qfont.h:105
@ SizeResolved
Definition qfont.h:112
void setKerning(bool)
Enables kerning for this font if enable is true; otherwise disables it.
Definition qfont.cpp:1360
void setPixelSize(int)
Sets the font size to pixelSize pixels, with a maxiumum size of an unsigned 16-bit integer.
Definition qfont.cpp:1034
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:312
void setHintingPreference(HintingPreference hintingPreference)
Definition qfont.cpp:942
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:320
void setUnderline(bool)
If enable is true, sets underline on; otherwise sets underline off.
Definition qfont.cpp:1247
HintingPreference
Definition qfont.h:52
StyleStrategy
The style strategy tells the \l{QFont}{font matching} algorithm what type of fonts should be used to ...
Definition qfont.h:36
@ PreferNoShaping
Definition qfont.h:47
static quint32 stringToTag(const char *tagString)
Definition qfont.cpp:2431
Weight
Qt uses a weighting scale from 1 to 1000 compatible with OpenType.
Definition qfont.h:60
void setWeight(Weight weight)
Sets the weight of the font to weight, using the scale defined by \l QFont::Weight enumeration.
Definition qfont.cpp:1190
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:525
qint32 toInt() const
Returns the signed 32-bit integer value of this QJSValue, using the conversion rules described in \l{...
Definition qjsvalue.cpp:545
double toNumber() const
Returns the number value of this QJSValue, as defined in \l{ECMA-262} section 9.3,...
Definition qjsvalue.cpp:505
bool isNumber() const
Returns true if this QJSValue is of the primitive type Number; otherwise returns false.
Definition qjsvalue.cpp:302
bool isBool() const
Returns true if this QJSValue is of the primitive type Boolean; otherwise returns false.
Definition qjsvalue.cpp:291
QJSValue property(const QString &name) const
Returns the value of this QJSValue's property with the given name.
const_iterator constBegin() const
Definition qmap.h:599
const_iterator constEnd() const
Definition qmap.h:603
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
\inmodule QtCore\reentrant
Definition qpoint.h:214
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.
Definition qquaternion.h:21
QQuaternion conjugated() const
QQuaternion normalized() const
Returns the normalized unit form of this quaternion.
static constexpr float dotProduct(const QQuaternion &q1, const QQuaternion &q2)
QQuaternion inverted() const
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 setFeatures(const QVariantMap &features)
void setPixelSize(int size)
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
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:483
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5857
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
Definition qstring.cpp:8606
QByteArray toUtf8() const &
Definition qstring.h:563
constexpr size_type size() const noexcept
void append(const T &t)
\inmodule QtCore
Definition qvariant.h:64
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:31
constexpr float y() const noexcept
Returns the y coordinate of this point.
Definition qvectornd.h:502
QVector2D normalized() const noexcept
Returns the normalized unit vector form of this vector.
Definition qvectornd.h:529
constexpr float x() const noexcept
Returns the x coordinate of this point.
Definition qvectornd.h:501
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
QVector3D normalized() const noexcept
Returns the normalized unit vector form of this vector.
Definition qvectornd.h:695
constexpr float y() const noexcept
Returns the y coordinate of this point.
Definition qvectornd.h:671
constexpr float x() const noexcept
Returns the x coordinate of this point.
Definition qvectornd.h:670
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
constexpr float z() const noexcept
Returns the z coordinate of this point.
Definition qvectornd.h:672
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
constexpr float x() const noexcept
Returns the x coordinate of this point.
Definition qvectornd.h:878
constexpr float w() const noexcept
Returns the w coordinate of this point.
Definition qvectornd.h:881
constexpr float y() const noexcept
Returns the y coordinate of this point.
Definition qvectornd.h:879
static constexpr float dotProduct(QVector4D v1, QVector4D v2) noexcept
Returns the dot product of v1 and v2.
Definition qvectornd.h:988
constexpr float z() const noexcept
Returns the z coordinate of this point.
Definition qvectornd.h:880
QSet< QString >::iterator it
short next
Definition keywords.cpp:445
Combined button and popup list for selecting options.
#define Q_STATIC_ASSERT_X(Condition, Message)
Definition qassert.h:108
AudioChannelLayoutTag tag
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Definition qfloat16.h:287
Q_GUI_EXPORT int qt_defaultDpi()
Definition qfont.cpp:137
#define qWarning
Definition qlogging.h:162
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 GLuint GLenum GLsizei length
GLenum type
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
GLdouble s
[6]
Definition qopenglext.h:235
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
QVariant createValueTypeFromNumberString(const QString &s)
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:45
ptrdiff_t qsizetype
Definition qtypes.h:70
double qreal
Definition qtypes.h:92
static int toInt(const QChar &qc, int R)