qtextedit.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/widgets/widgets/qtextedit.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13static inline bool shouldEnableInputMethod(QTextEdit *textedit)-
14{-
15 return
never executed: return !textedit->isReadOnly();
!textedit->isReadOnly();
never executed: return !textedit->isReadOnly();
0
16}-
17-
18class QTextEditControl : public QWidgetTextControl-
19{-
20public:-
21 inline QTextEditControl(QObject *parent) : QWidgetTextControl(parent) {}
never executed: end of block
0
22-
23 virtual QMimeData *createMimeDataFromSelection() const override {-
24 QTextEdit *ed = qobject_cast<QTextEdit *>(parent());-
25 if (!ed
!edDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
26 return
never executed: return QWidgetTextControl::createMimeDataFromSelection();
QWidgetTextControl::createMimeDataFromSelection();
never executed: return QWidgetTextControl::createMimeDataFromSelection();
0
27 return
never executed: return ed->createMimeDataFromSelection();
ed->createMimeDataFromSelection();
never executed: return ed->createMimeDataFromSelection();
0
28 }-
29 virtual bool canInsertFromMimeData(const QMimeData *source) const override {-
30 QTextEdit *ed = qobject_cast<QTextEdit *>(parent());-
31 if (!ed
!edDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
32 return
never executed: return QWidgetTextControl::canInsertFromMimeData(source);
QWidgetTextControl::canInsertFromMimeData(source);
never executed: return QWidgetTextControl::canInsertFromMimeData(source);
0
33 return
never executed: return ed->canInsertFromMimeData(source);
ed->canInsertFromMimeData(source);
never executed: return ed->canInsertFromMimeData(source);
0
34 }-
35 virtual void insertFromMimeData(const QMimeData *source) override {-
36 QTextEdit *ed = qobject_cast<QTextEdit *>(parent());-
37 if (!ed
!edDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
38 QWidgetTextControl::insertFromMimeData(source);
never executed: QWidgetTextControl::insertFromMimeData(source);
0
39 else-
40 ed->insertFromMimeData(source);
never executed: ed->insertFromMimeData(source);
0
41 }-
42};-
43-
44QTextEditPrivate::QTextEditPrivate()-
45 : control(0),-
46 autoFormatting(QTextEdit::AutoNone), tabChangesFocus(false),-
47 lineWrap(QTextEdit::WidgetWidth), lineWrapColumnOrWidth(0),-
48 wordWrap(QTextOption::WrapAtWordBoundaryOrAnywhere), clickCausedFocus(0),-
49 textFormat(Qt::AutoText)-
50{-
51 ignoreAutomaticScrollbarAdjustment = false;-
52 preferRichText = false;-
53 showCursorOnInitialShow = true;-
54 inDrag = false;-
55}
never executed: end of block
0
56-
57void QTextEditPrivate::createAutoBulletList()-
58{-
59 QTextCursor cursor = control->textCursor();-
60 cursor.beginEditBlock();-
61-
62 QTextBlockFormat blockFmt = cursor.blockFormat();-
63-
64 QTextListFormat listFmt;-
65 listFmt.setStyle(QTextListFormat::ListDisc);-
66 listFmt.setIndent(blockFmt.indent() + 1);-
67-
68 blockFmt.setIndent(0);-
69 cursor.setBlockFormat(blockFmt);-
70-
71 cursor.createList(listFmt);-
72-
73 cursor.endEditBlock();-
74 control->setTextCursor(cursor);-
75}
never executed: end of block
0
76-
77void QTextEditPrivate::init(const QString &html)-
78{-
79 QTextEdit * const q = q_func();-
80 control = new QTextEditControl(q);-
81 control->setPalette(q->palette());-
82-
83 QObject::connect(control, qFlagLocation("2""microFocusChanged()" "\0" __FILE__ ":" "146"), q, qFlagLocation("1""updateMicroFocus()" "\0" __FILE__ ":" "146"));-
84 QObject::connect(control, qFlagLocation("2""documentSizeChanged(QSizeF)" "\0" __FILE__ ":" "147"), q, qFlagLocation("1""_q_adjustScrollbars()" "\0" __FILE__ ":" "147"));-
85 QObject::connect(control, qFlagLocation("2""updateRequest(QRectF)" "\0" __FILE__ ":" "148"), q, qFlagLocation("1""_q_repaintContents(QRectF)" "\0" __FILE__ ":" "148"));-
86 QObject::connect(control, qFlagLocation("2""visibilityRequest(QRectF)" "\0" __FILE__ ":" "149"), q, qFlagLocation("1""_q_ensureVisible(QRectF)" "\0" __FILE__ ":" "149"));-
87 QObject::connect(control, qFlagLocation("2""currentCharFormatChanged(QTextCharFormat)" "\0" __FILE__ ":" "150"),-
88 q, qFlagLocation("1""_q_currentCharFormatChanged(QTextCharFormat)" "\0" __FILE__ ":" "151"));-
89-
90 QObject::connect(control, qFlagLocation("2""textChanged()" "\0" __FILE__ ":" "153"), q, qFlagLocation("2""textChanged()" "\0" __FILE__ ":" "153"));-
91 QObject::connect(control, qFlagLocation("2""undoAvailable(bool)" "\0" __FILE__ ":" "154"), q, qFlagLocation("2""undoAvailable(bool)" "\0" __FILE__ ":" "154"));-
92 QObject::connect(control, qFlagLocation("2""redoAvailable(bool)" "\0" __FILE__ ":" "155"), q, qFlagLocation("2""redoAvailable(bool)" "\0" __FILE__ ":" "155"));-
93 QObject::connect(control, qFlagLocation("2""copyAvailable(bool)" "\0" __FILE__ ":" "156"), q, qFlagLocation("2""copyAvailable(bool)" "\0" __FILE__ ":" "156"));-
94 QObject::connect(control, qFlagLocation("2""selectionChanged()" "\0" __FILE__ ":" "157"), q, qFlagLocation("2""selectionChanged()" "\0" __FILE__ ":" "157"));-
95 QObject::connect(control, qFlagLocation("2""cursorPositionChanged()" "\0" __FILE__ ":" "158"), q, qFlagLocation("1""_q_cursorPositionChanged()" "\0" __FILE__ ":" "158"));-
96-
97 QObject::connect(control, qFlagLocation("2""textChanged()" "\0" __FILE__ ":" "160"), q, qFlagLocation("1""updateMicroFocus()" "\0" __FILE__ ":" "160"));-
98-
99 QTextDocument *doc = control->document();-
100-
101-
102-
103 doc->setPageSize(QSize(0, 0));-
104 doc->documentLayout()->setPaintDevice(viewport);-
105 doc->setDefaultFont(q->font());-
106 doc->setUndoRedoEnabled(false);-
107 doc->setUndoRedoEnabled(true);-
108-
109 if (!html.isEmpty()
!html.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
110 control->setHtml(html);
never executed: control->setHtml(html);
0
111-
112 hbar->setSingleStep(20);-
113 vbar->setSingleStep(20);-
114-
115 viewport->setBackgroundRole(QPalette::Base);-
116 q->setAcceptDrops(true);-
117 q->setFocusPolicy(Qt::StrongFocus);-
118 q->setAttribute(Qt::WA_KeyCompression);-
119 q->setAttribute(Qt::WA_InputMethodEnabled);-
120 q->setInputMethodHints(Qt::ImhMultiLine);-
121-
122 viewport->setCursor(Qt::IBeamCursor);-
123-
124-
125-
126-
127}
never executed: end of block
0
128-
129void QTextEditPrivate::_q_repaintContents(const QRectF &contentsRect)-
130{-
131 if (!contentsRect.isValid()
!contentsRect.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
132 viewport->update();-
133 return;
never executed: return;
0
134 }-
135 const int xOffset = horizontalOffset();-
136 const int yOffset = verticalOffset();-
137 const QRectF visibleRect(xOffset, yOffset, viewport->width(), viewport->height());-
138-
139 QRect r = contentsRect.intersected(visibleRect).toAlignedRect();-
140 if (r.isEmpty()
r.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
141 return;
never executed: return;
0
142-
143 r.translate(-xOffset, -yOffset);-
144 viewport->update(r);-
145}
never executed: end of block
0
146-
147void QTextEditPrivate::_q_cursorPositionChanged()-
148{-
149 QTextEdit * const q = q_func();-
150 q->cursorPositionChanged();-
151-
152 QAccessibleTextCursorEvent event(q, q->textCursor().position());-
153 QAccessible::updateAccessibility(&event);-
154-
155}
never executed: end of block
0
156-
157void QTextEditPrivate::pageUpDown(QTextCursor::MoveOperation op, QTextCursor::MoveMode moveMode)-
158{-
159 QTextCursor cursor = control->textCursor();-
160 bool moved = false;-
161 qreal lastY = control->cursorRect(cursor).top();-
162 qreal distance = 0;-
163-
164 do {-
165 qreal y = control->cursorRect(cursor).top();-
166 distance += qAbs(y - lastY);-
167 lastY = y;-
168 moved = cursor.movePosition(op, moveMode);-
169 }
never executed: end of block
while (moved
movedDescription
TRUEnever evaluated
FALSEnever evaluated
&& distance < viewport->height()
distance < viewport->height()Description
TRUEnever evaluated
FALSEnever evaluated
);
0
170-
171 if (moved
movedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
172 if (op == QTextCursor::Up
op == QTextCursor::UpDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
173 cursor.movePosition(QTextCursor::Down, moveMode);-
174 vbar->triggerAction(QAbstractSlider::SliderPageStepSub);-
175 }
never executed: end of block
else {
0
176 cursor.movePosition(QTextCursor::Up, moveMode);-
177 vbar->triggerAction(QAbstractSlider::SliderPageStepAdd);-
178 }
never executed: end of block
0
179 }-
180 control->setTextCursor(cursor);-
181}
never executed: end of block
0
182-
183-
184static QSize documentSize(QWidgetTextControl *control)-
185{-
186 QTextDocument *doc = control->document();-
187 QAbstractTextDocumentLayout *layout = doc->documentLayout();-
188-
189 QSize docSize;-
190-
191 if (QTextDocumentLayout *tlayout = qobject_cast<QTextDocumentLayout *>(layout)
QTextDocumentL...out *>(layout)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
192 docSize = tlayout->dynamicDocumentSize().toSize();-
193 int percentageDone = tlayout->layoutStatus();-
194-
195 if (percentageDone > 0
percentageDone > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
196 docSize.setHeight(docSize.height() * 100 / percentageDone);
never executed: docSize.setHeight(docSize.height() * 100 / percentageDone);
0
197 }
never executed: end of block
else {
0
198 docSize = layout->documentSize().toSize();-
199 }
never executed: end of block
0
200-
201 return
never executed: return docSize;
docSize;
never executed: return docSize;
0
202}-
203-
204void QTextEditPrivate::_q_adjustScrollbars()-
205{-
206 if (ignoreAutomaticScrollbarAdjustment
ignoreAutomati...lbarAdjustmentDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
207 return;
never executed: return;
0
208 ignoreAutomaticScrollbarAdjustment = true;-
209-
210 QSize viewportSize = viewport->size();-
211 QSize docSize = documentSize(control);-
212-
213-
214-
215-
216-
217-
218-
219 for (int i = 0; i < 4
i < 4Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
220 hbar->setRange(0, docSize.width() - viewportSize.width());-
221 hbar->setPageStep(viewportSize.width());-
222-
223 vbar->setRange(0, docSize.height() - viewportSize.height());-
224 vbar->setPageStep(viewportSize.height());-
225-
226-
227-
228-
229-
230-
231-
232 if (q_func()->isRightToLeft()
q_func()->isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
233 viewport->update();
never executed: viewport->update();
0
234-
235 _q_showOrHideScrollBars();-
236-
237 const QSize oldViewportSize = viewportSize;-
238 const QSize oldDocSize = docSize;-
239-
240-
241 viewportSize = viewport->size();-
242 if (viewportSize.width() != oldViewportSize.width()
viewportSize.w...rtSize.width()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
243 relayoutDocument();
never executed: relayoutDocument();
0
244-
245 docSize = documentSize(control);-
246 if (viewportSize == oldViewportSize
viewportSize =...ldViewportSizeDescription
TRUEnever evaluated
FALSEnever evaluated
&& docSize == oldDocSize
docSize == oldDocSizeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
247 break;
never executed: break;
0
248 }
never executed: end of block
0
249 ignoreAutomaticScrollbarAdjustment = false;-
250}
never executed: end of block
0
251-
252-
253-
254void QTextEditPrivate::_q_ensureVisible(const QRectF &_rect)-
255{-
256 const QRect rect = _rect.toRect();-
257 if ((vbar->isVisible()
vbar->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
&& vbar->maximum() < rect.bottom()
vbar->maximum(... rect.bottom()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
258 || (hbar->isVisible()
hbar->isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
&& hbar->maximum() < rect.right()
hbar->maximum() < rect.right()Description
TRUEnever evaluated
FALSEnever evaluated
))
0
259 _q_adjustScrollbars();
never executed: _q_adjustScrollbars();
0
260 const int visibleWidth = viewport->width();-
261 const int visibleHeight = viewport->height();-
262 const bool rtl = q_func()->isRightToLeft();-
263-
264 if (rect.x() < horizontalOffset()
rect.x() < horizontalOffset()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
265 if (rtl
rtlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
266 hbar->setValue(hbar->maximum() - rect.x());
never executed: hbar->setValue(hbar->maximum() - rect.x());
0
267 else-
268 hbar->setValue(rect.x());
never executed: hbar->setValue(rect.x());
0
269 } else if (rect.x() + rect.width() > horizontalOffset() + visibleWidth
rect.x() + rec...+ visibleWidthDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
270 if (rtl
rtlDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
271 hbar->setValue(hbar->maximum() - (rect.x() + rect.width() - visibleWidth));
never executed: hbar->setValue(hbar->maximum() - (rect.x() + rect.width() - visibleWidth));
0
272 else-
273 hbar->setValue(rect.x() + rect.width() - visibleWidth);
never executed: hbar->setValue(rect.x() + rect.width() - visibleWidth);
0
274 }-
275-
276 if (rect.y() < verticalOffset()
rect.y() < verticalOffset()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
277 vbar->setValue(rect.y());
never executed: vbar->setValue(rect.y());
0
278 else if (rect.y() + rect.height() > verticalOffset() + visibleHeight
rect.y() + rec... visibleHeightDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
279 vbar->setValue(rect.y() + rect.height() - visibleHeight);
never executed: vbar->setValue(rect.y() + rect.height() - visibleHeight);
0
280}
never executed: end of block
0
281QTextEdit::QTextEdit(QWidget *parent)-
282 : QAbstractScrollArea(*new QTextEditPrivate, parent)-
283{-
284 QTextEditPrivate * const d = d_func();-
285 d->init();-
286}
never executed: end of block
0
287-
288-
289-
290-
291QTextEdit::QTextEdit(QTextEditPrivate &dd, QWidget *parent)-
292 : QAbstractScrollArea(dd, parent)-
293{-
294 QTextEditPrivate * const d = d_func();-
295 d->init();-
296}
never executed: end of block
0
297-
298-
299-
300-
301-
302QTextEdit::QTextEdit(const QString &text, QWidget *parent)-
303 : QAbstractScrollArea(*new QTextEditPrivate, parent)-
304{-
305 QTextEditPrivate * const d = d_func();-
306 d->init(text);-
307}
never executed: end of block
0
308-
309-
310-
311-
312-
313-
314QTextEdit::~QTextEdit()-
315{-
316}-
317-
318-
319-
320-
321-
322-
323qreal QTextEdit::fontPointSize() const-
324{-
325 const QTextEditPrivate * const d = d_func();-
326 return
never executed: return d->control->textCursor().charFormat().fontPointSize();
d->control->textCursor().charFormat().fontPointSize();
never executed: return d->control->textCursor().charFormat().fontPointSize();
0
327}-
328-
329-
330-
331-
332-
333-
334QString QTextEdit::fontFamily() const-
335{-
336 const QTextEditPrivate * const d = d_func();-
337 return
never executed: return d->control->textCursor().charFormat().fontFamily();
d->control->textCursor().charFormat().fontFamily();
never executed: return d->control->textCursor().charFormat().fontFamily();
0
338}-
339-
340-
341-
342-
343-
344-
345int QTextEdit::fontWeight() const-
346{-
347 const QTextEditPrivate * const d = d_func();-
348 return
never executed: return d->control->textCursor().charFormat().fontWeight();
d->control->textCursor().charFormat().fontWeight();
never executed: return d->control->textCursor().charFormat().fontWeight();
0
349}-
350-
351-
352-
353-
354-
355-
356-
357bool QTextEdit::fontUnderline() const-
358{-
359 const QTextEditPrivate * const d = d_func();-
360 return
never executed: return d->control->textCursor().charFormat().fontUnderline();
d->control->textCursor().charFormat().fontUnderline();
never executed: return d->control->textCursor().charFormat().fontUnderline();
0
361}-
362-
363-
364-
365-
366-
367-
368-
369bool QTextEdit::fontItalic() const-
370{-
371 const QTextEditPrivate * const d = d_func();-
372 return
never executed: return d->control->textCursor().charFormat().fontItalic();
d->control->textCursor().charFormat().fontItalic();
never executed: return d->control->textCursor().charFormat().fontItalic();
0
373}-
374-
375-
376-
377-
378-
379-
380QColor QTextEdit::textColor() const-
381{-
382 const QTextEditPrivate * const d = d_func();-
383 return
never executed: return d->control->textCursor().charFormat().foreground().color();
d->control->textCursor().charFormat().foreground().color();
never executed: return d->control->textCursor().charFormat().foreground().color();
0
384}-
385QColor QTextEdit::textBackgroundColor() const-
386{-
387 const QTextEditPrivate * const d = d_func();-
388 return
never executed: return d->control->textCursor().charFormat().background().color();
d->control->textCursor().charFormat().background().color();
never executed: return d->control->textCursor().charFormat().background().color();
0
389}-
390-
391-
392-
393-
394-
395-
396QFont QTextEdit::currentFont() const-
397{-
398 const QTextEditPrivate * const d = d_func();-
399 return
never executed: return d->control->textCursor().charFormat().font();
d->control->textCursor().charFormat().font();
never executed: return d->control->textCursor().charFormat().font();
0
400}-
401-
402-
403-
404-
405-
406-
407-
408void QTextEdit::setAlignment(Qt::Alignment a)-
409{-
410 QTextEditPrivate * const d = d_func();-
411 QTextBlockFormat fmt;-
412 fmt.setAlignment(a);-
413 QTextCursor cursor = d->control->textCursor();-
414 cursor.mergeBlockFormat(fmt);-
415 d->control->setTextCursor(cursor);-
416}
never executed: end of block
0
417-
418-
419-
420-
421-
422-
423Qt::Alignment QTextEdit::alignment() const-
424{-
425 const QTextEditPrivate * const d = d_func();-
426 return
never executed: return d->control->textCursor().blockFormat().alignment();
d->control->textCursor().blockFormat().alignment();
never executed: return d->control->textCursor().blockFormat().alignment();
0
427}-
428void QTextEdit::setDocument(QTextDocument *document)-
429{-
430 QTextEditPrivate * const d = d_func();-
431 d->control->setDocument(document);-
432 d->updateDefaultTextOption();-
433 d->relayoutDocument();-
434}
never executed: end of block
0
435-
436QTextDocument *QTextEdit::document() const-
437{-
438 const QTextEditPrivate * const d = d_func();-
439 return
never executed: return d->control->document();
d->control->document();
never executed: return d->control->document();
0
440}-
441QString QTextEdit::placeholderText() const-
442{-
443 const QTextEditPrivate * const d = d_func();-
444 return
never executed: return d->placeholderText;
d->placeholderText;
never executed: return d->placeholderText;
0
445}-
446-
447void QTextEdit::setPlaceholderText(const QString &placeholderText)-
448{-
449 QTextEditPrivate * const d = d_func();-
450 if (d->placeholderText != placeholderText
d->placeholder...laceholderTextDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
451 d->placeholderText = placeholderText;-
452 if (d->control->document()->isEmpty()
d->control->do...t()->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
453 d->viewport->update();
never executed: d->viewport->update();
0
454 }
never executed: end of block
0
455}
never executed: end of block
0
456-
457-
458-
459-
460void QTextEdit::setTextCursor(const QTextCursor &cursor)-
461{-
462 doSetTextCursor(cursor);-
463}
never executed: end of block
0
464-
465-
466-
467-
468-
469-
470-
471void QTextEdit::doSetTextCursor(const QTextCursor &cursor)-
472{-
473 QTextEditPrivate * const d = d_func();-
474 d->control->setTextCursor(cursor);-
475}
never executed: end of block
0
476-
477-
478-
479-
480-
481-
482QTextCursor QTextEdit::textCursor() const-
483{-
484 const QTextEditPrivate * const d = d_func();-
485 return
never executed: return d->control->textCursor();
d->control->textCursor();
never executed: return d->control->textCursor();
0
486}-
487-
488-
489-
490-
491-
492-
493void QTextEdit::setFontFamily(const QString &fontFamily)-
494{-
495 QTextCharFormat fmt;-
496 fmt.setFontFamily(fontFamily);-
497 mergeCurrentCharFormat(fmt);-
498}
never executed: end of block
0
499void QTextEdit::setFontPointSize(qreal s)-
500{-
501 QTextCharFormat fmt;-
502 fmt.setFontPointSize(s);-
503 mergeCurrentCharFormat(fmt);-
504}
never executed: end of block
0
505void QTextEdit::setFontWeight(int w)-
506{-
507 QTextCharFormat fmt;-
508 fmt.setFontWeight(w);-
509 mergeCurrentCharFormat(fmt);-
510}
never executed: end of block
0
511-
512-
513-
514-
515-
516-
517-
518void QTextEdit::setFontUnderline(bool underline)-
519{-
520 QTextCharFormat fmt;-
521 fmt.setFontUnderline(underline);-
522 mergeCurrentCharFormat(fmt);-
523}
never executed: end of block
0
524-
525-
526-
527-
528-
529-
530-
531void QTextEdit::setFontItalic(bool italic)-
532{-
533 QTextCharFormat fmt;-
534 fmt.setFontItalic(italic);-
535 mergeCurrentCharFormat(fmt);-
536}
never executed: end of block
0
537-
538-
539-
540-
541-
542-
543void QTextEdit::setTextColor(const QColor &c)-
544{-
545 QTextCharFormat fmt;-
546 fmt.setForeground(QBrush(c));-
547 mergeCurrentCharFormat(fmt);-
548}
never executed: end of block
0
549void QTextEdit::setTextBackgroundColor(const QColor &c)-
550{-
551 QTextCharFormat fmt;-
552 fmt.setBackground(QBrush(c));-
553 mergeCurrentCharFormat(fmt);-
554}
never executed: end of block
0
555-
556-
557-
558-
559-
560-
561void QTextEdit::setCurrentFont(const QFont &f)-
562{-
563 QTextCharFormat fmt;-
564 fmt.setFont(f);-
565 mergeCurrentCharFormat(fmt);-
566}
never executed: end of block
0
567void QTextEdit::undo()-
568{-
569 QTextEditPrivate * const d = d_func();-
570 d->control->undo();-
571}
never executed: end of block
0
572-
573void QTextEdit::redo()-
574{-
575 QTextEditPrivate * const d = d_func();-
576 d->control->redo();-
577}
never executed: end of block
0
578void QTextEdit::cut()-
579{-
580 QTextEditPrivate * const d = d_func();-
581 d->control->cut();-
582}
never executed: end of block
0
583-
584-
585-
586-
587-
588-
589-
590void QTextEdit::copy()-
591{-
592 QTextEditPrivate * const d = d_func();-
593 d->control->copy();-
594}
never executed: end of block
0
595void QTextEdit::paste()-
596{-
597 QTextEditPrivate * const d = d_func();-
598 d->control->paste();-
599}
never executed: end of block
0
600void QTextEdit::clear()-
601{-
602 QTextEditPrivate * const d = d_func();-
603-
604 d->control->clear();-
605}
never executed: end of block
0
606-
607-
608-
609-
610-
611-
612-
613void QTextEdit::selectAll()-
614{-
615 QTextEditPrivate * const d = d_func();-
616 d->control->selectAll();-
617}
never executed: end of block
0
618-
619-
620-
621bool QTextEdit::event(QEvent *e)-
622{-
623 QTextEditPrivate * const d = d_func();-
624-
625 if (e->type() == QEvent::ContextMenu
e->type() == Q...t::ContextMenuDescription
TRUEnever evaluated
FALSEnever evaluated
0
626 && static_cast<
static_cast<QC...vent::KeyboardDescription
TRUEnever evaluated
FALSEnever evaluated
QContextMenuEvent *>(e)->reason() == QContextMenuEvent::Keyboard
static_cast<QC...vent::KeyboardDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
627 QTextEditPrivate * const d = d_func();-
628 ensureCursorVisible();-
629 const QPoint cursorPos = cursorRect().center();-
630 QContextMenuEvent ce(QContextMenuEvent::Keyboard, cursorPos, d->viewport->mapToGlobal(cursorPos));-
631 ce.setAccepted(e->isAccepted());-
632 const bool result = QAbstractScrollArea::event(&ce);-
633 e->setAccepted(ce.isAccepted());-
634 return
never executed: return result;
result;
never executed: return result;
0
635 } else if (e->type() == QEvent::ShortcutOverride
e->type() == Q...ortcutOverrideDescription
TRUEnever evaluated
FALSEnever evaluated
0
636 || e->type() == QEvent::ToolTip
e->type() == QEvent::ToolTipDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
637 d->sendControlEvent(e);-
638 }
never executed: end of block
0
639 return
never executed: return QAbstractScrollArea::event(e);
QAbstractScrollArea::event(e);
never executed: return QAbstractScrollArea::event(e);
0
640}-
641-
642-
643-
644-
645void QTextEdit::timerEvent(QTimerEvent *e)-
646{-
647 QTextEditPrivate * const d = d_func();-
648 if (e->timerId() == d->autoScrollTimer.timerId()
e->timerId() =...imer.timerId()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
649 QRect visible = d->viewport->rect();-
650 QPoint pos;-
651 if (d->inDrag
d->inDragDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
652 pos = d->autoScrollDragPos;-
653 visible.adjust(qMin(visible.width()/3,20), qMin(visible.height()/3,20),-
654 -qMin(visible.width()/3,20), -qMin(visible.height()/3,20));-
655 }
never executed: end of block
else {
0
656 const QPoint globalPos = QCursor::pos();-
657 pos = d->viewport->mapFromGlobal(globalPos);-
658 QMouseEvent ev(QEvent::MouseMove, pos, mapTo(topLevelWidget(), pos), globalPos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);-
659 mouseMoveEvent(&ev);-
660 }
never executed: end of block
0
661 int deltaY = qMax(pos.y() - visible.top(), visible.bottom() - pos.y()) - visible.height();-
662 int deltaX = qMax(pos.x() - visible.left(), visible.right() - pos.x()) - visible.width();-
663 int delta = qMax(deltaX, deltaY);-
664 if (delta >= 0
delta >= 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
665 if (delta < 7
delta < 7Description
TRUEnever evaluated
FALSEnever evaluated
)
0
666 delta = 7;
never executed: delta = 7;
0
667 int timeout = 4900 / (delta * delta);-
668 d->autoScrollTimer.start(timeout, this);-
669-
670 if (deltaY > 0
deltaY > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
671 d->vbar->triggerAction(pos.y() < visible.center().y() ?
never executed: d->vbar->triggerAction(pos.y() < visible.center().y() ? QAbstractSlider::SliderSingleStepSub : QAbstractSlider::SliderSingleStepAdd);
0
672 QAbstractSlider::SliderSingleStepSub
never executed: d->vbar->triggerAction(pos.y() < visible.center().y() ? QAbstractSlider::SliderSingleStepSub : QAbstractSlider::SliderSingleStepAdd);
0
673 : QAbstractSlider::SliderSingleStepAdd);
never executed: d->vbar->triggerAction(pos.y() < visible.center().y() ? QAbstractSlider::SliderSingleStepSub : QAbstractSlider::SliderSingleStepAdd);
0
674 if (deltaX > 0
deltaX > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
675 d->hbar->triggerAction(pos.x() < visible.center().x() ?
never executed: d->hbar->triggerAction(pos.x() < visible.center().x() ? QAbstractSlider::SliderSingleStepSub : QAbstractSlider::SliderSingleStepAdd);
0
676 QAbstractSlider::SliderSingleStepSub
never executed: d->hbar->triggerAction(pos.x() < visible.center().x() ? QAbstractSlider::SliderSingleStepSub : QAbstractSlider::SliderSingleStepAdd);
0
677 : QAbstractSlider::SliderSingleStepAdd);
never executed: d->hbar->triggerAction(pos.x() < visible.center().x() ? QAbstractSlider::SliderSingleStepSub : QAbstractSlider::SliderSingleStepAdd);
0
678 }
never executed: end of block
0
679 }
never executed: end of block
0
680-
681-
682-
683-
684-
685-
686}
never executed: end of block
0
687void QTextEdit::setPlainText(const QString &text)-
688{-
689 QTextEditPrivate * const d = d_func();-
690 d->control->setPlainText(text);-
691 d->preferRichText = false;-
692}
never executed: end of block
0
693QString QTextEdit::toPlainText() const-
694{-
695 const QTextEditPrivate * const d = d_func();-
696 return
never executed: return d->control->toPlainText();
d->control->toPlainText();
never executed: return d->control->toPlainText();
0
697}-
698void QTextEdit::setHtml(const QString &text)-
699{-
700 QTextEditPrivate * const d = d_func();-
701 d->control->setHtml(text);-
702 d->preferRichText = true;-
703}
never executed: end of block
0
704-
705QString QTextEdit::toHtml() const-
706{-
707 const QTextEditPrivate * const d = d_func();-
708 return
never executed: return d->control->toHtml();
d->control->toHtml();
never executed: return d->control->toHtml();
0
709}-
710-
711-
712-
713-
714-
715void QTextEdit::keyPressEvent(QKeyEvent *e)-
716{-
717 QTextEditPrivate * const d = d_func();-
718 Qt::TextInteractionFlags tif = d->control->textInteractionFlags();-
719-
720 if (tif & Qt::TextSelectableByKeyboard
tif & Qt::Text...ableByKeyboardDescription
TRUEnever evaluated
FALSEnever evaluated
){
0
721 if (e == QKeySequence::SelectPreviousPage
e == QKeySeque...ctPreviousPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
722 e->accept();-
723 d->pageUpDown(QTextCursor::Up, QTextCursor::KeepAnchor);-
724 return;
never executed: return;
0
725 } else if (e ==QKeySequence::SelectNextPage
e ==QKeySequen...SelectNextPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
726 e->accept();-
727 d->pageUpDown(QTextCursor::Down, QTextCursor::KeepAnchor);-
728 return;
never executed: return;
0
729 }-
730 }
never executed: end of block
0
731 if (tif & (Qt::TextSelectableByKeyboard | Qt::TextEditable)
tif & (Qt::Tex...:TextEditable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
732 if (e == QKeySequence::MoveToPreviousPage
e == QKeySeque...ToPreviousPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
733 e->accept();-
734 d->pageUpDown(QTextCursor::Up, QTextCursor::MoveAnchor);-
735 return;
never executed: return;
0
736 } else if (e == QKeySequence::MoveToNextPage
e == QKeySeque...MoveToNextPageDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
737 e->accept();-
738 d->pageUpDown(QTextCursor::Down, QTextCursor::MoveAnchor);-
739 return;
never executed: return;
0
740 }-
741 }
never executed: end of block
0
742-
743 if (!(tif & Qt::TextEditable)
!(tif & Qt::TextEditable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
744 switch (e->key()) {-
745 case
never executed: case Qt::Key_Space:
Qt::Key_Space:
never executed: case Qt::Key_Space:
0
746 e->accept();-
747 if (e->modifiers() & Qt::ShiftModifier
e->modifiers()...:ShiftModifierDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
748 d->vbar->triggerAction(QAbstractSlider::SliderPageStepSub);
never executed: d->vbar->triggerAction(QAbstractSlider::SliderPageStepSub);
0
749 else-
750 d->vbar->triggerAction(QAbstractSlider::SliderPageStepAdd);
never executed: d->vbar->triggerAction(QAbstractSlider::SliderPageStepAdd);
0
751 break;
never executed: break;
0
752 default
never executed: default:
:
never executed: default:
0
753 d->sendControlEvent(e);-
754 if (!e->isAccepted()
!e->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
&& e->modifiers() == Qt::NoModifier
e->modifiers()...Qt::NoModifierDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
755 if (e->key() == Qt::Key_Home
e->key() == Qt::Key_HomeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
756 d->vbar->triggerAction(QAbstractSlider::SliderToMinimum);-
757 e->accept();-
758 }
never executed: end of block
else if (e->key() == Qt::Key_End
e->key() == Qt::Key_EndDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
759 d->vbar->triggerAction(QAbstractSlider::SliderToMaximum);-
760 e->accept();-
761 }
never executed: end of block
0
762 }
never executed: end of block
0
763 if (!e->isAccepted()
!e->isAccepted()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
764 QAbstractScrollArea::keyPressEvent(e);-
765 }
never executed: end of block
0
766 }
never executed: end of block
0
767 return;
never executed: return;
0
768 }-
769-
770-
771 {-
772 QTextCursor cursor = d->control->textCursor();-
773 const QString text = e->text();-
774 if (cursor.atBlockStart()
cursor.atBlockStart()Description
TRUEnever evaluated
FALSEnever evaluated
0
775 && (
(d->autoFormat...utoBulletList)Description
TRUEnever evaluated
FALSEnever evaluated
d->autoFormatting & AutoBulletList)
(d->autoFormat...utoBulletList)Description
TRUEnever evaluated
FALSEnever evaluated
0
776 && (
(text.length() == 1)Description
TRUEnever evaluated
FALSEnever evaluated
text.length() == 1)
(text.length() == 1)Description
TRUEnever evaluated
FALSEnever evaluated
0
777 && (text.at(0) == QLatin1Char('-')
text.at(0) == QLatin1Char('-')Description
TRUEnever evaluated
FALSEnever evaluated
|| text.at(0) == QLatin1Char('*')
text.at(0) == QLatin1Char('*')Description
TRUEnever evaluated
FALSEnever evaluated
)
0
778 && (
(!cursor.currentList())Description
TRUEnever evaluated
FALSEnever evaluated
!cursor.currentList())
(!cursor.currentList())Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
779-
780 d->createAutoBulletList();-
781 e->accept();-
782 return;
never executed: return;
0
783 }-
784 }-
785-
786 d->sendControlEvent(e);-
787}
never executed: end of block
0
788-
789-
790-
791void QTextEdit::keyReleaseEvent(QKeyEvent *e)-
792{-
793 e->ignore();-
794}
never executed: end of block
0
795QVariant QTextEdit::loadResource(int type, const QUrl &name)-
796{-
797 (void)type;;-
798 (void)name;;-
799 return
never executed: return QVariant();
QVariant();
never executed: return QVariant();
0
800}-
801-
802-
803-
804void QTextEdit::resizeEvent(QResizeEvent *e)-
805{-
806 QTextEditPrivate * const d = d_func();-
807-
808 if (d->lineWrap == NoWrap
d->lineWrap == NoWrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
809 QTextDocument *doc = d->control->document();-
810 QVariant alignmentProperty = doc->documentLayout()->property("contentHasAlignment");-
811-
812 if (!doc->pageSize().isNull()
!doc->pageSize().isNull()Description
TRUEnever evaluated
FALSEnever evaluated
0
813 && alignmentProperty.type() == QVariant::Bool
alignmentPrope...QVariant::BoolDescription
TRUEnever evaluated
FALSEnever evaluated
0
814 && !alignmentProperty.toBool()
!alignmentProperty.toBool()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
815-
816 d->_q_adjustScrollbars();-
817 return;
never executed: return;
0
818 }-
819 }
never executed: end of block
0
820-
821 if (d->lineWrap != FixedPixelWidth
d->lineWrap != FixedPixelWidthDescription
TRUEnever evaluated
FALSEnever evaluated
0
822 && e->oldSize().width() != e->size().width()
e->oldSize().w...size().width()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
823 d->relayoutDocument();
never executed: d->relayoutDocument();
0
824 else-
825 d->_q_adjustScrollbars();
never executed: d->_q_adjustScrollbars();
0
826}-
827-
828void QTextEditPrivate::relayoutDocument()-
829{-
830 QTextDocument *doc = control->document();-
831 QAbstractTextDocumentLayout *layout = doc->documentLayout();-
832-
833 if (QTextDocumentLayout *tlayout = qobject_cast<QTextDocumentLayout *>(layout)
QTextDocumentL...out *>(layout)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
834 if (lineWrap == QTextEdit::FixedColumnWidth
lineWrap == QT...xedColumnWidthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
835 tlayout->setFixedColumnWidth(lineWrapColumnOrWidth);
never executed: tlayout->setFixedColumnWidth(lineWrapColumnOrWidth);
0
836 else-
837 tlayout->setFixedColumnWidth(-1);
never executed: tlayout->setFixedColumnWidth(-1);
0
838 }-
839-
840 QTextDocumentLayout *tlayout = qobject_cast<QTextDocumentLayout *>(layout);-
841 QSize lastUsedSize;-
842 if (tlayout
tlayoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
843 lastUsedSize = tlayout->dynamicDocumentSize().toSize();
never executed: lastUsedSize = tlayout->dynamicDocumentSize().toSize();
0
844 else-
845 lastUsedSize = layout->documentSize().toSize();
never executed: lastUsedSize = layout->documentSize().toSize();
0
846-
847-
848-
849-
850 const bool oldIgnoreScrollbarAdjustment = ignoreAutomaticScrollbarAdjustment;-
851 ignoreAutomaticScrollbarAdjustment = true;-
852-
853 int width = viewport->width();-
854 if (lineWrap == QTextEdit::FixedPixelWidth
lineWrap == QT...ixedPixelWidthDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
855 width = lineWrapColumnOrWidth;
never executed: width = lineWrapColumnOrWidth;
0
856 else if (lineWrap == QTextEdit::NoWrap
lineWrap == QTextEdit::NoWrapDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
857 QVariant alignmentProperty = doc->documentLayout()->property("contentHasAlignment");-
858 if (alignmentProperty.type() == QVariant::Bool
alignmentPrope...QVariant::BoolDescription
TRUEnever evaluated
FALSEnever evaluated
&& !alignmentProperty.toBool()
!alignmentProperty.toBool()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
859-
860 width = 0;-
861 }
never executed: end of block
0
862 }
never executed: end of block
0
863-
864 doc->setPageSize(QSize(width, -1));-
865 if (tlayout
tlayoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
866 tlayout->ensureLayouted(verticalOffset() + viewport->height());
never executed: tlayout->ensureLayouted(verticalOffset() + viewport->height());
0
867-
868 ignoreAutomaticScrollbarAdjustment = oldIgnoreScrollbarAdjustment;-
869-
870 QSize usedSize;-
871 if (tlayout
tlayoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
872 usedSize = tlayout->dynamicDocumentSize().toSize();
never executed: usedSize = tlayout->dynamicDocumentSize().toSize();
0
873 else-
874 usedSize = layout->documentSize().toSize();
never executed: usedSize = layout->documentSize().toSize();
0
875 if (lastUsedSize.isValid()
lastUsedSize.isValid()Description
TRUEnever evaluated
FALSEnever evaluated
0
876 && !vbar->isHidden()
!vbar->isHidden()Description
TRUEnever evaluated
FALSEnever evaluated
0
877 && viewport->width() < lastUsedSize.width()
viewport->widt...edSize.width()Description
TRUEnever evaluated
FALSEnever evaluated
0
878 && usedSize.height() < lastUsedSize.height()
usedSize.heigh...dSize.height()Description
TRUEnever evaluated
FALSEnever evaluated
0
879 && usedSize.height() <= viewport->height()
usedSize.heigh...port->height()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
880 return;
never executed: return;
0
881-
882 _q_adjustScrollbars();-
883}
never executed: end of block
0
884-
885void QTextEditPrivate::paint(QPainter *p, QPaintEvent *e)-
886{-
887 const int xOffset = horizontalOffset();-
888 const int yOffset = verticalOffset();-
889-
890 QRect r = e->rect();-
891 p->translate(-xOffset, -yOffset);-
892 r.translate(xOffset, yOffset);-
893-
894 QTextDocument *doc = control->document();-
895 QTextDocumentLayout *layout = qobject_cast<QTextDocumentLayout *>(doc->documentLayout());-
896-
897-
898-
899 if (layout
layoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
900 layout->setViewport(viewport->rect());
never executed: layout->setViewport(viewport->rect());
0
901-
902 control->drawContents(p, r, q_func());-
903-
904 if (layout
layoutDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
905 layout->setViewport(QRect());
never executed: layout->setViewport(QRect());
0
906-
907 if (!placeholderText.isEmpty()
!placeholderText.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& doc->isEmpty()
doc->isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
&& !control->isPreediting()
!control->isPreediting()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
908 QColor col = control->palette().text().color();-
909 col.setAlpha(128);-
910 p->setPen(col);-
911 const int margin = int(doc->documentMargin());-
912 p->drawText(viewport->rect().adjusted(margin, margin, -margin, -margin), Qt::AlignTop | Qt::TextWordWrap, placeholderText);-
913 }
never executed: end of block
0
914}
never executed: end of block
0
915void QTextEdit::paintEvent(QPaintEvent *e)-
916{-
917 QTextEditPrivate * const d = d_func();-
918 QPainter p(d->viewport);-
919 d->paint(&p, e);-
920}
never executed: end of block
0
921-
922void QTextEditPrivate::_q_currentCharFormatChanged(const QTextCharFormat &fmt)-
923{-
924 QTextEdit * const q = q_func();-
925 q->currentCharFormatChanged(fmt);-
926}
never executed: end of block
0
927-
928void QTextEditPrivate::updateDefaultTextOption()-
929{-
930 QTextDocument *doc = control->document();-
931-
932 QTextOption opt = doc->defaultTextOption();-
933 QTextOption::WrapMode oldWrapMode = opt.wrapMode();-
934-
935 if (lineWrap == QTextEdit::NoWrap
lineWrap == QTextEdit::NoWrapDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
936 opt.setWrapMode(QTextOption::NoWrap);
never executed: opt.setWrapMode(QTextOption::NoWrap);
0
937 else-
938 opt.setWrapMode(wordWrap);
never executed: opt.setWrapMode(wordWrap);
0
939-
940 if (opt.wrapMode() != oldWrapMode
opt.wrapMode() != oldWrapModeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
941 doc->setDefaultTextOption(opt);
never executed: doc->setDefaultTextOption(opt);
0
942}
never executed: end of block
0
943-
944-
945-
946void QTextEdit::mousePressEvent(QMouseEvent *e)-
947{-
948 QTextEditPrivate * const d = d_func();-
949-
950-
951-
952-
953 d->sendControlEvent(e);-
954}
never executed: end of block
0
955-
956-
957-
958void QTextEdit::mouseMoveEvent(QMouseEvent *e)-
959{-
960 QTextEditPrivate * const d = d_func();-
961 d->inDrag = false;-
962 const QPoint pos = e->pos();-
963 d->sendControlEvent(e);-
964 if (!(e->buttons() & Qt::LeftButton)
!(e->buttons()...t::LeftButton)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
965 return;
never executed: return;
0
966 if (e->source() == Qt::MouseEventNotSynthesized
e->source() ==...NotSynthesizedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
967 const QRect visible = d->viewport->rect();-
968 if (visible.contains(pos)
visible.contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
969 d->autoScrollTimer.stop();
never executed: d->autoScrollTimer.stop();
0
970 else if (!d->autoScrollTimer.isActive()
!d->autoScrollTimer.isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
971 d->autoScrollTimer.start(100, this);
never executed: d->autoScrollTimer.start(100, this);
0
972 }
never executed: end of block
0
973}
never executed: end of block
0
974-
975-
976-
977void QTextEdit::mouseReleaseEvent(QMouseEvent *e)-
978{-
979 QTextEditPrivate * const d = d_func();-
980 d->sendControlEvent(e);-
981 if (e->source() == Qt::MouseEventNotSynthesized
e->source() ==...NotSynthesizedDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->autoScrollTimer.isActive()
d->autoScrollTimer.isActive()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
982 d->autoScrollTimer.stop();-
983 ensureCursorVisible();-
984 }
never executed: end of block
0
985 if (!isReadOnly()
!isReadOnly()Description
TRUEnever evaluated
FALSEnever evaluated
&& rect().contains(e->pos())
rect().contains(e->pos())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
986 d->handleSoftwareInputPanel(e->button(), d->clickCausedFocus);
never executed: d->handleSoftwareInputPanel(e->button(), d->clickCausedFocus);
0
987 d->clickCausedFocus = 0;-
988}
never executed: end of block
0
989-
990-
991-
992void QTextEdit::mouseDoubleClickEvent(QMouseEvent *e)-
993{-
994 QTextEditPrivate * const d = d_func();-
995 d->sendControlEvent(e);-
996}
never executed: end of block
0
997-
998-
999-
1000bool QTextEdit::focusNextPrevChild(bool next)-
1001{-
1002 const QTextEditPrivate * const d = d_func();-
1003 if (!d->tabChangesFocus
!d->tabChangesFocusDescription
TRUEnever evaluated
FALSEnever evaluated
&& d->control->textInteractionFlags() & Qt::TextEditable
d->control->te...::TextEditableDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1004 return
never executed: return false;
false;
never executed: return false;
0
1005 return
never executed: return QAbstractScrollArea::focusNextPrevChild(next);
QAbstractScrollArea::focusNextPrevChild(next);
never executed: return QAbstractScrollArea::focusNextPrevChild(next);
0
1006}-
1007void QTextEdit::contextMenuEvent(QContextMenuEvent *e)-
1008{-
1009 QTextEditPrivate * const d = d_func();-
1010 d->sendControlEvent(e);-
1011}
never executed: end of block
0
1012-
1013-
1014-
1015-
1016-
1017void QTextEdit::dragEnterEvent(QDragEnterEvent *e)-
1018{-
1019 QTextEditPrivate * const d = d_func();-
1020 d->inDrag = true;-
1021 d->sendControlEvent(e);-
1022}
never executed: end of block
0
1023-
1024-
1025-
1026void QTextEdit::dragLeaveEvent(QDragLeaveEvent *e)-
1027{-
1028 QTextEditPrivate * const d = d_func();-
1029 d->inDrag = false;-
1030 d->autoScrollTimer.stop();-
1031 d->sendControlEvent(e);-
1032}
never executed: end of block
0
1033-
1034-
1035-
1036void QTextEdit::dragMoveEvent(QDragMoveEvent *e)-
1037{-
1038 QTextEditPrivate * const d = d_func();-
1039 d->autoScrollDragPos = e->pos();-
1040 if (!d->autoScrollTimer.isActive()
!d->autoScrollTimer.isActive()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1041 d->autoScrollTimer.start(100, this);
never executed: d->autoScrollTimer.start(100, this);
0
1042 d->sendControlEvent(e);-
1043}
never executed: end of block
0
1044-
1045-
1046-
1047void QTextEdit::dropEvent(QDropEvent *e)-
1048{-
1049 QTextEditPrivate * const d = d_func();-
1050 d->inDrag = false;-
1051 d->autoScrollTimer.stop();-
1052 d->sendControlEvent(e);-
1053}
never executed: end of block
0
1054-
1055-
1056-
1057-
1058-
1059void QTextEdit::inputMethodEvent(QInputMethodEvent *e)-
1060{-
1061 QTextEditPrivate * const d = d_func();-
1062-
1063-
1064-
1065-
1066-
1067-
1068 d->sendControlEvent(e);-
1069 ensureCursorVisible();-
1070}
never executed: end of block
0
1071-
1072-
1073-
1074void QTextEdit::scrollContentsBy(int dx, int dy)-
1075{-
1076 QTextEditPrivate * const d = d_func();-
1077 if (isRightToLeft()
isRightToLeft()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1078 dx = -dx;
never executed: dx = -dx;
0
1079 d->viewport->scroll(dx, dy);-
1080 QGuiApplication::inputMethod()->update(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);-
1081}
never executed: end of block
0
1082-
1083-
1084-
1085QVariant QTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const-
1086{-
1087 return
never executed: return inputMethodQuery(property, QVariant());
inputMethodQuery(property, QVariant());
never executed: return inputMethodQuery(property, QVariant());
0
1088}-
1089-
1090-
1091-
1092QVariant QTextEdit::inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const-
1093{-
1094 const QTextEditPrivate * const d = d_func();-
1095 switch (query) {-
1096 case
never executed: case Qt::ImHints:
Qt::ImHints:
never executed: case Qt::ImHints:
0
1097 case
never executed: case Qt::ImInputItemClipRectangle:
Qt::ImInputItemClipRectangle:
never executed: case Qt::ImInputItemClipRectangle:
0
1098 return
never executed: return QWidget::inputMethodQuery(query);
QWidget::inputMethodQuery(query);
never executed: return QWidget::inputMethodQuery(query);
0
1099 default
never executed: default:
:
never executed: default:
0
1100 break;
never executed: break;
0
1101 }-
1102-
1103 const QPointF offset(-d->horizontalOffset(), -d->verticalOffset());-
1104 switch (argument.type()) {-
1105 case
never executed: case QVariant::RectF:
QVariant::RectF:
never executed: case QVariant::RectF:
0
1106 argument = argument.toRectF().translated(-offset);-
1107 break;
never executed: break;
0
1108 case
never executed: case QVariant::PointF:
QVariant::PointF:
never executed: case QVariant::PointF:
0
1109 argument = argument.toPointF() - offset;-
1110 break;
never executed: break;
0
1111 case
never executed: case QVariant::Rect:
QVariant::Rect:
never executed: case QVariant::Rect:
0
1112 argument = argument.toRect().translated(-offset.toPoint());-
1113 break;
never executed: break;
0
1114 case
never executed: case QVariant::Point:
QVariant::Point:
never executed: case QVariant::Point:
0
1115 argument = argument.toPoint() - offset;-
1116 break;
never executed: break;
0
1117 default
never executed: default:
:
never executed: default:
0
1118 break;
never executed: break;
0
1119 }-
1120-
1121 const QVariant v = d->control->inputMethodQuery(query, argument);-
1122 switch (v.type()) {-
1123 case
never executed: case QVariant::RectF:
QVariant::RectF:
never executed: case QVariant::RectF:
0
1124 return
never executed: return v.toRectF().translated(offset);
v.toRectF().translated(offset);
never executed: return v.toRectF().translated(offset);
0
1125 case
never executed: case QVariant::PointF:
QVariant::PointF:
never executed: case QVariant::PointF:
0
1126 return
never executed: return v.toPointF() + offset;
v.toPointF() + offset;
never executed: return v.toPointF() + offset;
0
1127 case
never executed: case QVariant::Rect:
QVariant::Rect:
never executed: case QVariant::Rect:
0
1128 return
never executed: return v.toRect().translated(offset.toPoint());
v.toRect().translated(offset.toPoint());
never executed: return v.toRect().translated(offset.toPoint());
0
1129 case
never executed: case QVariant::Point:
QVariant::Point:
never executed: case QVariant::Point:
0
1130 return
never executed: return v.toPoint() + offset.toPoint();
v.toPoint() + offset.toPoint();
never executed: return v.toPoint() + offset.toPoint();
0
1131 default
never executed: default:
:
never executed: default:
0
1132 break;
never executed: break;
0
1133 }-
1134 return
never executed: return v;
v;
never executed: return v;
0
1135}-
1136-
1137-
1138-
1139void QTextEdit::focusInEvent(QFocusEvent *e)-
1140{-
1141 QTextEditPrivate * const d = d_func();-
1142 if (e->reason() == Qt::MouseFocusReason
e->reason() ==...useFocusReasonDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1143 d->clickCausedFocus = 1;-
1144 }
never executed: end of block
0
1145 QAbstractScrollArea::focusInEvent(e);-
1146 d->sendControlEvent(e);-
1147}
never executed: end of block
0
1148-
1149-
1150-
1151void QTextEdit::focusOutEvent(QFocusEvent *e)-
1152{-
1153 QTextEditPrivate * const d = d_func();-
1154 QAbstractScrollArea::focusOutEvent(e);-
1155 d->sendControlEvent(e);-
1156}
never executed: end of block
0
1157-
1158-
1159-
1160void QTextEdit::showEvent(QShowEvent *)-
1161{-
1162 QTextEditPrivate * const d = d_func();-
1163 if (!d->anchorToScrollToWhenVisible.isEmpty()
!d->anchorToSc...ible.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1164 scrollToAnchor(d->anchorToScrollToWhenVisible);-
1165 d->anchorToScrollToWhenVisible.clear();-
1166 d->showCursorOnInitialShow = false;-
1167 }
never executed: end of block
else if (d->showCursorOnInitialShow
d->showCursorOnInitialShowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1168 d->showCursorOnInitialShow = false;-
1169 ensureCursorVisible();-
1170 }
never executed: end of block
0
1171}
never executed: end of block
0
1172-
1173-
1174-
1175void QTextEdit::changeEvent(QEvent *e)-
1176{-
1177 QTextEditPrivate * const d = d_func();-
1178 QAbstractScrollArea::changeEvent(e);-
1179 if (e->type() == QEvent::ApplicationFontChange
e->type() == Q...tionFontChangeDescription
TRUEnever evaluated
FALSEnever evaluated
0
1180 || e->type() == QEvent::FontChange
e->type() == Q...nt::FontChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1181 d->control->document()->setDefaultFont(font());-
1182 }
never executed: end of block
else if(e->type() == QEvent::ActivationChange
e->type() == Q...tivationChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1183 if (!isActiveWindow()
!isActiveWindow()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1184 d->autoScrollTimer.stop();
never executed: d->autoScrollTimer.stop();
0
1185 }
never executed: end of block
else if (e->type() == QEvent::EnabledChange
e->type() == Q...:EnabledChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1186 e->setAccepted(isEnabled());-
1187 d->control->setPalette(palette());-
1188 d->sendControlEvent(e);-
1189 }
never executed: end of block
else if (e->type() == QEvent::PaletteChange
e->type() == Q...:PaletteChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1190 d->control->setPalette(palette());-
1191 }
never executed: end of block
else if (e->type() == QEvent::LayoutDirectionChange
e->type() == Q...irectionChangeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1192 d->sendControlEvent(e);-
1193 }
never executed: end of block
0
1194}
never executed: end of block
0
1195-
1196-
1197-
1198-
1199void QTextEdit::wheelEvent(QWheelEvent *e)-
1200{-
1201 QTextEditPrivate * const d = d_func();-
1202 if (!(d->control->textInteractionFlags() & Qt::TextEditable)
!(d->control->...:TextEditable)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1203 if (e->modifiers() & Qt::ControlModifier
e->modifiers()...ontrolModifierDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1204 float delta = e->angleDelta().y() / 120.f;-
1205 zoomInF(delta);-
1206 return;
never executed: return;
0
1207 }-
1208 }
never executed: end of block
0
1209 QAbstractScrollArea::wheelEvent(e);-
1210 updateMicroFocus();-
1211}
never executed: end of block
0
1212QMenu *QTextEdit::createStandardContextMenu()-
1213{-
1214 QTextEditPrivate * const d = d_func();-
1215 return
never executed: return d->control->createStandardContextMenu(QPointF(), this);
d->control->createStandardContextMenu(QPointF(), this);
never executed: return d->control->createStandardContextMenu(QPointF(), this);
0
1216}-
1217QMenu *QTextEdit::createStandardContextMenu(const QPoint &position)-
1218{-
1219 QTextEditPrivate * const d = d_func();-
1220 return
never executed: return d->control->createStandardContextMenu(position, this);
d->control->createStandardContextMenu(position, this);
never executed: return d->control->createStandardContextMenu(position, this);
0
1221}-
1222-
1223-
1224-
1225-
1226-
1227QTextCursor QTextEdit::cursorForPosition(const QPoint &pos) const-
1228{-
1229 const QTextEditPrivate * const d = d_func();-
1230 return
never executed: return d->control->cursorForPosition(d->mapToContents(pos));
d->control->cursorForPosition(d->mapToContents(pos));
never executed: return d->control->cursorForPosition(d->mapToContents(pos));
0
1231}-
1232-
1233-
1234-
1235-
1236-
1237QRect QTextEdit::cursorRect(const QTextCursor &cursor) const-
1238{-
1239 const QTextEditPrivate * const d = d_func();-
1240 if (cursor.isNull()
cursor.isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1241 return
never executed: return QRect();
QRect();
never executed: return QRect();
0
1242-
1243 QRect r = d->control->cursorRect(cursor).toRect();-
1244 r.translate(-d->horizontalOffset(),-d->verticalOffset());-
1245 return
never executed: return r;
r;
never executed: return r;
0
1246}-
1247-
1248-
1249-
1250-
1251-
1252QRect QTextEdit::cursorRect() const-
1253{-
1254 const QTextEditPrivate * const d = d_func();-
1255 QRect r = d->control->cursorRect().toRect();-
1256 r.translate(-d->horizontalOffset(),-d->verticalOffset());-
1257 return
never executed: return r;
r;
never executed: return r;
0
1258}-
1259-
1260-
1261-
1262-
1263-
1264-
1265QString QTextEdit::anchorAt(const QPoint& pos) const-
1266{-
1267 const QTextEditPrivate * const d = d_func();-
1268 return
never executed: return d->control->anchorAt(d->mapToContents(pos));
d->control->anchorAt(d->mapToContents(pos));
never executed: return d->control->anchorAt(d->mapToContents(pos));
0
1269}-
1270bool QTextEdit::overwriteMode() const-
1271{-
1272 const QTextEditPrivate * const d = d_func();-
1273 return
never executed: return d->control->overwriteMode();
d->control->overwriteMode();
never executed: return d->control->overwriteMode();
0
1274}-
1275-
1276void QTextEdit::setOverwriteMode(bool overwrite)-
1277{-
1278 QTextEditPrivate * const d = d_func();-
1279 d->control->setOverwriteMode(overwrite);-
1280}
never executed: end of block
0
1281int QTextEdit::tabStopWidth() const-
1282{-
1283 const QTextEditPrivate * const d = d_func();-
1284 return
never executed: return qRound(d->control->document()->defaultTextOption().tabStop());
qRound(d->control->document()->defaultTextOption().tabStop());
never executed: return qRound(d->control->document()->defaultTextOption().tabStop());
0
1285}-
1286-
1287void QTextEdit::setTabStopWidth(int width)-
1288{-
1289 QTextEditPrivate * const d = d_func();-
1290 QTextOption opt = d->control->document()->defaultTextOption();-
1291 if (opt.tabStop() == width
opt.tabStop() == widthDescription
TRUEnever evaluated
FALSEnever evaluated
|| width < 0
width < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1292 return;
never executed: return;
0
1293 opt.setTabStop(width);-
1294 d->control->document()->setDefaultTextOption(opt);-
1295}
never executed: end of block
0
1296-
1297-
1298-
1299-
1300-
1301-
1302-
1303int QTextEdit::cursorWidth() const-
1304{-
1305 const QTextEditPrivate * const d = d_func();-
1306 return
never executed: return d->control->cursorWidth();
d->control->cursorWidth();
never executed: return d->control->cursorWidth();
0
1307}-
1308-
1309void QTextEdit::setCursorWidth(int width)-
1310{-
1311 QTextEditPrivate * const d = d_func();-
1312 d->control->setCursorWidth(width);-
1313}
never executed: end of block
0
1314bool QTextEdit::acceptRichText() const-
1315{-
1316 const QTextEditPrivate * const d = d_func();-
1317 return
never executed: return d->control->acceptRichText();
d->control->acceptRichText();
never executed: return d->control->acceptRichText();
0
1318}-
1319-
1320void QTextEdit::setAcceptRichText(bool accept)-
1321{-
1322 QTextEditPrivate * const d = d_func();-
1323 d->control->setAcceptRichText(accept);-
1324}
never executed: end of block
0
1325void QTextEdit::setExtraSelections(const QList<ExtraSelection> &selections)-
1326{-
1327 QTextEditPrivate * const d = d_func();-
1328 d->control->setExtraSelections(selections);-
1329}
never executed: end of block
0
1330-
1331-
1332-
1333-
1334-
1335-
1336-
1337QList<QTextEdit::ExtraSelection> QTextEdit::extraSelections() const-
1338{-
1339 const QTextEditPrivate * const d = d_func();-
1340 return
never executed: return d->control->extraSelections();
d->control->extraSelections();
never executed: return d->control->extraSelections();
0
1341}-
1342QMimeData *QTextEdit::createMimeDataFromSelection() const-
1343{-
1344 const QTextEditPrivate * const d = d_func();-
1345 return
never executed: return d->control->QWidgetTextControl::createMimeDataFromSelection();
d->control->QWidgetTextControl::createMimeDataFromSelection();
never executed: return d->control->QWidgetTextControl::createMimeDataFromSelection();
0
1346}-
1347bool QTextEdit::canInsertFromMimeData(const QMimeData *source) const-
1348{-
1349 const QTextEditPrivate * const d = d_func();-
1350 return
never executed: return d->control->QWidgetTextControl::canInsertFromMimeData(source);
d->control->QWidgetTextControl::canInsertFromMimeData(source);
never executed: return d->control->QWidgetTextControl::canInsertFromMimeData(source);
0
1351}-
1352void QTextEdit::insertFromMimeData(const QMimeData *source)-
1353{-
1354 QTextEditPrivate * const d = d_func();-
1355 d->control->QWidgetTextControl::insertFromMimeData(source);-
1356}
never executed: end of block
0
1357bool QTextEdit::isReadOnly() const-
1358{-
1359 const QTextEditPrivate * const d = d_func();-
1360 return
never executed: return !(d->control->textInteractionFlags() & Qt::TextEditable);
!(d->control->textInteractionFlags() & Qt::TextEditable);
never executed: return !(d->control->textInteractionFlags() & Qt::TextEditable);
0
1361}-
1362-
1363void QTextEdit::setReadOnly(bool ro)-
1364{-
1365 QTextEditPrivate * const d = d_func();-
1366 Qt::TextInteractionFlags flags = Qt::NoTextInteraction;-
1367 if (ro
roDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1368 flags = Qt::TextSelectableByMouse;-
1369-
1370 if (qobject_cast<QTextBrowser *>(this)
qobject_cast<Q...owser *>(this)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1371 flags |= Qt::TextBrowserInteraction;
never executed: flags |= Qt::TextBrowserInteraction;
0
1372-
1373 }
never executed: end of block
else {
0
1374 flags = Qt::TextEditorInteraction;-
1375 }
never executed: end of block
0
1376 d->control->setTextInteractionFlags(flags);-
1377 setAttribute(Qt::WA_InputMethodEnabled, shouldEnableInputMethod(this));-
1378 QEvent event(QEvent::ReadOnlyChange);-
1379 QApplication::sendEvent(this, &event);-
1380}
never executed: end of block
0
1381void QTextEdit::setTextInteractionFlags(Qt::TextInteractionFlags flags)-
1382{-
1383 QTextEditPrivate * const d = d_func();-
1384 d->control->setTextInteractionFlags(flags);-
1385}
never executed: end of block
0
1386-
1387Qt::TextInteractionFlags QTextEdit::textInteractionFlags() const-
1388{-
1389 const QTextEditPrivate * const d = d_func();-
1390 return
never executed: return d->control->textInteractionFlags();
d->control->textInteractionFlags();
never executed: return d->control->textInteractionFlags();
0
1391}-
1392void QTextEdit::mergeCurrentCharFormat(const QTextCharFormat &modifier)-
1393{-
1394 QTextEditPrivate * const d = d_func();-
1395 d->control->mergeCurrentCharFormat(modifier);-
1396}
never executed: end of block
0
1397-
1398-
1399-
1400-
1401-
1402-
1403-
1404void QTextEdit::setCurrentCharFormat(const QTextCharFormat &format)-
1405{-
1406 QTextEditPrivate * const d = d_func();-
1407 d->control->setCurrentCharFormat(format);-
1408}
never executed: end of block
0
1409-
1410-
1411-
1412-
1413QTextCharFormat QTextEdit::currentCharFormat() const-
1414{-
1415 const QTextEditPrivate * const d = d_func();-
1416 return
never executed: return d->control->currentCharFormat();
d->control->currentCharFormat();
never executed: return d->control->currentCharFormat();
0
1417}-
1418QTextEdit::AutoFormatting QTextEdit::autoFormatting() const-
1419{-
1420 const QTextEditPrivate * const d = d_func();-
1421 return
never executed: return d->autoFormatting;
d->autoFormatting;
never executed: return d->autoFormatting;
0
1422}-
1423-
1424void QTextEdit::setAutoFormatting(AutoFormatting features)-
1425{-
1426 QTextEditPrivate * const d = d_func();-
1427 d->autoFormatting = features;-
1428}
never executed: end of block
0
1429void QTextEdit::insertPlainText(const QString &text)-
1430{-
1431 QTextEditPrivate * const d = d_func();-
1432 d->control->insertPlainText(text);-
1433}
never executed: end of block
0
1434void QTextEdit::insertHtml(const QString &text)-
1435{-
1436 QTextEditPrivate * const d = d_func();-
1437 d->control->insertHtml(text);-
1438}
never executed: end of block
0
1439-
1440-
1441-
1442-
1443-
1444-
1445-
1446void QTextEdit::scrollToAnchor(const QString &name)-
1447{-
1448 QTextEditPrivate * const d = d_func();-
1449 if (name.isEmpty()
name.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1450 return;
never executed: return;
0
1451-
1452 if (!isVisible()
!isVisible()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1453 d->anchorToScrollToWhenVisible = name;-
1454 return;
never executed: return;
0
1455 }-
1456-
1457 QPointF p = d->control->anchorPosition(name);-
1458 const int newPosition = qRound(p.y());-
1459 if ( d->vbar->maximum() < newPosition
d->vbar->maxim... < newPositionDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1460 d->_q_adjustScrollbars();
never executed: d->_q_adjustScrollbars();
0
1461 d->vbar->setValue(newPosition);-
1462}
never executed: end of block
0
1463void QTextEdit::zoomIn(int range)-
1464{-
1465 zoomInF(range);-
1466}
never executed: end of block
0
1467void QTextEdit::zoomOut(int range)-
1468{-
1469 zoomInF(-range);-
1470}
never executed: end of block
0
1471-
1472-
1473-
1474-
1475void QTextEdit::zoomInF(float range)-
1476{-
1477 if (range == 0.f
range == 0.fDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1478 return;
never executed: return;
0
1479 QFont f = font();-
1480 const float newSize = f.pointSizeF() + range;-
1481 if (newSize <= 0
newSize <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1482 return;
never executed: return;
0
1483 f.setPointSizeF(newSize);-
1484 setFont(f);-
1485}
never executed: end of block
0
1486void QTextEdit::moveCursor(QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode)-
1487{-
1488 QTextEditPrivate * const d = d_func();-
1489 d->control->moveCursor(operation, mode);-
1490}
never executed: end of block
0
1491-
1492-
1493-
1494-
1495-
1496bool QTextEdit::canPaste() const-
1497{-
1498 const QTextEditPrivate * const d = d_func();-
1499 return
never executed: return d->control->canPaste();
d->control->canPaste();
never executed: return d->control->canPaste();
0
1500}-
1501void QTextEdit::print(QPagedPaintDevice *printer) const-
1502{-
1503 const QTextEditPrivate * const d = d_func();-
1504 d->control->print(printer);-
1505}
never executed: end of block
0
1506bool QTextEdit::tabChangesFocus() const-
1507{-
1508 const QTextEditPrivate * const d = d_func();-
1509 return
never executed: return d->tabChangesFocus;
d->tabChangesFocus;
never executed: return d->tabChangesFocus;
0
1510}-
1511-
1512void QTextEdit::setTabChangesFocus(bool b)-
1513{-
1514 QTextEditPrivate * const d = d_func();-
1515 d->tabChangesFocus = b;-
1516}
never executed: end of block
0
1517QTextEdit::LineWrapMode QTextEdit::lineWrapMode() const-
1518{-
1519 const QTextEditPrivate * const d = d_func();-
1520 return
never executed: return d->lineWrap;
d->lineWrap;
never executed: return d->lineWrap;
0
1521}-
1522-
1523void QTextEdit::setLineWrapMode(LineWrapMode wrap)-
1524{-
1525 QTextEditPrivate * const d = d_func();-
1526 if (d->lineWrap == wrap
d->lineWrap == wrapDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1527 return;
never executed: return;
0
1528 d->lineWrap = wrap;-
1529 d->updateDefaultTextOption();-
1530 d->relayoutDocument();-
1531}
never executed: end of block
0
1532int QTextEdit::lineWrapColumnOrWidth() const-
1533{-
1534 const QTextEditPrivate * const d = d_func();-
1535 return
never executed: return d->lineWrapColumnOrWidth;
d->lineWrapColumnOrWidth;
never executed: return d->lineWrapColumnOrWidth;
0
1536}-
1537-
1538void QTextEdit::setLineWrapColumnOrWidth(int w)-
1539{-
1540 QTextEditPrivate * const d = d_func();-
1541 d->lineWrapColumnOrWidth = w;-
1542 d->relayoutDocument();-
1543}
never executed: end of block
0
1544QTextOption::WrapMode QTextEdit::wordWrapMode() const-
1545{-
1546 const QTextEditPrivate * const d = d_func();-
1547 return
never executed: return d->wordWrap;
d->wordWrap;
never executed: return d->wordWrap;
0
1548}-
1549-
1550void QTextEdit::setWordWrapMode(QTextOption::WrapMode mode)-
1551{-
1552 QTextEditPrivate * const d = d_func();-
1553 if (mode == d->wordWrap
mode == d->wordWrapDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1554 return;
never executed: return;
0
1555 d->wordWrap = mode;-
1556 d->updateDefaultTextOption();-
1557}
never executed: end of block
0
1558-
1559-
1560-
1561-
1562-
1563-
1564bool QTextEdit::find(const QString &exp, QTextDocument::FindFlags options)-
1565{-
1566 QTextEditPrivate * const d = d_func();-
1567 return
never executed: return d->control->find(exp, options);
d->control->find(exp, options);
never executed: return d->control->find(exp, options);
0
1568}-
1569bool QTextEdit::find(const QRegExp &exp, QTextDocument::FindFlags options)-
1570{-
1571 QTextEditPrivate * const d = d_func();-
1572 return
never executed: return d->control->find(exp, options);
d->control->find(exp, options);
never executed: return d->control->find(exp, options);
0
1573}-
1574void QTextEdit::setText(const QString &text)-
1575{-
1576 QTextEditPrivate * const d = d_func();-
1577 Qt::TextFormat format = d->textFormat;-
1578 if (d->textFormat == Qt::AutoText
d->textFormat == Qt::AutoTextDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1579 format = Qt::mightBeRichText(text)
Qt::mightBeRichText(text)Description
TRUEnever evaluated
FALSEnever evaluated
? Qt::RichText : Qt::PlainText;
never executed: format = Qt::mightBeRichText(text) ? Qt::RichText : Qt::PlainText;
0
1580-
1581 if (format == Qt::RichText
format == Qt::RichTextDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1582 setHtml(text);
never executed: setHtml(text);
0
1583 else-
1584-
1585 setPlainText(text);
never executed: setPlainText(text);
0
1586}-
1587void QTextEdit::append(const QString &text)-
1588{-
1589 QTextEditPrivate * const d = d_func();-
1590 const bool atBottom = isReadOnly()
isReadOnly()Description
TRUEnever evaluated
FALSEnever evaluated
? d->verticalOffset() >= d->vbar->maximum() :
0
1591 d->control->textCursor().atEnd();-
1592 d->control->append(text);-
1593 if (atBottom
atBottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1594 d->vbar->setValue(d->vbar->maximum());
never executed: d->vbar->setValue(d->vbar->maximum());
0
1595}
never executed: end of block
0
1596-
1597-
1598-
1599-
1600-
1601void QTextEdit::ensureCursorVisible()-
1602{-
1603 QTextEditPrivate * const d = d_func();-
1604 d->control->ensureCursorVisible();-
1605}
never executed: end of block
0
1606-
1607-
Switch to Source codePreprocessed file

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