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
qrect.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 QRECT_H
6#define QRECT_H
7
8#include <QtCore/qcheckedint_impl.h>
9#include <QtCore/qhashfunctions.h>
10#include <QtCore/qmargins.h>
11#include <QtCore/qsize.h>
12#include <QtCore/qpoint.h>
13
14#ifdef topLeft
15#error qrect.h must be included before any header file that defines topLeft
16#endif
17
18#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
19struct CGRect;
20#endif
21#if defined(Q_OS_WASM) || defined(Q_QDOC)
22namespace emscripten {
23class val;
24}
25#endif
26
27QT_BEGIN_NAMESPACE
28
29class QRectF;
30
31class Q_CORE_EXPORT QRect
32{
33public:
34 constexpr QRect() noexcept : x1(0), y1(0), x2(-1), y2(-1) {}
35 constexpr QRect(const QPoint &topleft, const QPoint &bottomright) noexcept;
36 constexpr QRect(const QPoint &topleft, const QSize &size) noexcept;
37 constexpr QRect(int left, int top, int width, int height) noexcept;
38
39 constexpr inline bool isNull() const noexcept;
40 constexpr inline bool isEmpty() const noexcept;
41 constexpr inline bool isValid() const noexcept;
42
43 constexpr inline int left() const noexcept;
44 constexpr inline int top() const noexcept;
45 constexpr inline int right() const noexcept;
46 constexpr inline int bottom() const noexcept;
47 [[nodiscard]] QRect normalized() const noexcept;
48
49 constexpr inline int x() const noexcept;
50 constexpr inline int y() const noexcept;
51 constexpr inline void setLeft(int pos) noexcept;
52 constexpr inline void setTop(int pos) noexcept;
53 constexpr inline void setRight(int pos) noexcept;
54 constexpr inline void setBottom(int pos) noexcept;
55 constexpr inline void setX(int x) noexcept;
56 constexpr inline void setY(int y) noexcept;
57
58 constexpr inline void setTopLeft(const QPoint &p) noexcept;
59 constexpr inline void setBottomRight(const QPoint &p) noexcept;
60 constexpr inline void setTopRight(const QPoint &p) noexcept;
61 constexpr inline void setBottomLeft(const QPoint &p) noexcept;
62
63 constexpr inline QPoint topLeft() const noexcept;
64 constexpr inline QPoint bottomRight() const noexcept;
65 constexpr inline QPoint topRight() const noexcept;
66 constexpr inline QPoint bottomLeft() const noexcept;
67 constexpr inline QPoint center() const noexcept;
68
69 constexpr inline void moveLeft(int pos) noexcept;
70 constexpr inline void moveTop(int pos) noexcept;
71 constexpr inline void moveRight(int pos) noexcept;
72 constexpr inline void moveBottom(int pos) noexcept;
73 constexpr inline void moveTopLeft(const QPoint &p) noexcept;
74 constexpr inline void moveBottomRight(const QPoint &p) noexcept;
75 constexpr inline void moveTopRight(const QPoint &p) noexcept;
76 constexpr inline void moveBottomLeft(const QPoint &p) noexcept;
77 constexpr inline void moveCenter(const QPoint &p) noexcept;
78
79 constexpr inline void translate(int dx, int dy) noexcept;
80 constexpr inline void translate(const QPoint &p) noexcept;
81 [[nodiscard]] constexpr inline QRect translated(int dx, int dy) const noexcept;
82 [[nodiscard]] constexpr inline QRect translated(const QPoint &p) const noexcept;
83 [[nodiscard]] constexpr inline QRect transposed() const noexcept;
84
85 constexpr inline void moveTo(int x, int t) noexcept;
86 constexpr inline void moveTo(const QPoint &p) noexcept;
87
88 constexpr inline void setRect(int x, int y, int w, int h) noexcept;
89 constexpr inline void getRect(int *x, int *y, int *w, int *h) const;
90
91 constexpr inline void setCoords(int x1, int y1, int x2, int y2) noexcept;
92 constexpr inline void getCoords(int *x1, int *y1, int *x2, int *y2) const;
93
94 constexpr inline void adjust(int x1, int y1, int x2, int y2) noexcept;
95 [[nodiscard]] constexpr inline QRect adjusted(int x1, int y1, int x2, int y2) const noexcept;
96
97 constexpr inline QSize size() const noexcept;
98 constexpr inline int width() const noexcept;
99 constexpr inline int height() const noexcept;
100 constexpr inline void setWidth(int w) noexcept;
101 constexpr inline void setHeight(int h) noexcept;
102 constexpr inline void setSize(const QSize &s) noexcept;
103
104 QRect operator|(const QRect &r) const noexcept;
105 QRect operator&(const QRect &r) const noexcept;
106 inline QRect &operator|=(const QRect &r) noexcept;
107 inline QRect &operator&=(const QRect &r) noexcept;
108
109 bool contains(const QRect &r, bool proper = false) const noexcept;
110 bool contains(const QPoint &p, bool proper = false) const noexcept;
111 inline bool contains(int x, int y) const noexcept;
112 inline bool contains(int x, int y, bool proper) const noexcept;
113 [[nodiscard]] inline QRect united(const QRect &other) const noexcept;
114 [[nodiscard]] inline QRect intersected(const QRect &other) const noexcept;
115 bool intersects(const QRect &r) const noexcept;
116
117 constexpr inline QRect marginsAdded(const QMargins &margins) const noexcept;
118 constexpr inline QRect marginsRemoved(const QMargins &margins) const noexcept;
119 constexpr inline QRect &operator+=(const QMargins &margins) noexcept;
120 constexpr inline QRect &operator-=(const QMargins &margins) noexcept;
121
122 [[nodiscard]] static constexpr inline QRect span(const QPoint &p1, const QPoint &p2) noexcept;
123
124private:
125 friend constexpr bool comparesEqual(const QRect &r1, const QRect &r2) noexcept
126 { return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2; }
127 Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(QRect)
128 friend constexpr inline size_t qHash(const QRect &, size_t) noexcept;
129
130public:
131#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
132 [[nodiscard]] CGRect toCGRect() const noexcept;
133#endif
134 [[nodiscard]] constexpr inline QRectF toRectF() const noexcept;
135
136private:
137 using Representation = QtPrivate::QCheckedIntegers::QCheckedInt<int>;
138
139 constexpr QRect(Representation aleft,
140 Representation atop,
141 Representation awidth,
142 Representation aheight) noexcept
143 : x1(aleft), y1(atop),
144 x2(aleft + awidth - 1), y2(atop + aheight - 1)
145 {}
146
147 Representation x1;
148 Representation y1;
149 Representation x2;
150 Representation y2;
151};
153
154
155/*****************************************************************************
156 QRect stream functions
157 *****************************************************************************/
158#ifndef QT_NO_DATASTREAM
159Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QRect &);
160Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QRect &);
161#endif
162
163/*****************************************************************************
164 QRect inline member functions
165 *****************************************************************************/
166
167constexpr inline QRect::QRect(int aleft, int atop, int awidth, int aheight) noexcept
168 : QRect(Representation(aleft), Representation(atop), Representation(awidth), Representation(aheight)) {}
169
170constexpr inline QRect::QRect(const QPoint &atopLeft, const QPoint &abottomRight) noexcept
171 : x1(atopLeft.x()), y1(atopLeft.y()), x2(abottomRight.x()), y2(abottomRight.y()) {}
172
173constexpr inline QRect::QRect(const QPoint &atopLeft, const QSize &asize) noexcept
174 : x1(atopLeft.x()), y1(atopLeft.y()), x2(x1 + asize.width() - 1), y2(y1 + asize.height() - 1) {}
175
176constexpr inline bool QRect::isNull() const noexcept
177{
178 // This strange behavior is here for backwards compatibility -- a
179 // rectangle spanning from INT_MIN to INT_MAX is considered null.
180 constexpr Representation minInt((std::numeric_limits<int>::min)());
181 constexpr Representation maxInt((std::numeric_limits<int>::max)());
182 const auto adjustedX1 = Q_UNLIKELY(x1 == minInt) ? maxInt : x1 - 1;
183 const auto adjustedY1 = Q_UNLIKELY(y1 == minInt) ? maxInt : y1 - 1;
184 return x2 == adjustedX1 && y2 == adjustedY1;
185}
186
187constexpr inline bool QRect::isEmpty() const noexcept
188{ return x1 > x2 || y1 > y2; }
189
190constexpr inline bool QRect::isValid() const noexcept
191{ return x1 <= x2 && y1 <= y2; }
192
193constexpr inline int QRect::left() const noexcept
194{ return x1.value(); }
195
196constexpr inline int QRect::top() const noexcept
197{ return y1.value(); }
198
199constexpr inline int QRect::right() const noexcept
200{ return x2.value(); }
201
202constexpr inline int QRect::bottom() const noexcept
203{ return y2.value(); }
204
205constexpr inline int QRect::x() const noexcept
206{ return x1.value(); }
207
208constexpr inline int QRect::y() const noexcept
209{ return y1.value(); }
210
211constexpr inline void QRect::setLeft(int pos) noexcept
212{ x1.setValue(pos); }
213
214constexpr inline void QRect::setTop(int pos) noexcept
215{ y1.setValue(pos); }
216
217constexpr inline void QRect::setRight(int pos) noexcept
218{ x2.setValue(pos); }
219
220constexpr inline void QRect::setBottom(int pos) noexcept
221{ y2.setValue(pos); }
222
223constexpr inline void QRect::setTopLeft(const QPoint &p) noexcept
224{ x1.setValue(p.x()); y1.setValue(p.y()); }
225
226constexpr inline void QRect::setBottomRight(const QPoint &p) noexcept
227{ x2.setValue(p.x()); y2.setValue(p.y()); }
228
229constexpr inline void QRect::setTopRight(const QPoint &p) noexcept
230{ x2.setValue(p.x()); y1.setValue(p.y()); }
231
232constexpr inline void QRect::setBottomLeft(const QPoint &p) noexcept
233{ x1.setValue(p.x()); y2.setValue(p.y()); }
234
235constexpr inline void QRect::setX(int ax) noexcept
236{ x1.setValue(ax); }
237
238constexpr inline void QRect::setY(int ay) noexcept
239{ y1.setValue(ay); }
240
241constexpr inline QPoint QRect::topLeft() const noexcept
242{ return QPoint(x1, y1); }
243
244constexpr inline QPoint QRect::bottomRight() const noexcept
245{ return QPoint(x2, y2); }
246
247constexpr inline QPoint QRect::topRight() const noexcept
248{ return QPoint(x2, y1); }
249
250constexpr inline QPoint QRect::bottomLeft() const noexcept
251{ return QPoint(x1, y2); }
252
253constexpr inline QPoint QRect::center() const noexcept
254{
255 // cast avoids overflow on addition
256 return QPoint(int((qint64(x1.value()) + x2.value()) / 2),
257 int((qint64(y1.value()) + y2.value()) / 2));
258}
259
260constexpr inline int QRect::width() const noexcept
261{ return (x2 - x1 + 1).value(); }
262
263constexpr inline int QRect::height() const noexcept
264{ return (y2 - y1 + 1).value(); }
265
266constexpr inline QSize QRect::size() const noexcept
267{ return QSize(width(), height()); }
268
269constexpr inline void QRect::translate(int dx, int dy) noexcept
270{
271 x1 += dx;
272 y1 += dy;
273 x2 += dx;
274 y2 += dy;
275}
276
277constexpr inline void QRect::translate(const QPoint &p) noexcept
278{
279 x1 += p.x();
280 y1 += p.y();
281 x2 += p.x();
282 y2 += p.y();
283}
284
285constexpr inline QRect QRect::translated(int dx, int dy) const noexcept
286{ return QRect(QPoint(x1 + dx, y1 + dy), QPoint(x2 + dx, y2 + dy)); }
287
288constexpr inline QRect QRect::translated(const QPoint &p) const noexcept
289{ return QRect(QPoint(x1 + p.x(), y1 + p.y()), QPoint(x2 + p.x(), y2 + p.y())); }
290
291constexpr inline QRect QRect::transposed() const noexcept
292{ return QRect(topLeft(), size().transposed()); }
293
294constexpr inline void QRect::moveTo(int ax, int ay) noexcept
295{
296 Representation rax(ax);
297 Representation ray(ay);
298 x2 += rax - x1;
299 y2 += ray - y1;
300 x1 = rax;
301 y1 = ray;
302}
303
304constexpr inline void QRect::moveTo(const QPoint &p) noexcept
305{
306 x2 += Representation(p.x()) - x1;
307 y2 += Representation(p.y()) - y1;
308 x1 = Representation(p.x());
309 y1 = Representation(p.y());
310}
311
312constexpr inline void QRect::moveLeft(int pos) noexcept
313{ x2 += (pos - x1); x1.setValue(pos); }
314
315constexpr inline void QRect::moveTop(int pos) noexcept
316{ y2 += (pos - y1); y1.setValue(pos); }
317
318constexpr inline void QRect::moveRight(int pos) noexcept
319{
320 x1 += (pos - x2);
321 x2.setValue(pos);
322}
323
324constexpr inline void QRect::moveBottom(int pos) noexcept
325{
326 y1 += (pos - y2);
327 y2.setValue(pos);
328}
329
330constexpr inline void QRect::moveTopLeft(const QPoint &p) noexcept
331{
332 moveLeft(p.x());
333 moveTop(p.y());
334}
335
336constexpr inline void QRect::moveBottomRight(const QPoint &p) noexcept
337{
338 moveRight(p.x());
339 moveBottom(p.y());
340}
341
342constexpr inline void QRect::moveTopRight(const QPoint &p) noexcept
343{
344 moveRight(p.x());
345 moveTop(p.y());
346}
347
348constexpr inline void QRect::moveBottomLeft(const QPoint &p) noexcept
349{
350 moveLeft(p.x());
351 moveBottom(p.y());
352}
353
354constexpr inline void QRect::moveCenter(const QPoint &p) noexcept
355{
356 auto w = x2 - x1;
357 auto h = y2 - y1;
358 x1 = p.x() - w/2;
359 y1 = p.y() - h/2;
360 x2 = x1 + w;
361 y2 = y1 + h;
362}
363
364constexpr inline void QRect::getRect(int *ax, int *ay, int *aw, int *ah) const
365{
366 *ax = x1.value();
367 *ay = y1.value();
368 *aw = (x2 - x1 + 1).value();
369 *ah = (y2 - y1 + 1).value();
370}
371
372constexpr inline void QRect::setRect(int ax, int ay, int aw, int ah) noexcept
373{
374 x1.setValue(ax);
375 y1.setValue(ay);
376 x2 = (x1 + aw - 1);
377 y2 = (y1 + ah - 1);
378}
379
380constexpr inline void QRect::getCoords(int *xp1, int *yp1, int *xp2, int *yp2) const
381{
382 *xp1 = x1.value();
383 *yp1 = y1.value();
384 *xp2 = x2.value();
385 *yp2 = y2.value();
386}
387
388constexpr inline void QRect::setCoords(int xp1, int yp1, int xp2, int yp2) noexcept
389{
390 x1.setValue(xp1);
391 y1.setValue(yp1);
392 x2.setValue(xp2);
393 y2.setValue(yp2);
394}
395
396constexpr inline QRect QRect::adjusted(int xp1, int yp1, int xp2, int yp2) const noexcept
397{ return QRect(QPoint(x1 + xp1, y1 + yp1), QPoint(x2 + xp2, y2 + yp2)); }
398
399constexpr inline void QRect::adjust(int dx1, int dy1, int dx2, int dy2) noexcept
400{
401 x1 += dx1;
402 y1 += dy1;
403 x2 += dx2;
404 y2 += dy2;
405}
406
407constexpr inline void QRect::setWidth(int w) noexcept
408{ x2 = (x1 + w - 1); }
409
410constexpr inline void QRect::setHeight(int h) noexcept
411{ y2 = (y1 + h - 1); }
412
413constexpr inline void QRect::setSize(const QSize &s) noexcept
414{
415 x2 = (s.width() + x1 - 1);
416 y2 = (s.height() + y1 - 1);
417}
418
419inline bool QRect::contains(int ax, int ay, bool aproper) const noexcept
420{
421 return contains(QPoint(ax, ay), aproper);
422}
423
424inline bool QRect::contains(int ax, int ay) const noexcept
425{
426 return contains(QPoint(ax, ay), false);
427}
428
429inline QRect &QRect::operator|=(const QRect &r) noexcept
430{
431 *this = *this | r;
432 return *this;
433}
434
435inline QRect &QRect::operator&=(const QRect &r) noexcept
436{
437 *this = *this & r;
438 return *this;
439}
440
441inline QRect QRect::intersected(const QRect &other) const noexcept
442{
443 return *this & other;
444}
445
446inline QRect QRect::united(const QRect &r) const noexcept
447{
448 return *this | r;
449}
450
451constexpr inline size_t qHash(const QRect &r, size_t seed = 0) noexcept
452{
453 return qHashMulti(seed, r.x1, r.x2, r.y1, r.y2);
454}
455
456constexpr inline QRect operator+(const QRect &rectangle, const QMargins &margins) noexcept
457{
458 return QRect(QPoint(rectangle.left() - margins.left(), rectangle.top() - margins.top()),
459 QPoint(rectangle.right() + margins.right(), rectangle.bottom() + margins.bottom()));
460}
461
462constexpr inline QRect operator+(const QMargins &margins, const QRect &rectangle) noexcept
463{
464 return QRect(QPoint(rectangle.left() - margins.left(), rectangle.top() - margins.top()),
465 QPoint(rectangle.right() + margins.right(), rectangle.bottom() + margins.bottom()));
466}
467
468constexpr inline QRect operator-(const QRect &lhs, const QMargins &rhs) noexcept
469{
470 return QRect(QPoint(lhs.left() + rhs.left(), lhs.top() + rhs.top()),
471 QPoint(lhs.right() - rhs.right(), lhs.bottom() - rhs.bottom()));
472}
473
474constexpr inline QRect QRect::marginsAdded(const QMargins &margins) const noexcept
475{
476 return QRect(QPoint(x1 - margins.left(), y1 - margins.top()),
477 QPoint(x2 + margins.right(), y2 + margins.bottom()));
478}
479
480constexpr inline QRect QRect::marginsRemoved(const QMargins &margins) const noexcept
481{
482 return QRect(QPoint(x1 + margins.left(), y1 + margins.top()),
483 QPoint(x2 - margins.right(), y2 - margins.bottom()));
484}
485
486constexpr inline QRect &QRect::operator+=(const QMargins &margins) noexcept
487{
488 *this = marginsAdded(margins);
489 return *this;
490}
491
492constexpr inline QRect &QRect::operator-=(const QMargins &margins) noexcept
493{
494 *this = marginsRemoved(margins);
495 return *this;
496}
497
498constexpr QRect QRect::span(const QPoint &p1, const QPoint &p2) noexcept
499{
500 return QRect(QPoint(qMin(p1.x(), p2.x()), qMin(p1.y(), p2.y())),
501 QPoint(qMax(p1.x(), p2.x()), qMax(p1.y(), p2.y())));
502}
503
504#ifndef QT_NO_DEBUG_STREAM
505Q_CORE_EXPORT QDebug operator<<(QDebug, const QRect &);
506#endif
507
508
509class Q_CORE_EXPORT QRectF
510{
511public:
512 constexpr QRectF() noexcept : xp(0.), yp(0.), w(0.), h(0.) {}
513 constexpr QRectF(const QPointF &topleft, const QSizeF &size) noexcept;
514 constexpr QRectF(const QPointF &topleft, const QPointF &bottomRight) noexcept;
515 constexpr QRectF(qreal left, qreal top, qreal width, qreal height) noexcept;
516 constexpr QRectF(const QRect &rect) noexcept;
517
518 constexpr inline bool isNull() const noexcept;
519 constexpr inline bool isEmpty() const noexcept;
520 constexpr inline bool isValid() const noexcept;
521 [[nodiscard]] QRectF normalized() const noexcept;
522
523 constexpr inline qreal left() const noexcept { return xp; }
524 constexpr inline qreal top() const noexcept { return yp; }
525 constexpr inline qreal right() const noexcept { return xp + w; }
526 constexpr inline qreal bottom() const noexcept { return yp + h; }
527
528 constexpr inline qreal x() const noexcept;
529 constexpr inline qreal y() const noexcept;
530 constexpr inline void setLeft(qreal pos) noexcept;
531 constexpr inline void setTop(qreal pos) noexcept;
532 constexpr inline void setRight(qreal pos) noexcept;
533 constexpr inline void setBottom(qreal pos) noexcept;
534 constexpr inline void setX(qreal pos) noexcept { setLeft(pos); }
535 constexpr inline void setY(qreal pos) noexcept { setTop(pos); }
536
537 constexpr inline QPointF topLeft() const noexcept { return QPointF(xp, yp); }
538 constexpr inline QPointF bottomRight() const noexcept { return QPointF(xp+w, yp+h); }
539 constexpr inline QPointF topRight() const noexcept { return QPointF(xp+w, yp); }
540 constexpr inline QPointF bottomLeft() const noexcept { return QPointF(xp, yp+h); }
541 constexpr inline QPointF center() const noexcept;
542
543 constexpr inline void setTopLeft(const QPointF &p) noexcept;
544 constexpr inline void setBottomRight(const QPointF &p) noexcept;
545 constexpr inline void setTopRight(const QPointF &p) noexcept;
546 constexpr inline void setBottomLeft(const QPointF &p) noexcept;
547
548 constexpr inline void moveLeft(qreal pos) noexcept;
549 constexpr inline void moveTop(qreal pos) noexcept;
550 constexpr inline void moveRight(qreal pos) noexcept;
551 constexpr inline void moveBottom(qreal pos) noexcept;
552 constexpr inline void moveTopLeft(const QPointF &p) noexcept;
553 constexpr inline void moveBottomRight(const QPointF &p) noexcept;
554 constexpr inline void moveTopRight(const QPointF &p) noexcept;
555 constexpr inline void moveBottomLeft(const QPointF &p) noexcept;
556 constexpr inline void moveCenter(const QPointF &p) noexcept;
557
558 constexpr inline void translate(qreal dx, qreal dy) noexcept;
559 constexpr inline void translate(const QPointF &p) noexcept;
560
561 [[nodiscard]] constexpr inline QRectF translated(qreal dx, qreal dy) const noexcept;
562 [[nodiscard]] constexpr inline QRectF translated(const QPointF &p) const noexcept;
563
564 [[nodiscard]] constexpr inline QRectF transposed() const noexcept;
565
566 constexpr inline void moveTo(qreal x, qreal y) noexcept;
567 constexpr inline void moveTo(const QPointF &p) noexcept;
568
569 constexpr inline void setRect(qreal x, qreal y, qreal w, qreal h) noexcept;
570 constexpr inline void getRect(qreal *x, qreal *y, qreal *w, qreal *h) const;
571
572 constexpr inline void setCoords(qreal x1, qreal y1, qreal x2, qreal y2) noexcept;
573 constexpr inline void getCoords(qreal *x1, qreal *y1, qreal *x2, qreal *y2) const;
574
575 constexpr inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2) noexcept;
576 [[nodiscard]] constexpr inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept;
577
578 constexpr inline QSizeF size() const noexcept;
579 constexpr inline qreal width() const noexcept;
580 constexpr inline qreal height() const noexcept;
581 constexpr inline void setWidth(qreal w) noexcept;
582 constexpr inline void setHeight(qreal h) noexcept;
583 constexpr inline void setSize(const QSizeF &s) noexcept;
584
585 QRectF operator|(const QRectF &r) const noexcept;
586 QRectF operator&(const QRectF &r) const noexcept;
587 inline QRectF &operator|=(const QRectF &r) noexcept;
588 inline QRectF &operator&=(const QRectF &r) noexcept;
589
590 bool contains(const QRectF &r) const noexcept;
591 bool contains(const QPointF &p) const noexcept;
592 inline bool contains(qreal x, qreal y) const noexcept;
593 [[nodiscard]] inline QRectF united(const QRectF &other) const noexcept;
594 [[nodiscard]] inline QRectF intersected(const QRectF &other) const noexcept;
595 bool intersects(const QRectF &r) const noexcept;
596
597 constexpr inline QRectF marginsAdded(const QMarginsF &margins) const noexcept;
598 constexpr inline QRectF marginsRemoved(const QMarginsF &margins) const noexcept;
599 constexpr inline QRectF &operator+=(const QMarginsF &margins) noexcept;
600 constexpr inline QRectF &operator-=(const QMarginsF &margins) noexcept;
601
602private:
603 friend constexpr bool comparesEqual(const QRectF &r1, const QRectF &r2) noexcept
604 {
605 return r1.topLeft() == r2.topLeft()
606 && r1.size() == r2.size();
607 }
608 Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(QRectF)
609
610 friend constexpr bool comparesEqual(const QRectF &r1, const QRect &r2) noexcept
611 { return r1.topLeft() == r2.topLeft() && r1.size() == r2.size(); }
612 Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(QRectF, QRect)
613
614 friend constexpr bool qFuzzyCompare(const QRectF &lhs, const QRectF &rhs) noexcept
615 {
616 return qFuzzyCompare(lhs.topLeft(), rhs.topLeft())
617 && qFuzzyCompare(lhs.bottomRight(), rhs.bottomRight());
618 }
619
620 friend constexpr bool qFuzzyIsNull(const QRectF &rect) noexcept
621 {
622 return qFuzzyIsNull(rect.w) && qFuzzyIsNull(rect.h);
623 }
624
625public:
626 [[nodiscard]] constexpr inline QRect toRect() const noexcept;
627 [[nodiscard]] QRect toAlignedRect() const noexcept;
628
629#if defined(Q_OS_DARWIN) || defined(Q_QDOC)
630 [[nodiscard]] static QRectF fromCGRect(CGRect rect) noexcept;
631 [[nodiscard]] CGRect toCGRect() const noexcept;
632#endif
633
634#if defined(Q_OS_WASM) || defined(Q_QDOC)
635 [[nodiscard]] static QRectF fromDOMRect(emscripten::val domRect);
636 [[nodiscard]] emscripten::val toDOMRect() const;
637#endif
638
639private:
640 qreal xp;
641 qreal yp;
642 qreal w;
643 qreal h;
644};
646
647
648/*****************************************************************************
649 QRectF stream functions
650 *****************************************************************************/
651#ifndef QT_NO_DATASTREAM
652Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QRectF &);
653Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QRectF &);
654#endif
655
656/*****************************************************************************
657 QRectF inline member functions
658 *****************************************************************************/
659
660constexpr inline QRectF::QRectF(qreal aleft, qreal atop, qreal awidth, qreal aheight) noexcept
661 : xp(aleft), yp(atop), w(awidth), h(aheight)
662{
663}
664
665constexpr inline QRectF::QRectF(const QPointF &atopLeft, const QSizeF &asize) noexcept
666 : xp(atopLeft.x()), yp(atopLeft.y()), w(asize.width()), h(asize.height())
667{
668}
669
670
671constexpr inline QRectF::QRectF(const QPointF &atopLeft, const QPointF &abottomRight) noexcept
672 : xp(atopLeft.x()), yp(atopLeft.y()), w(abottomRight.x() - atopLeft.x()), h(abottomRight.y() - atopLeft.y())
673{
674}
675
676constexpr inline QRectF::QRectF(const QRect &r) noexcept
677 : xp(r.x()),
678 yp(r.y()),
679 w(qint64(r.right()) - r.left() + 1),
680 h(qint64(r.bottom()) - r.top() + 1)
681{
682}
683
684QT_WARNING_PUSH
685QT_WARNING_DISABLE_FLOAT_COMPARE
686
687constexpr inline bool QRectF::isNull() const noexcept
688{ return w == 0. && h == 0.; }
689
690constexpr inline bool QRectF::isEmpty() const noexcept
691{ return w <= 0. || h <= 0.; }
692
693QT_WARNING_POP
694
695constexpr inline bool QRectF::isValid() const noexcept
696{ return w > 0. && h > 0.; }
697
698constexpr inline qreal QRectF::x() const noexcept
699{ return xp; }
700
701constexpr inline qreal QRectF::y() const noexcept
702{ return yp; }
703
704constexpr inline void QRectF::setLeft(qreal pos) noexcept
705{ qreal diff = pos - xp; xp += diff; w -= diff; }
706
707constexpr inline void QRectF::setRight(qreal pos) noexcept
708{ w = pos - xp; }
709
710constexpr inline void QRectF::setTop(qreal pos) noexcept
711{ qreal diff = pos - yp; yp += diff; h -= diff; }
712
713constexpr inline void QRectF::setBottom(qreal pos) noexcept
714{ h = pos - yp; }
715
716constexpr inline void QRectF::setTopLeft(const QPointF &p) noexcept
717{ setLeft(p.x()); setTop(p.y()); }
718
719constexpr inline void QRectF::setTopRight(const QPointF &p) noexcept
720{ setRight(p.x()); setTop(p.y()); }
721
722constexpr inline void QRectF::setBottomLeft(const QPointF &p) noexcept
723{ setLeft(p.x()); setBottom(p.y()); }
724
725constexpr inline void QRectF::setBottomRight(const QPointF &p) noexcept
726{ setRight(p.x()); setBottom(p.y()); }
727
728constexpr inline QPointF QRectF::center() const noexcept
729{ return QPointF(xp + w/2, yp + h/2); }
730
731constexpr inline void QRectF::moveLeft(qreal pos) noexcept
732{ xp = pos; }
733
734constexpr inline void QRectF::moveTop(qreal pos) noexcept
735{ yp = pos; }
736
737constexpr inline void QRectF::moveRight(qreal pos) noexcept
738{ xp = pos - w; }
739
740constexpr inline void QRectF::moveBottom(qreal pos) noexcept
741{ yp = pos - h; }
742
743constexpr inline void QRectF::moveTopLeft(const QPointF &p) noexcept
744{ moveLeft(p.x()); moveTop(p.y()); }
745
746constexpr inline void QRectF::moveTopRight(const QPointF &p) noexcept
747{ moveRight(p.x()); moveTop(p.y()); }
748
749constexpr inline void QRectF::moveBottomLeft(const QPointF &p) noexcept
750{ moveLeft(p.x()); moveBottom(p.y()); }
751
752constexpr inline void QRectF::moveBottomRight(const QPointF &p) noexcept
753{ moveRight(p.x()); moveBottom(p.y()); }
754
755constexpr inline void QRectF::moveCenter(const QPointF &p) noexcept
756{ xp = p.x() - w/2; yp = p.y() - h/2; }
757
758constexpr inline qreal QRectF::width() const noexcept
759{ return w; }
760
761constexpr inline qreal QRectF::height() const noexcept
762{ return h; }
763
764constexpr inline QSizeF QRectF::size() const noexcept
765{ return QSizeF(w, h); }
766
767constexpr inline void QRectF::translate(qreal dx, qreal dy) noexcept
768{
769 xp += dx;
770 yp += dy;
771}
772
773constexpr inline void QRectF::translate(const QPointF &p) noexcept
774{
775 xp += p.x();
776 yp += p.y();
777}
778
779constexpr inline void QRectF::moveTo(qreal ax, qreal ay) noexcept
780{
781 xp = ax;
782 yp = ay;
783}
784
785constexpr inline void QRectF::moveTo(const QPointF &p) noexcept
786{
787 xp = p.x();
788 yp = p.y();
789}
790
791constexpr inline QRectF QRectF::translated(qreal dx, qreal dy) const noexcept
792{
793 return QRectF(xp + dx, yp + dy, w, h);
794}
795
796constexpr inline QRectF QRectF::translated(const QPointF &p) const noexcept
797{ return QRectF(xp + p.x(), yp + p.y(), w, h); }
798
799constexpr inline QRectF QRectF::transposed() const noexcept
800{ return QRectF(topLeft(), size().transposed()); }
801
802constexpr inline void QRectF::getRect(qreal *ax, qreal *ay, qreal *aaw, qreal *aah) const
803{
804 *ax = this->xp;
805 *ay = this->yp;
806 *aaw = this->w;
807 *aah = this->h;
808}
809
810constexpr inline void QRectF::setRect(qreal ax, qreal ay, qreal aaw, qreal aah) noexcept
811{
812 this->xp = ax;
813 this->yp = ay;
814 this->w = aaw;
815 this->h = aah;
816}
817
818constexpr inline void QRectF::getCoords(qreal *xp1, qreal *yp1, qreal *xp2, qreal *yp2) const
819{
820 *xp1 = xp;
821 *yp1 = yp;
822 *xp2 = xp + w;
823 *yp2 = yp + h;
824}
825
826constexpr inline void QRectF::setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2) noexcept
827{
828 xp = xp1;
829 yp = yp1;
830 w = xp2 - xp1;
831 h = yp2 - yp1;
832}
833
834constexpr inline void QRectF::adjust(qreal xp1, qreal yp1, qreal xp2, qreal yp2) noexcept
835{
836 xp += xp1;
837 yp += yp1;
838 w += xp2 - xp1;
839 h += yp2 - yp1;
840}
841
842constexpr inline QRectF QRectF::adjusted(qreal xp1, qreal yp1, qreal xp2, qreal yp2) const noexcept
843{
844 return QRectF(xp + xp1, yp + yp1, w + xp2 - xp1, h + yp2 - yp1);
845}
846
847constexpr inline void QRectF::setWidth(qreal aw) noexcept
848{ this->w = aw; }
849
850constexpr inline void QRectF::setHeight(qreal ah) noexcept
851{ this->h = ah; }
852
853constexpr inline void QRectF::setSize(const QSizeF &s) noexcept
854{
855 w = s.width();
856 h = s.height();
857}
858
859inline bool QRectF::contains(qreal ax, qreal ay) const noexcept
860{
861 return contains(QPointF(ax, ay));
862}
863
864inline QRectF &QRectF::operator|=(const QRectF &r) noexcept
865{
866 *this = *this | r;
867 return *this;
868}
869
870inline QRectF &QRectF::operator&=(const QRectF &r) noexcept
871{
872 *this = *this & r;
873 return *this;
874}
875
876inline QRectF QRectF::intersected(const QRectF &r) const noexcept
877{
878 return *this & r;
879}
880
881inline QRectF QRectF::united(const QRectF &r) const noexcept
882{
883 return *this | r;
884}
885
886constexpr QRectF QRect::toRectF() const noexcept { return *this; }
887
888constexpr inline QRect QRectF::toRect() const noexcept
889{
890 // This rounding is designed to minimize the maximum possible difference
891 // in topLeft(), bottomRight(), and size() after rounding.
892 // All dimensions are at most off by 0.75, and topLeft by at most 0.5.
893 const int nxp = QtPrivate::qSaturateRound(xp);
894 const int nyp = QtPrivate::qSaturateRound(yp);
895 const int nw = QtPrivate::qSaturateRound(w + (xp - nxp) / 2);
896 const int nh = QtPrivate::qSaturateRound(h + (yp - nyp) / 2);
897 return QRect(nxp, nyp, nw, nh);
898}
899
900constexpr inline QRectF operator+(const QRectF &lhs, const QMarginsF &rhs) noexcept
901{
902 return QRectF(QPointF(lhs.left() - rhs.left(), lhs.top() - rhs.top()),
903 QSizeF(lhs.width() + rhs.left() + rhs.right(), lhs.height() + rhs.top() + rhs.bottom()));
904}
905
906constexpr inline QRectF operator+(const QMarginsF &lhs, const QRectF &rhs) noexcept
907{
908 return QRectF(QPointF(rhs.left() - lhs.left(), rhs.top() - lhs.top()),
909 QSizeF(rhs.width() + lhs.left() + lhs.right(), rhs.height() + lhs.top() + lhs.bottom()));
910}
911
912constexpr inline QRectF operator-(const QRectF &lhs, const QMarginsF &rhs) noexcept
913{
914 return QRectF(QPointF(lhs.left() + rhs.left(), lhs.top() + rhs.top()),
915 QSizeF(lhs.width() - rhs.left() - rhs.right(), lhs.height() - rhs.top() - rhs.bottom()));
916}
917
918constexpr inline QRectF QRectF::marginsAdded(const QMarginsF &margins) const noexcept
919{
920 return QRectF(QPointF(xp - margins.left(), yp - margins.top()),
921 QSizeF(w + margins.left() + margins.right(), h + margins.top() + margins.bottom()));
922}
923
924constexpr inline QRectF QRectF::marginsRemoved(const QMarginsF &margins) const noexcept
925{
926 return QRectF(QPointF(xp + margins.left(), yp + margins.top()),
927 QSizeF(w - margins.left() - margins.right(), h - margins.top() - margins.bottom()));
928}
929
930constexpr inline QRectF &QRectF::operator+=(const QMarginsF &margins) noexcept
931{
932 *this = marginsAdded(margins);
933 return *this;
934}
935
936constexpr inline QRectF &QRectF::operator-=(const QMarginsF &margins) noexcept
937{
938 *this = marginsRemoved(margins);
939 return *this;
940}
941
942#ifndef QT_NO_DEBUG_STREAM
943Q_CORE_EXPORT QDebug operator<<(QDebug, const QRectF &);
944#endif
945
946QT_END_NAMESPACE
947
948#endif // QRECT_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
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)
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
QSettings settings("MyCompany", "MyApp")
[11]
Qt::CaseSensitivity caseSensitivity
Definition qsettings.cpp:71