Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsize.h
Go to the documentation of this file.
1// Copyright (C) 2022 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// Qt-Security score:significant reason:default
4
5#ifndef QSIZE_H
6#define QSIZE_H
7
8#include <QtCore/qcheckedint_impl.h>
9#include <QtCore/qnamespace.h>
10#include <QtCore/qhashfunctions.h>
11#include <QtCore/qmargins.h>
12
13#include <QtCore/q20type_traits.h>
14#include <QtCore/q23utility.h>
15
16#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
17struct CGSize;
18#endif
19
21
22// QT_ENABLE_P0846_SEMANTICS_FOR(get) // from qmargins.h
23
24class QSizeF;
25
26class Q_CORE_EXPORT QSize
27{
28public:
29 constexpr QSize() noexcept;
30 constexpr QSize(int w, int h) noexcept;
31
32 constexpr inline bool isNull() const noexcept;
33 constexpr inline bool isEmpty() const noexcept;
34 constexpr inline bool isValid() const noexcept;
35
36 constexpr inline int width() const noexcept;
37 constexpr inline int height() const noexcept;
38 constexpr inline void setWidth(int w) noexcept;
39 constexpr inline void setHeight(int h) noexcept;
40 void transpose() noexcept;
41 [[nodiscard]] constexpr inline QSize transposed() const noexcept;
42
43 inline void scale(int w, int h, Qt::AspectRatioMode mode) noexcept;
44 inline void scale(const QSize &s, Qt::AspectRatioMode mode) noexcept;
45 [[nodiscard]] QSize scaled(int w, int h, Qt::AspectRatioMode mode) const noexcept;
46 [[nodiscard]] QSize scaled(const QSize &s, Qt::AspectRatioMode mode) const noexcept;
47
48 [[nodiscard]] constexpr inline QSize expandedTo(const QSize &) const noexcept;
49 [[nodiscard]] constexpr inline QSize boundedTo(const QSize &) const noexcept;
50
51 [[nodiscard]] constexpr QSize grownBy(QMargins m) const noexcept
52 { return {wd + m.left() + m.right(), ht + m.top() + m.bottom()}; }
53 [[nodiscard]] constexpr QSize shrunkBy(QMargins m) const noexcept
54 { return {wd - m.left() - m.right(), ht - m.top() - m.bottom()}; }
55
56 constexpr inline int &rwidth() noexcept;
57 constexpr inline int &rheight() noexcept;
58
59 constexpr inline QSize &operator+=(const QSize &) noexcept;
60 constexpr inline QSize &operator-=(const QSize &) noexcept;
61 constexpr inline QSize &operator*=(qreal c) noexcept;
62 inline QSize &operator/=(qreal c);
63
64private:
65 friend constexpr bool comparesEqual(const QSize &s1, const QSize &s2) noexcept
66 { return s1.wd == s2.wd && s1.ht == s2.ht; }
67 Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(QSize)
68 friend inline constexpr QSize operator+(const QSize &s1, const QSize &s2) noexcept
69 { return QSize(s1.wd + s2.wd, s1.ht + s2.ht); }
70 friend inline constexpr QSize operator-(const QSize &s1, const QSize &s2) noexcept
71 { return QSize(s1.wd - s2.wd, s1.ht - s2.ht); }
72 friend inline constexpr QSize operator*(const QSize &s, qreal c) noexcept
73 { return QSize(QtPrivate::qSaturateRound(s.width() * c), QtPrivate::qSaturateRound(s.height() * c)); }
74 friend inline constexpr QSize operator*(qreal c, const QSize &s) noexcept
75 { return s * c; }
76 friend inline QSize operator/(const QSize &s, qreal c)
77 {
78 Q_ASSERT(!qFuzzyIsNull(c));
79 return QSize(QtPrivate::qSaturateRound(s.width() / c), QtPrivate::qSaturateRound(s.height() / c));
80 }
81 friend inline constexpr size_t qHash(const QSize &, size_t) noexcept;
82
83public:
84#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
85 [[nodiscard]] CGSize toCGSize() const noexcept;
86#endif
87
88 [[nodiscard]] inline constexpr QSizeF toSizeF() const noexcept;
89
90private:
91 using Representation = QtPrivate::QCheckedIntegers::QCheckedInt<int>;
92
93 constexpr QSize(Representation w, Representation h) noexcept
94 : wd(w), ht(h)
95 {}
96
97 Representation wd;
98 Representation ht;
99
100 template <std::size_t I,
101 typename S,
102 std::enable_if_t<(I < 2), bool> = true,
103 std::enable_if_t<std::is_same_v<q20::remove_cvref_t<S>, QSize>, bool> = true>
104 friend constexpr decltype(auto) get(S &&s) noexcept
105 {
106 if constexpr (I == 0)
107 return q23::forward_like<S>(s.wd).as_underlying();
108 else if constexpr (I == 1)
109 return q23::forward_like<S>(s.ht).as_underlying();
110 }
111};
112Q_DECLARE_TYPEINFO(QSize, Q_RELOCATABLE_TYPE);
113
114/*****************************************************************************
115 QSize stream functions
116 *****************************************************************************/
117
118#ifndef QT_NO_DATASTREAM
119Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QSize &);
120Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSize &);
121#endif
122
123
124/*****************************************************************************
125 QSize inline functions
126 *****************************************************************************/
127
128constexpr inline QSize::QSize() noexcept : wd(-1), ht(-1) {}
129
130constexpr inline QSize::QSize(int w, int h) noexcept : wd(w), ht(h) {}
131
132constexpr inline bool QSize::isNull() const noexcept
133{ return wd == 0 && ht == 0; }
134
135constexpr inline bool QSize::isEmpty() const noexcept
136{ return wd < 1 || ht < 1; }
137
138constexpr inline bool QSize::isValid() const noexcept
139{ return wd >= 0 && ht >= 0; }
140
141constexpr inline int QSize::width() const noexcept
142{ return wd.value(); }
143
144constexpr inline int QSize::height() const noexcept
145{ return ht.value(); }
146
147constexpr inline void QSize::setWidth(int w) noexcept
148{ wd.setValue(w); }
149
150constexpr inline void QSize::setHeight(int h) noexcept
151{ ht.setValue(h); }
152
153constexpr inline QSize QSize::transposed() const noexcept
154{ return QSize(ht, wd); }
155
156inline void QSize::scale(int w, int h, Qt::AspectRatioMode mode) noexcept
157{ scale(QSize(w, h), mode); }
158
159inline void QSize::scale(const QSize &s, Qt::AspectRatioMode mode) noexcept
160{ *this = scaled(s, mode); }
161
162inline QSize QSize::scaled(int w, int h, Qt::AspectRatioMode mode) const noexcept
163{ return scaled(QSize(w, h), mode); }
164
165constexpr inline int &QSize::rwidth() noexcept
166{ return wd.as_underlying(); }
167
168constexpr inline int &QSize::rheight() noexcept
169{ return ht.as_underlying(); }
170
171constexpr inline QSize &QSize::operator+=(const QSize &s) noexcept
172{
173 wd += s.wd;
174 ht += s.ht;
175 return *this;
176}
177
178constexpr inline QSize &QSize::operator-=(const QSize &s) noexcept
179{
180 wd -= s.wd;
181 ht -= s.ht;
182 return *this;
183}
184
185constexpr inline QSize &QSize::operator*=(qreal c) noexcept
186{
187 wd.setValue(QtPrivate::qSaturateRound(width() * c));
188 ht.setValue(QtPrivate::qSaturateRound(height() * c));
189 return *this;
190}
191
192constexpr inline size_t qHash(const QSize &s, size_t seed = 0) noexcept
193{ return qHashMulti(seed, s.width(), s.height()); }
194
195inline QSize &QSize::operator/=(qreal c)
196{
197 Q_ASSERT(!qFuzzyIsNull(c));
198 wd.setValue(QtPrivate::qSaturateRound(width() / c));
199 ht.setValue(QtPrivate::qSaturateRound(height() / c));
200 return *this;
201}
202
203constexpr inline QSize QSize::expandedTo(const QSize & otherSize) const noexcept
204{
205 return QSize(qMax(wd,otherSize.wd), qMax(ht,otherSize.ht));
206}
207
208constexpr inline QSize QSize::boundedTo(const QSize & otherSize) const noexcept
209{
210 return QSize(qMin(wd,otherSize.wd), qMin(ht,otherSize.ht));
211}
212
213#ifndef QT_NO_DEBUG_STREAM
214Q_CORE_EXPORT QDebug operator<<(QDebug, const QSize &);
215#endif
216
217
218class Q_CORE_EXPORT QSizeF
219{
220public:
221 constexpr QSizeF() noexcept;
222 constexpr QSizeF(const QSize &sz) noexcept;
223 constexpr QSizeF(qreal w, qreal h) noexcept;
224
225 inline bool isNull() const noexcept;
226 constexpr inline bool isEmpty() const noexcept;
227 constexpr inline bool isValid() const noexcept;
228
229 constexpr inline qreal width() const noexcept;
230 constexpr inline qreal height() const noexcept;
231 constexpr inline void setWidth(qreal w) noexcept;
232 constexpr inline void setHeight(qreal h) noexcept;
233 void transpose() noexcept;
234 [[nodiscard]] constexpr inline QSizeF transposed() const noexcept;
235
236 inline void scale(qreal w, qreal h, Qt::AspectRatioMode mode) noexcept;
237 inline void scale(const QSizeF &s, Qt::AspectRatioMode mode) noexcept;
238 [[nodiscard]] QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const noexcept;
239 [[nodiscard]] QSizeF scaled(const QSizeF &s, Qt::AspectRatioMode mode) const noexcept;
240
241 [[nodiscard]] constexpr inline QSizeF expandedTo(const QSizeF &) const noexcept;
242 [[nodiscard]] constexpr inline QSizeF boundedTo(const QSizeF &) const noexcept;
243
244 [[nodiscard]] constexpr QSizeF grownBy(QMarginsF m) const noexcept
245 { return {width() + m.left() + m.right(), height() + m.top() + m.bottom()}; }
246 [[nodiscard]] constexpr QSizeF shrunkBy(QMarginsF m) const noexcept
247 { return {width() - m.left() - m.right(), height() - m.top() - m.bottom()}; }
248
249 constexpr inline qreal &rwidth() noexcept;
250 constexpr inline qreal &rheight() noexcept;
251
252 constexpr inline QSizeF &operator+=(const QSizeF &) noexcept;
253 constexpr inline QSizeF &operator-=(const QSizeF &) noexcept;
254 constexpr inline QSizeF &operator*=(qreal c) noexcept;
255 inline QSizeF &operator/=(qreal c);
256
257private:
258 friend constexpr bool qFuzzyCompare(const QSizeF &s1, const QSizeF &s2) noexcept
259 {
260 return QtPrivate::fuzzyCompare(s1.wd, s2.wd)
261 && QtPrivate::fuzzyCompare(s1.ht, s2.ht);
262 }
263 friend constexpr bool qFuzzyIsNull(const QSizeF &size) noexcept
264 { return qFuzzyIsNull(size.wd) && qFuzzyIsNull(size.ht); }
265 friend constexpr bool comparesEqual(const QSizeF &lhs, const QSizeF &rhs) noexcept
266 { return qFuzzyCompare(lhs, rhs); }
267 Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(QSizeF)
268 friend constexpr bool comparesEqual(const QSizeF &lhs, const QSize &rhs) noexcept
269 { return comparesEqual(lhs, rhs.toSizeF()); }
270 Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(QSizeF, QSize)
271 friend constexpr inline QSizeF operator+(const QSizeF &s1, const QSizeF &s2) noexcept
272 { return QSizeF(s1.wd + s2.wd, s1.ht + s2.ht); }
273 friend constexpr inline QSizeF operator-(const QSizeF &s1, const QSizeF &s2) noexcept
274 { return QSizeF(s1.wd - s2.wd, s1.ht - s2.ht); }
275 friend constexpr inline QSizeF operator*(const QSizeF &s, qreal c) noexcept
276 { return QSizeF(s.wd * c, s.ht * c); }
277 friend constexpr inline QSizeF operator*(qreal c, const QSizeF &s) noexcept
278 { return s * c; }
279 friend inline QSizeF operator/(const QSizeF &s, qreal c)
280 { Q_ASSERT(!qFuzzyIsNull(c)); return QSizeF(s.wd / c, s.ht / c); }
281
282public:
283 constexpr inline QSize toSize() const noexcept;
284
285#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
286 [[nodiscard]] static QSizeF fromCGSize(CGSize size) noexcept;
287 [[nodiscard]] CGSize toCGSize() const noexcept;
288#endif
289
290private:
291 qreal wd;
292 qreal ht;
293
294 template <std::size_t I,
295 typename S,
296 std::enable_if_t<(I < 2), bool> = true,
297 std::enable_if_t<std::is_same_v<q20::remove_cvref_t<S>, QSizeF>, bool> = true>
298 friend constexpr decltype(auto) get(S &&s) noexcept
299 {
300 if constexpr (I == 0)
301 return q23::forward_like<S>(s.wd);
302 else if constexpr (I == 1)
303 return q23::forward_like<S>(s.ht);
304 }
305};
307
308
309/*****************************************************************************
310 QSizeF stream functions
311 *****************************************************************************/
312
313#ifndef QT_NO_DATASTREAM
314Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QSizeF &);
315Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QSizeF &);
316#endif
317
318
319/*****************************************************************************
320 QSizeF inline functions
321 *****************************************************************************/
322
323constexpr inline QSizeF::QSizeF() noexcept : wd(-1.), ht(-1.) {}
324
325constexpr inline QSizeF::QSizeF(const QSize &sz) noexcept : wd(sz.width()), ht(sz.height()) {}
326
327constexpr inline QSizeF::QSizeF(qreal w, qreal h) noexcept : wd(w), ht(h) {}
328
329inline bool QSizeF::isNull() const noexcept
330{ return qIsNull(wd) && qIsNull(ht); }
331
332constexpr inline bool QSizeF::isEmpty() const noexcept
333{ return wd <= 0. || ht <= 0.; }
334
335constexpr inline bool QSizeF::isValid() const noexcept
336{ return wd >= 0. && ht >= 0.; }
337
338constexpr inline qreal QSizeF::width() const noexcept
339{ return wd; }
340
341constexpr inline qreal QSizeF::height() const noexcept
342{ return ht; }
343
344constexpr inline void QSizeF::setWidth(qreal w) noexcept
345{ wd = w; }
346
347constexpr inline void QSizeF::setHeight(qreal h) noexcept
348{ ht = h; }
349
350constexpr inline QSizeF QSizeF::transposed() const noexcept
351{ return QSizeF(ht, wd); }
352
353inline void QSizeF::scale(qreal w, qreal h, Qt::AspectRatioMode mode) noexcept
354{ scale(QSizeF(w, h), mode); }
355
356inline void QSizeF::scale(const QSizeF &s, Qt::AspectRatioMode mode) noexcept
357{ *this = scaled(s, mode); }
358
359inline QSizeF QSizeF::scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const noexcept
360{ return scaled(QSizeF(w, h), mode); }
361
362constexpr inline qreal &QSizeF::rwidth() noexcept
363{ return wd; }
364
365constexpr inline qreal &QSizeF::rheight() noexcept
366{ return ht; }
367
368constexpr inline QSizeF &QSizeF::operator+=(const QSizeF &s) noexcept
369{
370 wd += s.wd;
371 ht += s.ht;
372 return *this;
373}
374
375constexpr inline QSizeF &QSizeF::operator-=(const QSizeF &s) noexcept
376{
377 wd -= s.wd;
378 ht -= s.ht;
379 return *this;
380}
381
382constexpr inline QSizeF &QSizeF::operator*=(qreal c) noexcept
383{
384 wd *= c;
385 ht *= c;
386 return *this;
387}
388
389inline QSizeF &QSizeF::operator/=(qreal c)
390{
391 Q_ASSERT(!qFuzzyIsNull(c) && qIsFinite(c));
392 wd = wd / c;
393 ht = ht / c;
394 return *this;
395}
396
397constexpr inline QSizeF QSizeF::expandedTo(const QSizeF &otherSize) const noexcept
398{
399 return QSizeF(qMax(wd, otherSize.wd), qMax(ht, otherSize.ht));
400}
401
402constexpr inline QSizeF QSizeF::boundedTo(const QSizeF &otherSize) const noexcept
403{
404 return QSizeF(qMin(wd, otherSize.wd), qMin(ht, otherSize.ht));
405}
406
407constexpr inline QSize QSizeF::toSize() const noexcept
408{
409 return QSize(QtPrivate::qSaturateRound(wd), QtPrivate::qSaturateRound(ht));
410}
411
412constexpr QSizeF QSize::toSizeF() const noexcept { return *this; }
413
414#ifndef QT_NO_DEBUG_STREAM
415Q_CORE_EXPORT QDebug operator<<(QDebug, const QSizeF &);
416#endif
417
418QT_END_NAMESPACE
419
420/*****************************************************************************
421 QSize/QSizeF tuple protocol
422 *****************************************************************************/
423
424namespace std {
425 template <>
427 template <>
428 class tuple_element<0, QT_PREPEND_NAMESPACE(QSize)> { public: using type = int; };
429 template <>
430 class tuple_element<1, QT_PREPEND_NAMESPACE(QSize)> { public: using type = int; };
431
432 template <>
434 template <>
436 template <>
438}
439
440#endif // QSIZE_H
static bool readIniSection(const QSettingsKey &section, QByteArrayView data, ParsedSettingsMap *settingsMap)
void set(const QString &key, const QVariant &value) override
QStringList children(const QString &prefix, ChildSpec spec) const override
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
QString name
QAtomicInt ref
UnparsedSettingsMap unparsedIniSections
ParsedSettingsMap originalKeys
qint64 size
bool userPerms
static Q_AUTOTEST_EXPORT void clearCache()
QDateTime timeStamp
QMutex mutex
ParsedSettingsMap removedKeys
ParsedSettingsMap mergedKeyMap() const
static QConfFile * fromName(const QString &name, bool _userPerms)
bool isWritable() const
ParsedSettingsMap addedKeys
\inmodule QtCore\reentrant
Definition qdatastream.h:50
\inmodule QtCore
Definition qfile.h:69
\inmodule QtCore
Definition qlockfile.h:19
\inmodule QtCore\reentrant
Definition qpoint.h:232
constexpr qreal & ry() noexcept
Returns a reference to the y coordinate of this point.
Definition qpoint.h:380
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:355
constexpr qreal manhattanLength() const
Definition qpoint.h:345
friend constexpr bool comparesEqual(const QPointF &p1, const QPointF &p2) noexcept
Definition qpoint.h:272
friend constexpr bool qFuzzyIsNull(const QPointF &point) noexcept
Definition qpoint.h:268
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:360
constexpr QPointF & operator+=(const QPointF &p)
Adds the given point to this point and returns a reference to this point.
Definition qpoint.h:385
constexpr qreal & rx() noexcept
Returns a reference to the x coordinate of this point.
Definition qpoint.h:375
constexpr QPointF & operator*=(qreal c)
Multiplies this point's coordinates by the given finite factor, and returns a reference to this point...
Definition qpoint.h:399
constexpr QPointF transposed() const noexcept
Definition qpoint.h:247
constexpr void setY(qreal y) noexcept
Sets the y coordinate of this point to the given finite y coordinate.
Definition qpoint.h:370
constexpr QPointF & operator-=(const QPointF &p)
Subtracts the given point from this point and returns a reference to this point.
Definition qpoint.h:392
constexpr QPointF() noexcept
Constructs a null point, i.e.
Definition qpoint.h:339
constexpr QPointF(qreal xpos, qreal ypos) noexcept
Constructs a point with the given coordinates (xpos, ypos).
Definition qpoint.h:341
constexpr void setX(qreal x) noexcept
Sets the x coordinate of this point to the given finite x coordinate.
Definition qpoint.h:365
constexpr QPointF & operator/=(qreal c)
Divides both x and y by the given divisor, and returns a reference to this point.
Definition qpoint.h:406
constexpr QPointF(const QPoint &p) noexcept
Constructs a copy of the given point.
Definition qpoint.h:343
bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns fa...
Definition qpoint.h:350
static constexpr qreal dotProduct(const QPointF &p1, const QPointF &p2)
Definition qpoint.h:257
friend constexpr bool qFuzzyCompare(const QPointF &p1, const QPointF &p2) noexcept
Definition qpoint.h:263
\inmodule QtCore\reentrant
Definition qpoint.h:30
constexpr bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0, otherwise returns false.
Definition qpoint.h:139
constexpr QPoint & operator*=(double factor)
Multiplies this point's coordinates by the given factor, and returns a reference to this point.
Definition qpoint.h:200
constexpr int & ry() noexcept
Returns a reference to the y coordinate of this point.
Definition qpoint.h:174
constexpr int & rx() noexcept
Returns a reference to the x coordinate of this point.
Definition qpoint.h:169
constexpr QPoint transposed() const noexcept
Definition qpoint.h:44
constexpr int x() const noexcept
Returns the x coordinate of this point.
Definition qpoint.h:144
constexpr void setY(int y) noexcept
Sets the y coordinate of this point to the given y coordinate.
Definition qpoint.h:159
constexpr QPoint & operator*=(int factor)
Multiplies this point's coordinates by the given factor, and returns a reference to this point.
Definition qpoint.h:207
constexpr QPoint & operator+=(const QPoint &p)
Adds the given point to this point and returns a reference to this point.
Definition qpoint.h:179
constexpr int manhattanLength() const
Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" ...
Definition qpoint.h:164
constexpr QPoint(int xpos, int ypos) noexcept
Constructs a point with the given coordinates (xpos, ypos).
Definition qpoint.h:137
constexpr int y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:149
static constexpr int dotProduct(const QPoint &p1, const QPoint &p2)
Definition qpoint.h:58
constexpr void setX(int x) noexcept
Sets the x coordinate of this point to the given x coordinate.
Definition qpoint.h:154
constexpr QPoint & operator*=(float factor)
Multiplies this point's coordinates by the given factor, and returns a reference to this point.
Definition qpoint.h:193
constexpr QPoint & operator-=(const QPoint &p)
Subtracts the given point from this point and returns a reference to this point.
Definition qpoint.h:186
constexpr QPoint & operator/=(qreal divisor)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qpoint.h:214
constexpr QPoint() noexcept
Constructs a null point, i.e.
Definition qpoint.h:135
friend constexpr bool comparesEqual(const QPoint &p1, const QPoint &p2) noexcept
Definition qpoint.h:62
\inmodule QtCore\reentrant
Definition qrect.h:510
\inmodule QtCore\reentrant
Definition qrect.h:32
QSettingsGroup(const QString &s, bool guessArraySize)
Definition qsettings_p.h:88
qsizetype num
Definition qsettings_p.h:99
QString toString() const
QString name() const
Definition qsettings_p.h:91
bool isArray() const
Definition qsettings_p.h:93
qsizetype arraySizeGuess() const
Definition qsettings_p.h:94
qsizetype maxNum
QSettingsGroup(const QString &s)
Definition qsettings_p.h:86
void setArrayIndex(qsizetype i)
Definition qsettings_p.h:95
qsizetype position
QSettingsIniKey(const QString &str, qsizetype pos=-1)
QSettingsKey(const QString &key, Qt::CaseSensitivity cs, qsizetype=-1)
Definition qsettings_p.h:48
QString originalCaseKey() const
Definition qsettings_p.h:51
qsizetype originalKeyPosition() const
Definition qsettings_p.h:52
\inmodule QtCore
Definition qsettings.h:31
\inmodule QtCore
Definition qsize.h:219
\inmodule QtCore
Definition qsize.h:27
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]
Q_DECLARE_TYPEINFO(QByteArrayView, Q_PRIMITIVE_TYPE)
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)
Definition qdir.cpp:2582
size_t qHash(QPointF, size_t seed=0)=delete
Q_DECLARE_TYPEINFO(QPointF, Q_PRIMITIVE_TYPE)
Q_DECLARE_TYPEINFO(QPoint, Q_PRIMITIVE_TYPE)
constexpr QRectF operator+(const QRectF &lhs, const QMarginsF &rhs) noexcept
Definition qrect.h:900
constexpr QRect operator+(const QMargins &margins, const QRect &rectangle) noexcept
Definition qrect.h:462
Q_DECLARE_TYPEINFO(QRect, Q_RELOCATABLE_TYPE)
constexpr QRectF operator+(const QMarginsF &lhs, const QRectF &rhs) noexcept
Definition qrect.h:906
Q_DECLARE_TYPEINFO(QRectF, Q_RELOCATABLE_TYPE)
constexpr QRectF operator-(const QRectF &lhs, const QMarginsF &rhs) noexcept
Definition qrect.h:912
constexpr QRect operator+(const QRect &rectangle, const QMargins &margins) noexcept
Definition qrect.h:456
constexpr size_t qHash(const QRect &r, size_t seed=0) noexcept
Definition qrect.h:451
constexpr QRect operator-(const QRect &lhs, const QMargins &rhs) noexcept
Definition qrect.h:468
QMap< QString, QSettingsIniSection > IniMap
QList< QConfFileCustomFormat > CustomFormatVector
Definition qsettings.cpp:89
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
Definition qsettings.cpp:75
QHash< int, Path > PathHash
Definition qsettings.cpp:88
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
Definition qsettings.cpp:76
#define FLUSH_CURRENT_SECTION()
static void iniChopTrailingSpaces(QString &str, qsizetype limit)
Q_DECLARE_TYPEINFO(QSettingsGroup, Q_RELOCATABLE_TYPE)
static const Qt::CaseSensitivity IniCaseSensitivity
Definition qsettings_p.h:43
Q_DECLARE_TYPEINFO(QSettingsKey, Q_RELOCATABLE_TYPE)
QMap< QSettingsKey, QByteArray > UnparsedSettingsMap
Definition qsettings_p.h:78
QMap< QSettingsKey, QVariant > ParsedSettingsMap
Definition qsettings_p.h:79
#define QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER
Definition qsettings_p.h:36
Q_DECLARE_TYPEINFO(QSizeF, Q_RELOCATABLE_TYPE)
constexpr size_t qHash(const QSize &s, size_t seed=0) noexcept
Definition qsize.h:192
QSettings settings("MyCompany", "MyApp")
[11]
Qt::CaseSensitivity caseSensitivity
Definition qsettings.cpp:71