4#include <private/qquickvaluetypes_p.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>
76 return v.hsvSaturationF();
91 return v.hslSaturationF();
96 return v.lightnessF();
147 float hue, saturation, lightness,
alpha;
148 v.getHslF(&hue, &saturation, &lightness, &
alpha);
154 float hue, saturation, lightness,
alpha;
155 v.getHslF(&hue, &saturation, &lightness, &
alpha);
161 float hue, saturation, lightness,
alpha;
162 v.getHslF(&hue, &saturation, &lightness, &
alpha);
169 return QQmlStringConverters::valueTypeFromNumberString<QVector2D, 2, u','>(
params.toString());
237 return v.toVector3D();
242 return v.toVector4D();
248 if (
qAbs(
v.x() - vec.x()) > absEps)
250 if (
qAbs(
v.y() - vec.y()) > absEps)
263 return QQmlStringConverters::valueTypeFromNumberString<QVector3D, 3, u',', u','>(
269 params.property(2).toNumber());
356 return v.toVector2D();
361 return v.toVector4D();
367 if (
qAbs(
v.x() - vec.x()) > absEps)
369 if (
qAbs(
v.y() - vec.y()) > absEps)
371 if (
qAbs(
v.z() - vec.z()) > absEps)
384 return QQmlStringConverters::valueTypeFromNumberString<QVector4D, 4, u',', u',', u','>(
390 params.property(2).toNumber(),
params.property(3).toNumber());
483 return v.toVector2D();
488 return v.toVector3D();
494 if (
qAbs(
v.x() - vec.x()) > absEps)
496 if (
qAbs(
v.y() - vec.y()) > absEps)
498 if (
qAbs(
v.z() - vec.z()) > absEps)
500 if (
qAbs(
v.w() - vec.w()) > absEps)
513 return QQmlStringConverters::valueTypeFromNumberString<QQuaternion, 4, u',', u',', u','>(
519 params.property(2).toNumber(),
params.property(3).toNumber());
572 return QQuaternion::dotProduct(
v,
q);
602 return v.normalized();
612 return v.conjugated();
622 return v.toEulerAngles();
627 return v.toVector4D();
633 if (
qAbs(
v.scalar() -
q.scalar()) > absEps)
635 if (
qAbs(
v.x() -
q.x()) > absEps)
637 if (
qAbs(
v.y() -
q.y()) > absEps)
639 if (
qAbs(
v.z() -
q.z()) > absEps)
656 u
',', u
',', u
',', u
',', u
',', u
',',
657 u
',', u
',', u
',', u
',', u
',', u
','>(
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());
725 return v.determinant();
751 for (
int i = 0;
i < 4; ++
i) {
752 for (
int j = 0;
j < 4; ++
j) {
809 float shearX,
float scaleY,
810 float translateX,
float translateY)
812 return QMatrix4x4(scaleX, shearX, 0, translateX,
813 shearY, scaleY, 0, translateY,
843 xf.scale(scaleX, scaleY);
844 xf.translate(-originX, -originY);
860 xf.rotate(
angle, 0, 0, 1);
861 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);
888 if constexpr (std::is_same_v<T, bool>) {
889 if (
value.isBool()) {
893 }
else if constexpr (std::is_same_v<
894 typename std::remove_cv<typename std::remove_reference<T>::type>
::type,
896 if (
value.isString()) {
900 }
else if constexpr (std::is_integral_v<T> || std::is_enum_v<T>) {
901 if (
value.isNumber()) {
905 }
else if constexpr (std::is_floating_point_v<T>) {
906 if (
value.isNumber()) {
935 if (vlspac.isNumber()) {
941 if (vshaping.isBool()) {
971 return v.styleName();
976 v.setStyleName(style);
1011 return v.underline();
1021 return v.overline();
1031 return v.strikeOut();
1041 if (
v.pointSizeF() == -1) {
1044 return v.pointSizeF();
1050 qWarning() <<
"Both point size and pixel size set. Using pixel size.";
1055 v.setPointSizeF(
size);
1061 if (
v.pixelSize() == -1) {
1064 return v.pixelSize();
1071 qWarning() <<
"Both point size and pixel size set. Using pixel size.";
1072 v.setPixelSize(
size);
1088 return v.letterSpacing();
1098 return v.wordSpacing();
1103 v.setWordSpacing(
size);
1141 v.clearVariableAxes();
1143 const auto maybeTag = QFont::Tag::fromString(variableAxisName);
1145 qWarning() <<
"Invalid variable axis" << variableAxisName <<
"ignored";
1150 float value = variableAxisValue.toFloat(&
ok);
1152 qWarning() <<
"Variable axis" << variableAxisName <<
"value" << variableAxisValue <<
"is not a floating point value.";
1156 v.setVariableAxis(*maybeTag,
value);
1163 for (
const auto &
tag :
v.variableAxisTags())
1173 const auto maybeTag = QFont::Tag::fromString(featureName);
1175 qWarning() <<
"Invalid font feature" << featureName <<
"ignored";
1182 qWarning() <<
"Font feature" << featureName <<
"value" << featureValue <<
"is not an integer.";
1186 v.setFeature(*maybeTag,
value);
1193 for (
const auto &
tag :
v.featureTags())
1219 if (vName.isNumber())
1224 if (!vPri.isNumber() || !vTra.isNumber())
1232 if (!vGam.isNumber())
1234 gamma = vGam.toNumber();
1278 v.setTransferFunction(
v.transferFunction(),
gamma);
1283#include "moc_qquickvaluetypes_p.cpp"
static const QColorSpacePrivate * get(const QColorSpace &colorSpace)
The QColorSpace class provides a color space abstraction.
Primaries
Predefined sets of primary colors.
NamedColorSpace
Predefined color spaces.
TransferFunction
Predefined transfer functions or gamma curves.
The QColor class provides colors based on RGB, HSV or CMYK values.
static QColor fromString(QAnyStringView name) noexcept
void setPointSize(int)
Sets the point size to pointSize.
void setStrikeOut(bool)
If enable is true, sets strikeout on; otherwise sets strikeout off.
void setCapitalization(Capitalization)
void setWordSpacing(qreal spacing)
void setFamily(const QString &)
Sets the family name of the font.
void setKerning(bool)
Enables kerning for this font if enable is true; otherwise disables it.
void setPixelSize(int)
Sets the font size to pixelSize pixels, with a maxiumum size of an unsigned 16-bit integer.
void setBold(bool)
If enable is true sets the font's weight to \l{Weight}{QFont::Bold}; otherwise sets the weight to \l{...
void setHintingPreference(HintingPreference hintingPreference)
void setItalic(bool b)
Sets the style() of the font to QFont::StyleItalic if enable is true; otherwise the style is set to Q...
void setUnderline(bool)
If enable is true, sets underline on; otherwise sets underline off.
StyleStrategy
The style strategy tells the \l{QFont}{font matching} algorithm what type of fonts should be used to ...
Weight
Qt uses a weighting scale from 1 to 1000 compatible with OpenType.
void setWeight(Weight weight)
Sets the weight of the font to weight, using the scale defined by \l QFont::Weight enumeration.
The QJSValue class acts as a container for Qt/JavaScript data types.
bool toBool() const
Returns the boolean value of this QJSValue, using the conversion rules described in \l{ECMA-262} sect...
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)
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
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.
void translate(const QVector3D &vector)
Multiplies this matrix by another that translates coordinates by the components of vector.
\inmodule QtCore\reentrant
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 ¶ms)
void setNamedColorSpace(QQuickColorSpaceEnums::NamedColorSpace namedColorSpace)
QQuickColorSpaceEnums::NamedColorSpace namedColorSpace
void setGamma(float gamma)
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
void setHslLightness(qreal)
Q_INVOKABLE QQuickColorValueType(const QString &string)
Q_INVOKABLE QString toString() const
static QVariant create(const QJSValue ¶ms)
void setHslSaturation(qreal)
void setHsvSaturation(qreal)
Q_INVOKABLE QVariant darker(qreal factor=2.0) const
Q_INVOKABLE QVariant tint(QVariant factor) const
void setStrikeout(bool b)
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 setPixelSize(int size)
void setVariableAxes(const QVariantMap &variableAxes)
QQuickFontEnums::HintingPreference hintingPreference
void setPreferShaping(bool b)
void setPointSize(qreal size)
void setHintingPreference(QQuickFontEnums::HintingPreference)
Q_INVOKABLE QString toString() const
void setWordSpacing(qreal spacing)
void setUnderline(bool b)
static QVariant create(const QJSValue &value)
void setFamily(const QString &)
static QVariant create(const QJSValue ¶ms)
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 ¶ms)
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 ¶ms)
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 ¶ms)
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 ¶ms)
Q_INVOKABLE QVector4D normalized() const
Q_INVOKABLE QVector4D times(const QVector4D &vec) const
Q_INVOKABLE QVector4D minus(const QVector4D &vec) const
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
The QVector2D class represents a vector or vertex in 2D space.
float length() const noexcept
Returns the length of the vector from the origin.
QVector2D normalized() const noexcept
Returns the normalized unit vector form of this vector.
static constexpr float dotProduct(QVector2D v1, QVector2D v2) noexcept
Returns the dot product of v1 and v2.
The QVector3D class represents a vector or vertex in 3D space.
float length() const noexcept
Returns the length of the vector from the origin.
QVector3D normalized() const noexcept
Returns the normalized unit vector form of this vector.
static constexpr float dotProduct(QVector3D v1, QVector3D v2) noexcept
Returns the dot product of v1 and v2.
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.
The QVector4D class represents a vector or vertex in 4D space.
QVector4D normalized() const noexcept
Returns the normalized unit vector form of this vector.
float length() const noexcept
Returns the length of the vector from the origin.
static constexpr float dotProduct(QVector4D v1, QVector4D v2) noexcept
Returns the dot product of v1 and v2.
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
Q_GUI_EXPORT int qt_defaultDpi()
constexpr T qAbs(const T &t)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble q
GLfloat GLfloat GLfloat alpha
GLsizei const GLchar *const * string
[0]
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 ¶ms, bool *ok)
QLatin1StringView QLatin1String
#define QStringLiteral(str)