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