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 int tmp = wd;-
7 wd = ht;-
8 ht = tmp;-
9}
executed 3 times by 1 test: end of block
Executed by:
  • tst_QSize
3
10QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const noexcept-
11{-
12 if (mode == Qt::IgnoreAspectRatio
mode == Qt::IgnoreAspectRatioDescription
TRUEevaluated 534 times by 15 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
FALSEevaluated 5590 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 5588 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 5588 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-5590
13 return
executed 536 times by 15 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
s;
executed 536 times by 15 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
536
14 } else {-
15 bool useHeight;-
16 qint64 rw = qint64(s.ht) * qint64(wd) / qint64(ht);-
17-
18 if (mode == Qt::KeepAspectRatio
mode == Qt::KeepAspectRatioDescription
TRUEevaluated 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
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSize
) {
2-5586
19 useHeight = (rw <= s.wd);-
20 }
executed 5586 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 {
5586
21 useHeight = (rw >= s.wd);-
22 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QSize
2
23-
24 if (useHeight
useHeightDescription
TRUEevaluated 5550 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-5550
25 return
executed 5550 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 5550 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
5550
26 } else {-
27 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
28 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
29 }-
30 }-
31}-
32QDataStream &operator<<(QDataStream &s, const QSize &sz)-
33{-
34 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
35 s << (qint16)sz.width() << (qint16)sz.height();
never executed: s << (qint16)sz.width() << (qint16)sz.height();
0
36 else-
37 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
38 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
39}-
40QDataStream &operator>>(QDataStream &s, QSize &sz)-
41{-
42 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
43 qint16 w, h;-
44 s >> w; sz.rwidth() = w;-
45 s >> h; sz.rheight() = h;-
46 }
never executed: end of block
0
47 else {-
48 qint32 w, h;-
49 s >> w; sz.rwidth() = w;-
50 s >> h; sz.rheight() = h;-
51 }
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
52 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
53}-
54-
55-
56-
57QDebug operator<<(QDebug dbg, const QSize &s)-
58{-
59 QDebugStateSaver saver(dbg);-
60 dbg.nospace();-
61 dbg << "QSize(";-
62 QtDebugUtils::formatQSize(dbg, s);-
63 dbg << ')';-
64 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
65}-
66void QSizeF::transpose() noexcept-
67{-
68 qreal tmp = wd;-
69 wd = ht;-
70 ht = tmp;-
71}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_QGraphicsLinearLayout
  • tst_QSizeF
6
72QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const noexcept-
73{-
74 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
75 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
76 } else {-
77 bool useHeight;-
78 qreal rw = s.ht * wd / ht;-
79-
80 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
81 useHeight = (rw <= s.wd);-
82 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QSizeF
else {
2
83 useHeight = (rw >= s.wd);-
84 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_QSizeF
2
85-
86 if (useHeight
useHeightDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSizeF
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QSizeF
) {
2
87 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
88 } else {-
89 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
90 }-
91 }-
92}-
93QDataStream &operator<<(QDataStream &s, const QSizeF &sz)-
94{-
95 s << double(sz.width()) << double(sz.height());-
96 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
97}-
98QDataStream &operator>>(QDataStream &s, QSizeF &sz)-
99{-
100 double w, h;-
101 s >> w;-
102 s >> h;-
103 sz.setWidth(qreal(w));-
104 sz.setHeight(qreal(h));-
105 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
106}-
107-
108-
109-
110QDebug operator<<(QDebug dbg, const QSizeF &s)-
111{-
112 QDebugStateSaver saver(dbg);-
113 dbg.nospace();-
114 dbg << "QSizeF(";-
115 QtDebugUtils::formatQSize(dbg, s);-
116 dbg << ')';-
117 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
118}-
119-
120-
121-
Switch to Source codePreprocessed file

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