8#include <QtCore/qcheckedint_impl.h>
9#include <QtCore/qcompare.h>
10#include <QtCore/qnamespace.h>
11#include <QtCore/qnumeric.h>
13#include <QtCore/q20type_traits.h>
14#include <QtCore/q23utility.h>
16#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
22QT_ENABLE_P0846_SEMANTICS_FOR(get)
32 constexpr QPoint()
noexcept;
33 constexpr QPoint(
int xpos,
int ypos)
noexcept;
35 constexpr inline bool isNull()
const noexcept;
37 constexpr inline int x()
const noexcept;
38 constexpr inline int y()
const noexcept;
39 constexpr inline void setX(
int x)
noexcept;
40 constexpr inline void setY(
int y)
noexcept;
46 constexpr inline int &
rx()
noexcept;
47 constexpr inline int &
ry()
noexcept;
59 {
return int(p1.xp * p2.xp + p1.yp * p2.yp); }
63 {
return p1.xp == p2.xp && p1.yp == p2.yp; }
92#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
102 constexpr QPoint(Representation xpos, Representation ypos)
noexcept
112 friend constexpr decltype(
auto)
get(
P &&
p)
noexcept
114 if constexpr (
I == 0)
116 else if constexpr (
I == 1)
124
125
126#ifndef QT_NO_DATASTREAM
127Q_CORE_EXPORT
QDataStream &operator<<(QDataStream &,
const QPoint &);
132
133
141 return xp == 0 && yp == 0;
144constexpr inline int QPoint::
x()
const noexcept
149constexpr inline int QPoint::
y()
const noexcept
166 return (qAbs(xp) + qAbs(yp)).value();
171 return xp.as_underlying();
176 return yp.as_underlying();
195 xp.setValue(QtPrivate::qSaturateRound(x() * factor));
196 yp.setValue(QtPrivate::qSaturateRound(y() * factor));
202 xp.setValue(QtPrivate::qSaturateRound(x() * factor));
203 yp.setValue(QtPrivate::qSaturateRound(y() * factor));
216 Q_ASSERT(!qFuzzyIsNull(c));
217 xp.setValue(qRound(
int(xp) / c));
218 yp.setValue(qRound(
int(yp) / c));
222#ifndef QT_NO_DEBUG_STREAM
223Q_CORE_EXPORT
QDebug operator<<(QDebug,
const QPoint &);
226Q_CORE_EXPORT size_t qHash(QPoint key, size_t seed = 0)
noexcept;
236 constexpr QPointF(qreal xpos, qreal ypos)
noexcept;
240 inline bool isNull()
const noexcept;
242 constexpr inline qreal x()
const noexcept;
243 constexpr inline qreal y()
const noexcept;
244 constexpr inline void setX(qreal x)
noexcept;
245 constexpr inline void setY(qreal y)
noexcept;
249 constexpr inline qreal &
rx()
noexcept;
250 constexpr inline qreal &
ry()
noexcept;
259 return p1.xp * p2.xp + p1.yp * p2.yp;
265 return QtPrivate::fuzzyCompare(p1.xp, p2.xp)
266 && QtPrivate::fuzzyCompare(p1.yp, p2.yp);
270 return qFuzzyIsNull(point.xp) && qFuzzyIsNull(point.yp);
299#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
305 friend class QTransform;
314 friend constexpr decltype(
auto)
get(
P &&
p)
noexcept
316 if constexpr (
I == 0)
318 else if constexpr (
I == 1)
328
329
330#ifndef QT_NO_DATASTREAM
331Q_CORE_EXPORT
QDataStream &operator<<(QDataStream &,
const QPointF &);
336
337
347 return qAbs(x()) + qAbs(y());
352 return qIsNull(xp) && qIsNull(yp);
408 Q_ASSERT(divisor > 0 || divisor < 0);
418 return QPoint(QtPrivate::qSaturateRound(xp), QtPrivate::qSaturateRound(yp));
421#ifndef QT_NO_DEBUG_STREAM
422Q_CORE_EXPORT
QDebug operator<<(QDebug d,
const QPointF &p);
428
429
static bool readIniSection(const QSettingsKey §ion, QByteArrayView data, ParsedSettingsMap *settingsMap)
void set(const QString &key, const QVariant &value) override
QStringList children(const QString &prefix, ChildSpec spec) const override
~QConfFileSettingsPrivate()
virtual void initAccess()
bool readIniFile(QByteArrayView data, UnparsedSettingsMap *unparsedIniSections)
bool isWritable() const override
QString fileName() const override
QConfFileSettingsPrivate(QSettings::Format format, QSettings::Scope scope, const QString &organization, const QString &application)
void remove(const QString &key) override
QConfFileSettingsPrivate(const QString &fileName, QSettings::Format format)
const QList< QConfFile * > & getConfFiles() const
static bool readIniLine(QByteArrayView data, qsizetype &dataPos, qsizetype &lineStart, qsizetype &lineLen, qsizetype &equalsPos)
std::optional< QVariant > get(const QString &key) const override
UnparsedSettingsMap unparsedIniSections
ParsedSettingsMap originalKeys
static Q_AUTOTEST_EXPORT void clearCache()
ParsedSettingsMap removedKeys
ParsedSettingsMap mergedKeyMap() const
static QConfFile * fromName(const QString &name, bool _userPerms)
ParsedSettingsMap addedKeys
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr qreal & ry() noexcept
Returns a reference to the y coordinate of this point.
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal manhattanLength() const
friend constexpr bool comparesEqual(const QPointF &p1, const QPointF &p2) noexcept
friend constexpr bool qFuzzyIsNull(const QPointF &point) noexcept
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
constexpr QPointF & operator+=(const QPointF &p)
Adds the given point to this point and returns a reference to this point.
constexpr qreal & rx() noexcept
Returns a reference to the x coordinate of this point.
constexpr QPointF & operator*=(qreal c)
Multiplies this point's coordinates by the given finite factor, and returns a reference to this point...
constexpr QPointF transposed() const noexcept
constexpr void setY(qreal y) noexcept
Sets the y coordinate of this point to the given finite y coordinate.
constexpr QPointF & operator-=(const QPointF &p)
Subtracts the given point from this point and returns a reference to this point.
constexpr QPointF() noexcept
Constructs a null point, i.e.
constexpr QPointF(qreal xpos, qreal ypos) noexcept
Constructs a point with the given coordinates (xpos, ypos).
constexpr void setX(qreal x) noexcept
Sets the x coordinate of this point to the given finite x coordinate.
constexpr QPointF & operator/=(qreal c)
Divides both x and y by the given divisor, and returns a reference to this point.
constexpr QPointF(const QPoint &p) noexcept
Constructs a copy of the given point.
bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns fa...
static constexpr qreal dotProduct(const QPointF &p1, const QPointF &p2)
friend constexpr bool qFuzzyCompare(const QPointF &p1, const QPointF &p2) noexcept
\inmodule QtCore\reentrant
constexpr bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0, otherwise returns false.
constexpr QPoint & operator*=(double factor)
Multiplies this point's coordinates by the given factor, and returns a reference to this point.
constexpr int & ry() noexcept
Returns a reference to the y coordinate of this point.
constexpr int & rx() noexcept
Returns a reference to the x coordinate of this point.
constexpr QPoint transposed() const noexcept
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr void setY(int y) noexcept
Sets the y coordinate of this point to the given y coordinate.
constexpr QPoint & operator*=(int factor)
Multiplies this point's coordinates by the given factor, and returns a reference to this point.
constexpr QPoint & operator+=(const QPoint &p)
Adds the given point to this point and returns a reference to this point.
constexpr int manhattanLength() const
Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" ...
constexpr QPoint(int xpos, int ypos) noexcept
Constructs a point with the given coordinates (xpos, ypos).
constexpr int y() const noexcept
Returns the y coordinate of this point.
static constexpr int dotProduct(const QPoint &p1, const QPoint &p2)
constexpr void setX(int x) noexcept
Sets the x coordinate of this point to the given x coordinate.
constexpr QPoint & operator*=(float factor)
Multiplies this point's coordinates by the given factor, and returns a reference to this point.
constexpr QPoint & operator-=(const QPoint &p)
Subtracts the given point from this point and returns a reference to this point.
constexpr QPoint & operator/=(qreal divisor)
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr QPoint() noexcept
Constructs a null point, i.e.
friend constexpr bool comparesEqual(const QPoint &p1, const QPoint &p2) noexcept
QSettingsGroup(const QString &s, bool guessArraySize)
qsizetype arraySizeGuess() const
QSettingsGroup(const QString &s)
void setArrayIndex(qsizetype i)
QSettingsIniKey(const QString &str, qsizetype pos=-1)
QSettingsKey(const QString &key, Qt::CaseSensitivity cs, qsizetype=-1)
QString originalCaseKey() const
qsizetype originalKeyPosition() const
Combined button and popup list for selecting options.
QDataStream & readListBasedContainer(QDataStream &s, Container &c)
QDataStream & readAssociativeContainer(QDataStream &s, Container &c)
QDataStream & writeAssociativeContainer(QDataStream &s, const Container &c)
QDataStream & writeAssociativeMultiContainer(QDataStream &s, const Container &c)
QDataStream & writeSequentialContainer(QDataStream &s, const Container &c)
QDataStream & readArrayBasedContainer(QDataStream &s, Container &c)
static const char charTraits[256]
std::enable_if_t< std::is_enum< T >::value, QDataStream & > operator>>(QDataStream &s, T &t)
QDataStream & operator>>(QDataStream &s, QFlags< Enum > &e)
QDataStreamIfHasIStreamOperators< T1, T2 > operator>>(QDataStream &s, std::pair< T1, T2 > &p)
QDataStream & operator>>(QDataStream &s, QKeyCombination &combination)
QDataStreamIfHasIStreamOperatorsContainer< QHash< Key, T >, Key, T > operator>>(QDataStream &s, QHash< Key, T > &hash)
QDataStreamIfHasIStreamOperatorsContainer< QList< T >, T > operator>>(QDataStream &s, QList< T > &v)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
size_t qHash(QPointF, size_t seed=0)=delete
Q_DECLARE_TYPEINFO(QPointF, Q_PRIMITIVE_TYPE)
Q_DECLARE_TYPEINFO(QPoint, Q_PRIMITIVE_TYPE)
QMap< QString, QSettingsIniSection > IniMap
QList< QConfFileCustomFormat > CustomFormatVector
static bool operator<(const QSettingsIniKey &k1, const QSettingsIniKey &k2)
static constexpr QChar sep
static Path getPath(QSettings::Format format, QSettings::Scope scope)
QMap< QSettingsIniKey, QVariant > IniKeyMap
static int pathHashKey(QSettings::Format format, QSettings::Scope scope)
static QString make_user_path()
static std::unique_lock< QBasicMutex > initDefaultPaths(std::unique_lock< QBasicMutex > locker)
static QString make_user_path_without_qstandard_paths()
QHash< QString, QConfFile * > ConfFileHash
QHash< int, Path > PathHash
Q_DECLARE_TYPEINFO(QSettingsIniSection, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(QConfFileCustomFormat, Q_RELOCATABLE_TYPE)
Q_DECLARE_TYPEINFO(QSettingsIniKey, Q_RELOCATABLE_TYPE)
QCache< QString, QConfFile > ConfFileCache
#define FLUSH_CURRENT_SECTION()
static void iniChopTrailingSpaces(QString &str, qsizetype limit)
Q_DECLARE_TYPEINFO(QSettingsGroup, Q_RELOCATABLE_TYPE)
static const Qt::CaseSensitivity IniCaseSensitivity
Q_DECLARE_TYPEINFO(QSettingsKey, Q_RELOCATABLE_TYPE)
QMap< QSettingsKey, QByteArray > UnparsedSettingsMap
QMap< QSettingsKey, QVariant > ParsedSettingsMap
#define QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER