| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/tools/qsize.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | void QSize::transpose() noexcept | - | ||||||||||||||||||
| 5 | { | - | ||||||||||||||||||
| 6 | int tmp = wd; | - | ||||||||||||||||||
| 7 | wd = ht; | - | ||||||||||||||||||
| 8 | ht = tmp; | - | ||||||||||||||||||
| 9 | } executed 3 times by 1 test:  end of blockExecuted by: 
 | 3 | ||||||||||||||||||
| 10 | QSize QSize::scaled(const QSize &s, Qt::AspectRatioMode mode) const noexcept | - | ||||||||||||||||||
| 11 | { | - | ||||||||||||||||||
| 12 | if (mode == Qt::IgnoreAspectRatio 
 
 
 | 0-5590 | ||||||||||||||||||
| 13 | return executed 536 times by 15 tests: s; return s;Executed by: 
 executed 536 times by 15 tests:  return s;Executed by: 
 | 536 | ||||||||||||||||||
| 14 | } else { | - | ||||||||||||||||||
| 15 | bool useHeight; | - | ||||||||||||||||||
| 16 | qint64 rw = qint64(s.ht) * qint64(wd) / qint64(ht); | - | ||||||||||||||||||
| 17 | - | |||||||||||||||||||
| 18 | if (mode == Qt::KeepAspectRatio 
 | 2-5586 | ||||||||||||||||||
| 19 | useHeight = (rw <= s.wd); | - | ||||||||||||||||||
| 20 | } executed 5586 times by 18 tests: else { end of blockExecuted by: 
 | 5586 | ||||||||||||||||||
| 21 | useHeight = (rw >= s.wd); | - | ||||||||||||||||||
| 22 | } executed 2 times by 1 test:  end of blockExecuted by: 
 | 2 | ||||||||||||||||||
| 23 | - | |||||||||||||||||||
| 24 | if (useHeight 
 | 38-5550 | ||||||||||||||||||
| 25 | return executed 5550 times by 16 tests: QSize(rw, s.ht); return QSize(rw, s.ht);Executed by: 
 executed 5550 times by 16 tests:  return QSize(rw, s.ht);Executed by: 
 | 5550 | ||||||||||||||||||
| 26 | } else { | - | ||||||||||||||||||
| 27 | return executed 38 times by 4 tests: QSize(s.wd, return QSize(s.wd, qint32(qint64(s.wd) * qint64(ht) / qint64(wd)));Executed by: 
 executed 38 times by 4 tests:  return QSize(s.wd, qint32(qint64(s.wd) * qint64(ht) / qint64(wd)));Executed by: 
 | 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: 
 | 38 | ||||||||||||||||||
| 29 | } | - | ||||||||||||||||||
| 30 | } | - | ||||||||||||||||||
| 31 | } | - | ||||||||||||||||||
| 32 | QDataStream &operator<<(QDataStream &s, const QSize &sz) | - | ||||||||||||||||||
| 33 | { | - | ||||||||||||||||||
| 34 | if (s.version() == 1 
 | 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: 
 | 165 | ||||||||||||||||||
| 38 | return executed 165 times by 8 tests: s; return s;Executed by: 
 executed 165 times by 8 tests:  return s;Executed by: 
 | 165 | ||||||||||||||||||
| 39 | } | - | ||||||||||||||||||
| 40 | QDataStream &operator>>(QDataStream &s, QSize &sz) | - | ||||||||||||||||||
| 41 | { | - | ||||||||||||||||||
| 42 | if (s.version() == 1 
 | 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 blockExecuted by: 
 | 246 | ||||||||||||||||||
| 52 | return executed 246 times by 8 tests: s; return s;Executed by: 
 executed 246 times by 8 tests:  return s;Executed by: 
 | 246 | ||||||||||||||||||
| 53 | } | - | ||||||||||||||||||
| 54 | - | |||||||||||||||||||
| 55 | - | |||||||||||||||||||
| 56 | - | |||||||||||||||||||
| 57 | QDebug 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: dbg; return dbg;Executed by: 
 executed 3 times by 2 tests:  return dbg;Executed by: 
 | 3 | ||||||||||||||||||
| 65 | } | - | ||||||||||||||||||
| 66 | void QSizeF::transpose() noexcept | - | ||||||||||||||||||
| 67 | { | - | ||||||||||||||||||
| 68 | qreal tmp = wd; | - | ||||||||||||||||||
| 69 | wd = ht; | - | ||||||||||||||||||
| 70 | ht = tmp; | - | ||||||||||||||||||
| 71 | } executed 6 times by 2 tests:  end of blockExecuted by: 
 | 6 | ||||||||||||||||||
| 72 | QSizeF QSizeF::scaled(const QSizeF &s, Qt::AspectRatioMode mode) const noexcept | - | ||||||||||||||||||
| 73 | { | - | ||||||||||||||||||
| 74 | if (mode == Qt::IgnoreAspectRatio 
 
 
 | 0-6 | ||||||||||||||||||
| 75 | return executed 4 times by 1 test: s; return s;Executed by: 
 executed 4 times by 1 test:  return s;Executed by: 
 | 4 | ||||||||||||||||||
| 76 | } else { | - | ||||||||||||||||||
| 77 | bool useHeight; | - | ||||||||||||||||||
| 78 | qreal rw = s.ht * wd / ht; | - | ||||||||||||||||||
| 79 | - | |||||||||||||||||||
| 80 | if (mode == Qt::KeepAspectRatio 
 | 2 | ||||||||||||||||||
| 81 | useHeight = (rw <= s.wd); | - | ||||||||||||||||||
| 82 | } executed 2 times by 1 test: else { end of blockExecuted by: 
 | 2 | ||||||||||||||||||
| 83 | useHeight = (rw >= s.wd); | - | ||||||||||||||||||
| 84 | } executed 2 times by 1 test:  end of blockExecuted by: 
 | 2 | ||||||||||||||||||
| 85 | - | |||||||||||||||||||
| 86 | if (useHeight 
 | 2 | ||||||||||||||||||
| 87 | return executed 2 times by 1 test: QSizeF(rw, s.ht); return QSizeF(rw, s.ht);Executed by: 
 executed 2 times by 1 test:  return QSizeF(rw, s.ht);Executed by: 
 | 2 | ||||||||||||||||||
| 88 | } else { | - | ||||||||||||||||||
| 89 | return executed 2 times by 1 test: QSizeF(s.wd, s.wd * ht / wd); return QSizeF(s.wd, s.wd * ht / wd);Executed by: 
 executed 2 times by 1 test:  return QSizeF(s.wd, s.wd * ht / wd);Executed by: 
 | 2 | ||||||||||||||||||
| 90 | } | - | ||||||||||||||||||
| 91 | } | - | ||||||||||||||||||
| 92 | } | - | ||||||||||||||||||
| 93 | QDataStream &operator<<(QDataStream &s, const QSizeF &sz) | - | ||||||||||||||||||
| 94 | { | - | ||||||||||||||||||
| 95 | s << double(sz.width()) << double(sz.height()); | - | ||||||||||||||||||
| 96 | return executed 69 times by 3 tests: s; return s;Executed by: 
 executed 69 times by 3 tests:  return s;Executed by: 
 | 69 | ||||||||||||||||||
| 97 | } | - | ||||||||||||||||||
| 98 | QDataStream &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: s; return s;Executed by: 
 executed 73 times by 3 tests:  return s;Executed by: 
 | 73 | ||||||||||||||||||
| 106 | } | - | ||||||||||||||||||
| 107 | - | |||||||||||||||||||
| 108 | - | |||||||||||||||||||
| 109 | - | |||||||||||||||||||
| 110 | QDebug 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: dbg; return dbg;Executed by: 
 executed 1 time by 1 test:  return dbg;Executed by: 
 | 1 | ||||||||||||||||||
| 118 | } | - | ||||||||||||||||||
| 119 | - | |||||||||||||||||||
| 120 | - | |||||||||||||||||||
| 121 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |