Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qmargins.cpp
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#include "qmargins.h"
5#include "qdatastream.h"
6
7#include <private/qdebug_p.h>
8
10
28/*****************************************************************************
29 QMargins member functions
30 *****************************************************************************/
31
382/*****************************************************************************
383 QMargins stream functions
384 *****************************************************************************/
385#ifndef QT_NO_DATASTREAM
397{
398 s << m.left() << m.top() << m.right() << m.bottom();
399 return s;
400}
401
413{
414 int left, top, right, bottom;
415 s >> left; m.setLeft(left);
416 s >> top; m.setTop(top);
417 s >> right; m.setRight(right);
418 s >> bottom; m.setBottom(bottom);
419 return s;
420}
421#endif // QT_NO_DATASTREAM
422
423#ifndef QT_NO_DEBUG_STREAM
425{
426 QDebugStateSaver saver(dbg);
427 dbg.nospace();
428 dbg << "QMargins" << '(';
430 dbg << ')';
431 return dbg;
432}
433#endif
434
452/*****************************************************************************
453 QMarginsF member functions
454 *****************************************************************************/
455
749/*****************************************************************************
750 QMarginsF stream functions
751 *****************************************************************************/
752#ifndef QT_NO_DATASTREAM
764{
765 s << double(m.left()) << double(m.top()) << double(m.right()) << double(m.bottom());
766 return s;
767}
768
780{
781 double left, top, right, bottom;
782 s >> left;
783 s >> top;
784 s >> right;
785 s >> bottom;
787 return s;
788}
789#endif // QT_NO_DATASTREAM
790
791#ifndef QT_NO_DEBUG_STREAM
793{
794 QDebugStateSaver saver(dbg);
795 dbg.nospace();
796 dbg << "QMarginsF" << '(';
798 dbg << ')';
799 return dbg;
800}
801#endif
802
\inmodule QtCore\reentrant
Definition qdatastream.h:30
\inmodule QtCore
\inmodule QtCore
\inmodule QtCore
Definition qmargins.h:274
\inmodule QtCore
Definition qmargins.h:23
Combined button and popup list for selecting options.
static void formatQMargins(QDebug &debug, const Margins &margins)
Definition qdebug_p.h:51
QDataStream & operator>>(QDataStream &s, QMargins &m)
Definition qmargins.cpp:412
QDataStream & operator<<(QDataStream &s, const QMargins &m)
Definition qmargins.cpp:396
const GLfloat * m
GLdouble GLdouble GLdouble GLdouble top
GLdouble GLdouble right
GLint left
GLint GLint bottom
GLdouble s
[6]
Definition qopenglext.h:235
double qreal
Definition qtypes.h:92