7#include <QtCore/qcheckedint_impl.h>
8#include <QtCore/qcompare.h>
9#include <QtCore/qnamespace.h>
10#include <QtCore/qnumeric.h>
12#include <QtCore/q20type_traits.h>
13#include <QtCore/q23utility.h>
15#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
21QT_ENABLE_P0846_SEMANTICS_FOR(get)
31 constexpr QPoint()
noexcept;
32 constexpr QPoint(
int xpos,
int ypos)
noexcept;
34 constexpr inline bool isNull()
const noexcept;
36 constexpr inline int x()
const noexcept;
37 constexpr inline int y()
const noexcept;
38 constexpr inline void setX(
int x)
noexcept;
39 constexpr inline void setY(
int y)
noexcept;
45 constexpr inline int &
rx()
noexcept;
46 constexpr inline int &
ry()
noexcept;
58 {
return int(p1.xp * p2.xp + p1.yp * p2.yp); }
62 {
return p1.xp == p2.xp && p1.yp == p2.yp; }
91#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
101 constexpr QPoint(Representation xpos, Representation ypos)
noexcept
111 friend constexpr decltype(
auto)
get(
P &&
p)
noexcept
113 if constexpr (
I == 0)
115 else if constexpr (
I == 1)
123
124
125#ifndef QT_NO_DATASTREAM
126Q_CORE_EXPORT
QDataStream &operator<<(QDataStream &,
const QPoint &);
131
132
140 return xp == 0 && yp == 0;
143constexpr inline int QPoint::
x()
const noexcept
148constexpr inline int QPoint::
y()
const noexcept
165 return (qAbs(xp) + qAbs(yp)).value();
170 return xp.as_underlying();
175 return yp.as_underlying();
194 xp.setValue(QtPrivate::qSaturateRound(x() * factor));
195 yp.setValue(QtPrivate::qSaturateRound(y() * factor));
201 xp.setValue(QtPrivate::qSaturateRound(x() * factor));
202 yp.setValue(QtPrivate::qSaturateRound(y() * factor));
215 Q_ASSERT(!qFuzzyIsNull(c));
216 xp.setValue(qRound(
int(xp) / c));
217 yp.setValue(qRound(
int(yp) / c));
221#ifndef QT_NO_DEBUG_STREAM
222Q_CORE_EXPORT
QDebug operator<<(QDebug,
const QPoint &);
225Q_CORE_EXPORT size_t qHash(QPoint key, size_t seed = 0)
noexcept;
235 constexpr QPointF(qreal xpos, qreal ypos)
noexcept;
239 inline bool isNull()
const noexcept;
241 constexpr inline qreal x()
const noexcept;
242 constexpr inline qreal y()
const noexcept;
243 constexpr inline void setX(qreal x)
noexcept;
244 constexpr inline void setY(qreal y)
noexcept;
248 constexpr inline qreal &
rx()
noexcept;
249 constexpr inline qreal &
ry()
noexcept;
258 return p1.xp * p2.xp + p1.yp * p2.yp;
263 QT_WARNING_DISABLE_FLOAT_COMPARE
301#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
307 friend class QTransform;
316 friend constexpr decltype(
auto)
get(
P &&
p)
noexcept
318 if constexpr (
I == 0)
320 else if constexpr (
I == 1)
330
331
332#ifndef QT_NO_DATASTREAM
333Q_CORE_EXPORT
QDataStream &operator<<(QDataStream &,
const QPointF &);
338
339
349 return qAbs(x()) + qAbs(y());
354 return qIsNull(xp) && qIsNull(yp);
410 Q_ASSERT(divisor > 0 || divisor < 0);
420 return QPoint(QtPrivate::qSaturateRound(xp), QtPrivate::qSaturateRound(yp));
423#ifndef QT_NO_DEBUG_STREAM
424Q_CORE_EXPORT
QDebug operator<<(QDebug d,
const QPointF &p);
430
431
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
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)
\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
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