| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/text/qtextoption.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | struct QTextOptionPrivate | - | ||||||
| 5 | { | - | ||||||
| 6 | QList<QTextOption::Tab> tabStops; | - | ||||||
| 7 | }; | - | ||||||
| 8 | - | |||||||
| 9 | - | |||||||
| 10 | - | |||||||
| 11 | - | |||||||
| 12 | - | |||||||
| 13 | - | |||||||
| 14 | - | |||||||
| 15 | QTextOption::QTextOption() | - | ||||||
| 16 | : align(Qt::AlignLeft), | - | ||||||
| 17 | wordWrap(QTextOption::WordWrap), | - | ||||||
| 18 | design(false), | - | ||||||
| 19 | unused(0), | - | ||||||
| 20 | unused2(0), | - | ||||||
| 21 | f(0), | - | ||||||
| 22 | tab(-1), | - | ||||||
| 23 | d(0) | - | ||||||
| 24 | { | - | ||||||
| 25 | direction = Qt::LayoutDirectionAuto; | - | ||||||
| 26 | } never executed: end of block | 0 | ||||||
| 27 | - | |||||||
| 28 | - | |||||||
| 29 | - | |||||||
| 30 | - | |||||||
| 31 | - | |||||||
| 32 | - | |||||||
| 33 | QTextOption::QTextOption(Qt::Alignment alignment) | - | ||||||
| 34 | : align(alignment), | - | ||||||
| 35 | wordWrap(QTextOption::WordWrap), | - | ||||||
| 36 | design(false), | - | ||||||
| 37 | unused(0), | - | ||||||
| 38 | unused2(0), | - | ||||||
| 39 | f(0), | - | ||||||
| 40 | tab(-1), | - | ||||||
| 41 | d(0) | - | ||||||
| 42 | { | - | ||||||
| 43 | direction = QGuiApplication::layoutDirection(); | - | ||||||
| 44 | } never executed: end of block | 0 | ||||||
| 45 | - | |||||||
| 46 | - | |||||||
| 47 | - | |||||||
| 48 | - | |||||||
| 49 | QTextOption::~QTextOption() | - | ||||||
| 50 | { | - | ||||||
| 51 | delete d; | - | ||||||
| 52 | } never executed: end of block | 0 | ||||||
| 53 | - | |||||||
| 54 | - | |||||||
| 55 | - | |||||||
| 56 | - | |||||||
| 57 | - | |||||||
| 58 | - | |||||||
| 59 | QTextOption::QTextOption(const QTextOption &o) | - | ||||||
| 60 | : align(o.align), | - | ||||||
| 61 | wordWrap(o.wordWrap), | - | ||||||
| 62 | design(o.design), | - | ||||||
| 63 | direction(o.direction), | - | ||||||
| 64 | unused(o.unused), | - | ||||||
| 65 | unused2(o.unused2), | - | ||||||
| 66 | f(o.f), | - | ||||||
| 67 | tab(o.tab), | - | ||||||
| 68 | d(0) | - | ||||||
| 69 | { | - | ||||||
| 70 | if (o.d
| 0 | ||||||
| 71 | d = new QTextOptionPrivate(*o.d); never executed: d = new QTextOptionPrivate(*o.d); | 0 | ||||||
| 72 | } never executed: end of block | 0 | ||||||
| 73 | - | |||||||
| 74 | - | |||||||
| 75 | - | |||||||
| 76 | - | |||||||
| 77 | - | |||||||
| 78 | - | |||||||
| 79 | - | |||||||
| 80 | QTextOption &QTextOption::operator=(const QTextOption &o) | - | ||||||
| 81 | { | - | ||||||
| 82 | if (this == &o
| 0 | ||||||
| 83 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||
| 84 | - | |||||||
| 85 | QTextOptionPrivate* dNew = 0; | - | ||||||
| 86 | if (o.d
| 0 | ||||||
| 87 | dNew = new QTextOptionPrivate(*o.d); never executed: dNew = new QTextOptionPrivate(*o.d); | 0 | ||||||
| 88 | delete d; | - | ||||||
| 89 | d = dNew; | - | ||||||
| 90 | - | |||||||
| 91 | align = o.align; | - | ||||||
| 92 | wordWrap = o.wordWrap; | - | ||||||
| 93 | design = o.design; | - | ||||||
| 94 | direction = o.direction; | - | ||||||
| 95 | unused = o.unused; | - | ||||||
| 96 | f = o.f; | - | ||||||
| 97 | tab = o.tab; | - | ||||||
| 98 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||
| 99 | } | - | ||||||
| 100 | - | |||||||
| 101 | - | |||||||
| 102 | - | |||||||
| 103 | - | |||||||
| 104 | - | |||||||
| 105 | - | |||||||
| 106 | - | |||||||
| 107 | void QTextOption::setTabArray(const QList<qreal> &tabStops) | - | ||||||
| 108 | { | - | ||||||
| 109 | if (!d
| 0 | ||||||
| 110 | d = new QTextOptionPrivate; never executed: d = new QTextOptionPrivate; | 0 | ||||||
| 111 | QList<QTextOption::Tab> tabs; | - | ||||||
| 112 | QTextOption::Tab tab; | - | ||||||
| 113 | tabs.reserve(tabStops.count()); | - | ||||||
| 114 | for (qreal pos : tabStops) { | - | ||||||
| 115 | tab.position = pos; | - | ||||||
| 116 | tabs.append(tab); | - | ||||||
| 117 | } never executed: end of block | 0 | ||||||
| 118 | d->tabStops = tabs; | - | ||||||
| 119 | } never executed: end of block | 0 | ||||||
| 120 | void QTextOption::setTabs(const QList<QTextOption::Tab> &tabStops) | - | ||||||
| 121 | { | - | ||||||
| 122 | if (!d
| 0 | ||||||
| 123 | d = new QTextOptionPrivate; never executed: d = new QTextOptionPrivate; | 0 | ||||||
| 124 | d->tabStops = tabStops; | - | ||||||
| 125 | } never executed: end of block | 0 | ||||||
| 126 | - | |||||||
| 127 | - | |||||||
| 128 | - | |||||||
| 129 | - | |||||||
| 130 | - | |||||||
| 131 | - | |||||||
| 132 | QList<qreal> QTextOption::tabArray() const | - | ||||||
| 133 | { | - | ||||||
| 134 | QList<qreal> answer; | - | ||||||
| 135 | if (!d
| 0 | ||||||
| 136 | return never executed: answer;return answer;never executed: return answer; | 0 | ||||||
| 137 | - | |||||||
| 138 | answer.reserve(d->tabStops.count()); | - | ||||||
| 139 | QList<QTextOption::Tab>::ConstIterator iter = d->tabStops.constBegin(); | - | ||||||
| 140 | while(iter != d->tabStops.constEnd()
| 0 | ||||||
| 141 | answer.append( (*iter).position); | - | ||||||
| 142 | ++iter; | - | ||||||
| 143 | } never executed: end of block | 0 | ||||||
| 144 | return never executed: answer;return answer;never executed: return answer; | 0 | ||||||
| 145 | } | - | ||||||
| 146 | - | |||||||
| 147 | - | |||||||
| 148 | QList<QTextOption::Tab> QTextOption::tabs() const | - | ||||||
| 149 | { | - | ||||||
| 150 | if (!d
| 0 | ||||||
| 151 | return never executed: QList<QTextOption::Tab>();return QList<QTextOption::Tab>();never executed: return QList<QTextOption::Tab>(); | 0 | ||||||
| 152 | return never executed: d->tabStops;return d->tabStops;never executed: return d->tabStops; | 0 | ||||||
| 153 | } | - | ||||||
| 154 | - | |||||||
| Switch to Source code | Preprocessed file |