qsize.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qsize.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4void QSize::transpose() noexcept-
5{-
6 qSwap(wd, ht);-
7}
executed 3 times by 1 test: end of block
Executed by:
  • tst_QSize
3
8QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const noexcept-
9{-
10 if (mode == Qt::IgnoreAspectRatio
mode == Qt::IgnoreAspectRatioDescription
TRUEevaluated 596 times by 16 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
FALSEevaluated 5586 times by 18 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QPixmap
  • tst_QSidebar
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_languageChange
|| wd == 0
wd == 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSize
FALSEevaluated 5584 times by 18 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QPixmap
  • tst_QSidebar
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_languageChange
|| ht == 0
ht == 0Description
TRUEnever evaluated
FALSEevaluated 5584 times by 18 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QPixmap
  • tst_QSidebar
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_languageChange
) {
0-5586
11 return
executed 598 times by 16 tests: return s;
Executed by:
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
s;
executed 598 times by 16 tests: return s;
Executed by:
  • tst_QAccessibility
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QImageReader
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_QTreeWidget
  • tst_languageChange
598
12 } else {-
13 bool useHeight;-
14 qint64 rw = qint64(s.ht) * qint64(wd) / qint64(ht);-
15-
16 if (mode == Qt::KeepAspectRatio
mode == Qt::KeepAspectRatioDescription
TRUEevaluated 5582 times by 18 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QPixmap
  • tst_QSidebar
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_languageChange
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSize
) {
2-5582
17 useHeight = (rw <= s.wd);-
18 }
executed 5582 times by 18 tests: end of block
Executed by:
  • tst_QAccessibility
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QImage
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QPixmap
  • tst_QSidebar
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_languageChange
else {
5582
19 useHeight = (rw >= s.wd);-
20 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QSize
2
21-
22 if (useHeight
useHeightDescription
TRUEevaluated 5546 times by 16 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QSidebar
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_languageChange
FALSEevaluated 38 times by 4 tests
Evaluated by:
  • tst_QIcon
  • tst_QImage
  • tst_QPixmap
  • tst_QSize
) {
38-5546
23 return
executed 5546 times by 16 tests: return QSize(rw, s.ht);
Executed by:
  • tst_QAccessibility
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QSidebar
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_languageChange
QSize(rw, s.ht);
executed 5546 times by 16 tests: return QSize(rw, s.ht);
Executed by:
  • tst_QAccessibility
  • tst_QCompleter
  • tst_QFileDialog2
  • tst_QFiledialog
  • tst_QGraphicsProxyWidget
  • tst_QIcoImageFormat
  • tst_QIcon
  • tst_QItemDelegate
  • tst_QLineEdit
  • tst_QMdiArea
  • tst_QMdiSubWindow
  • tst_QSidebar
  • tst_QSize
  • tst_QSystemTrayIcon
  • tst_QTreeView
  • tst_languageChange
5546
24 } else {-
25 return
executed 38 times by 4 tests: return QSize(s.wd, qint32(qint64(s.wd) * qint64(ht) / qint64(wd)));
Executed by:
  • tst_QIcon
  • tst_QImage
  • tst_QPixmap
  • tst_QSize
QSize(s.wd,
executed 38 times by 4 tests: return QSize(s.wd, qint32(qint64(s.wd) * qint64(ht) / qint64(wd)));
Executed by:
  • tst_QIcon
  • tst_QImage
  • tst_QPixmap
  • tst_QSize
38
26 qint32(qint64(s.wd) * qint64(ht) / qint64(wd)));
executed 38 times by 4 tests: return QSize(s.wd, qint32(qint64(s.wd) * qint64(ht) / qint64(wd)));
Executed by:
  • tst_QIcon
  • tst_QImage
  • tst_QPixmap
  • tst_QSize
38
27 }-
28 }-
29}-
30QDataStream &operator<<(QDataStream &s, const QSize &sz)-
31{-
32 if (s.version() == 1
s.version() == 1Description
TRUEnever evaluated
FALSEevaluated 165 times by 8 tests
Evaluated by:
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QIcon
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QSettings
  • tst_QStandardItem
  • tst_QVariant
)
0-165
33 s << (qint16)sz.width() << (qint16)sz.height();
never executed: s << (qint16)sz.width() << (qint16)sz.height();
0
34 else-
35 s << (qint32)sz.width() << (qint32)sz.height();
executed 165 times by 8 tests: s << (qint32)sz.width() << (qint32)sz.height();
Executed by:
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QIcon
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QSettings
  • tst_QStandardItem
  • tst_QVariant
165
36 return
executed 165 times by 8 tests: return s;
Executed by:
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QIcon
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QSettings
  • tst_QStandardItem
  • tst_QVariant
s;
executed 165 times by 8 tests: return s;
Executed by:
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QIcon
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QSettings
  • tst_QStandardItem
  • tst_QVariant
165
37}-
38QDataStream &operator>>(QDataStream &s, QSize &sz)-
39{-
40 if (s.version() == 1
s.version() == 1Description
TRUEnever evaluated
FALSEevaluated 246 times by 8 tests
Evaluated by:
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QIcon
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QSettings
  • tst_QStandardItem
  • tst_QVariant
) {
0-246
41 qint16 w, h;-
42 s >> w; sz.rwidth() = w;-
43 s >> h; sz.rheight() = h;-
44 }
never executed: end of block
0
45 else {-
46 qint32 w, h;-
47 s >> w; sz.rwidth() = w;-
48 s >> h; sz.rheight() = h;-
49 }
executed 246 times by 8 tests: end of block
Executed by:
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QIcon
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QSettings
  • tst_QStandardItem
  • tst_QVariant
246
50 return
executed 246 times by 8 tests: return s;
Executed by:
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QIcon
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QSettings
  • tst_QStandardItem
  • tst_QVariant
s;
executed 246 times by 8 tests: return s;
Executed by:
  • tst_QDataStream
  • tst_QDockWidget
  • tst_QIcon
  • tst_QMainWindow
  • tst_QMetaType
  • tst_QSettings
  • tst_QStandardItem
  • tst_QVariant
246
51}-
52-
53-
54-
55QDebug operator<<(QDebug dbg, const QSize &s)-
56{-
57 QDebugStateSaver saver(dbg);-
58 dbg.nospace();-
59 dbg << "QSize(";-
60 QtDebugUtils::formatQSize(dbg, s);-
61 dbg << ')';-
62 return
executed 3 times by 2 tests: return dbg;
Executed by:
  • tst_QVariant
  • tst_QWidget
dbg;
executed 3 times by 2 tests: return dbg;
Executed by:
  • tst_QVariant
  • tst_QWidget
3
63}-
64void QSizeF::transpose() noexcept-
65{-
66 qSwap(wd, ht);-
67}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_QGraphicsLinearLayout
  • tst_QSizeF
6
68QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const noexcept-
69{-
70 if (mode == Qt::IgnoreAspectRatio
mode == Qt::IgnoreAspectRatioDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSizeF
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_QSizeF
|| qIsNull(wd)
qIsNull(wd)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSizeF
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QSizeF
|| qIsNull(ht)
qIsNull(ht)Description
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_QSizeF
) {
0-6
71 return
executed 4 times by 1 test: return s;
Executed by:
  • tst_QSizeF
s;
executed 4 times by 1 test: return s;
Executed by:
  • tst_QSizeF
4
72 } else {-
73 bool useHeight;-
74 qreal rw = s.ht * wd / ht;-
75-
76 if (mode == Qt::KeepAspectRatio
mode == Qt::KeepAspectRatioDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSizeF
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSizeF
) {
2
77 useHeight = (rw <= s.wd);-
78 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QSizeF
else {
2
79 useHeight = (rw >= s.wd);-
80 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QSizeF
2
81-
82 if (useHeight
useHeightDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSizeF
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSizeF
) {
2
83 return
executed 2 times by 1 test: return QSizeF(rw, s.ht);
Executed by:
  • tst_QSizeF
QSizeF(rw, s.ht);
executed 2 times by 1 test: return QSizeF(rw, s.ht);
Executed by:
  • tst_QSizeF
2
84 } else {-
85 return
executed 2 times by 1 test: return QSizeF(s.wd, s.wd * ht / wd);
Executed by:
  • tst_QSizeF
QSizeF(s.wd, s.wd * ht / wd);
executed 2 times by 1 test: return QSizeF(s.wd, s.wd * ht / wd);
Executed by:
  • tst_QSizeF
2
86 }-
87 }-
88}-
89QDataStream &operator<<(QDataStream &s, const QSizeF &sz)-
90{-
91 s << double(sz.width()) << double(sz.height());-
92 return
executed 69 times by 3 tests: return s;
Executed by:
  • tst_QDataStream
  • tst_QMetaType
  • tst_QVariant
s;
executed 69 times by 3 tests: return s;
Executed by:
  • tst_QDataStream
  • tst_QMetaType
  • tst_QVariant
69
93}-
94QDataStream &operator>>(QDataStream &s, QSizeF &sz)-
95{-
96 double w, h;-
97 s >> w;-
98 s >> h;-
99 sz.setWidth(qreal(w));-
100 sz.setHeight(qreal(h));-
101 return
executed 73 times by 3 tests: return s;
Executed by:
  • tst_QDataStream
  • tst_QMetaType
  • tst_QVariant
s;
executed 73 times by 3 tests: return s;
Executed by:
  • tst_QDataStream
  • tst_QMetaType
  • tst_QVariant
73
102}-
103-
104-
105-
106QDebug operator<<(QDebug dbg, const QSizeF &s)-
107{-
108 QDebugStateSaver saver(dbg);-
109 dbg.nospace();-
110 dbg << "QSizeF(";-
111 QtDebugUtils::formatQSize(dbg, s);-
112 dbg << ')';-
113 return
executed 1 time by 1 test: return dbg;
Executed by:
  • tst_QVariant
dbg;
executed 1 time by 1 test: return dbg;
Executed by:
  • tst_QVariant
1
114}-
115-
116-
117-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9