7#ifndef QT_NO_TEXTCONTROL
13#if QT_CONFIG(draganddrop)
19#include "private/qapplication_p.h"
20#include "private/qtextdocumentlayout_p.h"
21#include "private/qabstracttextdocumentlayout_p.h"
23#include "private/qmenu_p.h"
26#include "private/qtextdocument_p.h"
27#include "private/qtextdocumentfragment_p.h"
29#include "private/qwidgettextcontrol_p.h"
30#if QT_CONFIG(style_stylesheet)
31# include "private/qstylesheetstyle_p.h"
33#if QT_CONFIG(graphicsview)
37#include "private/qpagedpaintdevice_p.h"
40#include "private/qtextcursor_p.h"
56#if QT_CONFIG(lineedit)
57#include <QtWidgets/qlineedit.h>
59#include <QtGui/qaccessible.h>
60#include <QtCore/qmetaobject.h>
62#if QT_CONFIG(shortcut)
63#include "private/qapplication_p.h"
64#include "private/qshortcutmap_p.h"
66#define ACCEL_KEY(k) (!QCoreApplication::testAttribute(Qt::AA_DontShowShortcutsInContextMenus) \
67 && !QGuiApplicationPrivate::instance()->shortcutMap.hasShortcutForKeySequence(k) ? \
68 u'\t' + QKeySequence(k).toString(QKeySequence::NativeText) : QString())
71#define ACCEL_KEY(k) QString()
92 return layout->lineForTextPosition(relativePos);
98 interactionFlags(
Qt::TextEditorInteraction),
100 interactionFlags(
Qt::TextEditable |
Qt::TextSelectableByKeyboard),
106 lastSelectionPosition(0), lastSelectionAnchor(0),
107 ignoreAutomaticScrollbarAdjustement(
false),
108 overwriteMode(
false),
109 acceptRichText(true),
110 preeditCursor(0), hideCursor(
false),
112#ifdef QT_KEYPAD_NAVIGATION
116 hadSelectionOnMousePress(
false),
117 ignoreUnusedNavigationEvents(
false),
118 openExternalLinks(
false),
119 wordSelectionEnabled(
false)
140#ifndef QT_NO_SHORTCUT
195 &&
line.lineNumber() == 0)
260 q->ensureCursorVisible();
265#ifdef QT_KEYPAD_NAVIGATION
266 ignoreNavigationEvents = ignoreNavigationEvents || QApplicationPrivate::keypadNavigationEnabled();
267 isNavigationEvent = isNavigationEvent ||
276 emit q->cursorPositionChanged();
277 emit q->microFocusChanged();
278 }
else if (ignoreNavigationEvents && isNavigationEvent && oldSelection.
anchor() ==
cursor.
anchor()) {
298 emit q->currentCharFormatChanged(
fmt);
299 emit q->microFocusChanged();
335 list->setFormat(listFmt);
345 int newRow = cell.
row();
347 if (newColumn >=
table->columns()) {
350 if (newRow >=
table->rows())
354 cell =
table->cellAt(newRow, newColumn);
363 int newColumn = cell.
column() - 1;
364 int newRow = cell.
row();
367 newColumn =
table->columns() - 1;
373 cell =
table->cellAt(newRow, newColumn);
401 q->setCursorWidth(-1);
412 bool clearDocument =
true;
420 clearDocument =
false;
471#if QT_CONFIG(textmarkdownreader)
477#ifndef QT_NO_TEXTHTMLPARSER
485 }
else if (clearDocument) {
491 emit q->textChanged();
498 q->ensureCursorVisible();
499 emit q->cursorPositionChanged();
507#if QT_CONFIG(draganddrop)
569 emit q->updateRequest(
q->selectionRect(differenceSelection));
571 if (!oldSelection.
isNull())
580 if (forceEmitSelectionChanged) {
581 emit q->selectionChanged();
582#if QT_CONFIG(accessibility)
583 if (
q->parent() &&
q->parent()->isWidgetType()) {
585 QAccessible::updateAccessibility(&ev);
596 if (selectionStateChange)
599 if (!forceEmitSelectionChanged
600 && (selectionStateChange
604 emit q->selectionChanged();
605#if QT_CONFIG(accessibility)
606 if (
q->parent() &&
q->parent()->isWidgetType()) {
608 QAccessible::updateAccessibility(&ev);
612 emit q->microFocusChanged();
623#ifndef QT_NO_CLIPBOARD
639 emit q->cursorPositionChanged();
640 emit q->microFocusChanged();
646#if QT_CONFIG(accessibility)
649 if (QAccessible::isActive() &&
q->parent() &&
q->parent()->isWidgetType()) {
660 QAccessibleEvent *ev =
nullptr;
661 if (charsRemoved == 0) {
662 ev =
new QAccessibleTextInsertEvent(
q->parent(), from, newText);
663 }
else if (charsAdded == 0) {
664 ev =
new QAccessibleTextRemoveEvent(
q->parent(), from, oldText);
666 ev =
new QAccessibleTextUpdateEvent(
q->parent(), from, oldText, newText);
668 QAccessible::updateAccessibility(ev);
733 const int wordStartPos = curs.
position();
736 const QPointF blockCoordinates =
q->blockBoundingRect(curs.
block()).topLeft();
742 const qreal wordStartX =
line.cursorToX(curs.
position() - blockPos) + blockCoordinates.
x();
746 const int wordEndPos = curs.
position();
750 || wordEndPos == wordStartPos)
753 const qreal wordEndX =
line.cursorToX(curs.
position() - blockPos) + blockCoordinates.
x();
774 const qreal differenceToStart = mouseXPosition - wordStartX;
775 const qreal differenceToEnd = wordEndX - mouseXPosition;
777 if (differenceToStart < differenceToEnd)
784#ifndef QT_NO_CLIPBOARD
814#ifndef QT_NO_CLIPBOARD
831 d->repaintSelection();
832 const int oldCursorPos =
d->cursor.position();
833 d->doc->undo(&
d->cursor);
834 if (
d->cursor.position() != oldCursorPos)
843 d->repaintSelection();
844 const int oldCursorPos =
d->cursor.position();
845 d->doc->redo(&
d->cursor);
846 if (
d->cursor.position() != oldCursorPos)
883 d->doc->disconnect(
this);
884 d->doc->documentLayout()->disconnect(
this);
885 d->doc->documentLayout()->setPaintDevice(
nullptr);
887 if (
d->doc->parent() ==
this)
903 d->cursorIsFocusIndicator =
false;
904 const bool posChanged =
cursor.position() !=
d->cursor.position();
907 d->cursorOn =
d->hasFocus
909 d->_q_updateCurrentCharFormatAndSelection();
911 d->repaintOldAndNewSelection(oldSelection);
915#ifndef QT_NO_CLIPBOARD
916 if (selectionClipboard)
917 d->setClipboardSelection();
929#ifndef QT_NO_CLIPBOARD
937 d->cursor.removeSelectedText();
943 if (!
d->cursor.hasSelection())
961 d->extraSelections.clear();
969 const int selectionLength =
qAbs(
d->cursor.position() -
d->cursor.anchor());
970 const int oldCursorPos =
d->cursor.position();
972 d->selectionChanged(selectionLength !=
qAbs(
d->cursor.position() -
d->cursor.anchor()));
973 d->cursorIsFocusIndicator =
false;
974 if (
d->cursor.position() != oldCursorPos)
982 t.translate(coordinateOffset.
x(), coordinateOffset.
y());
994 d->contextWidget = contextWidget;
996 if (!
d->contextWidget) {
998#if QT_CONFIG(graphicsview)
1013 d->contextWidget = ev->
widget();
1021 switch (
e->type()) {
1048#ifndef QT_NO_CONTEXTMENU
1060 d->isEnabled =
e->isAccepted();
1063#if QT_CONFIG(tooltip)
1071#if QT_CONFIG(draganddrop)
1073 QDragEnterEvent *ev =
static_cast<QDragEnterEvent *
>(
e);
1074 if (
d->dragEnterEvent(
e, ev->mimeData()))
1075 ev->acceptProposedAction();
1079 d->dragLeaveEvent();
1082 QDragMoveEvent *ev =
static_cast<QDragMoveEvent *
>(
e);
1083 if (
d->dragMoveEvent(
e, ev->mimeData(),
transform.map(ev->position().toPoint())))
1084 ev->acceptProposedAction();
1088 QDropEvent *ev =
static_cast<QDropEvent *
>(
e);
1089 if (
d->dropEvent(ev->mimeData(),
transform.map(ev->position().toPoint()), ev->dropAction(), ev->source()))
1090 ev->acceptProposedAction();
1095#if QT_CONFIG(graphicsview)
1133 d->dragLeaveEvent();
1146#ifdef QT_KEYPAD_NAVIGATION
1147 case QEvent::EnterEditFocus:
1148 case QEvent::LeaveEditFocus:
1149 if (QApplicationPrivate::keypadNavigationEnabled())
1150 d->editFocusEvent(
e);
1173 if (
e->timerId() ==
d->cursorBlinkTimer.timerId()) {
1174 d->cursorOn = !
d->cursorOn;
1176 if (
d->cursor.hasSelection())
1181 }
else if (
e->timerId() ==
d->trippleClickTimer.timerId()) {
1182 d->trippleClickTimer.stop();
1192#if QT_CONFIG(textmarkdownreader)
1193void QWidgetTextControl::setMarkdown(
const QString &
text)
1209#ifndef QT_NO_SHORTCUT
1213#ifndef QT_NO_CLIPBOARD
1218#ifndef QT_NO_CLIPBOARD
1234#ifdef QT_KEYPAD_NAVIGATION
1280#ifndef QT_NO_SHORTCUT
1293#ifndef QT_NO_SHORTCUT
1300#ifndef QT_NO_CLIPBOARD
1349 if (
q->isAcceptableInput(
e)) {
1367#ifndef QT_NO_CLIPBOARD
1374 q->ensureCursorVisible();
1389 QRectF br =
q->blockBoundingRect(block);
1391 emit q->updateRequest(br);
1402 const QPointF layoutPos =
q->blockBoundingRect(block).topLeft();
1405 int preeditPos =
layout->preeditAreaPosition();
1406 if (relativePos == preeditPos)
1408 else if (relativePos > preeditPos)
1409 relativePos +=
layout->preeditAreaText().size();
1423 if (
line.isValid()) {
1427 if (relativePos <
line.textLength() -
line.textStart())
1428 w =
line.cursorToX(relativePos + 1) -
x;
1433 cursorWidth +
w,
line.height());
1435 r =
QRectF(layoutPos.
x(), layoutPos.
y(), cursorWidth, 10);
1442struct QTextFrameComparator {
1455 cursor.selectionStart(), QTextFrameComparator());
1457 cursor.selectionEnd(), QTextFrameComparator());
1460 r |=
frame->document()->documentLayout()->frameBoundingRect(*
it);
1471 if (
cursor.hasComplexSelection() &&
cursor.currentTable()) {
1474 r =
d->doc->documentLayout()->frameBoundingRect(
table);
1516 }
else if (
cursor.hasSelection()) {
1518 const int anchor =
cursor.selectionEnd();
1520 const QTextBlock anchorBlock =
d->doc->findBlock(anchor);
1529 for (
int i = firstLine;
i <= lastLine; ++
i) {
1531 r |=
layout->lineAt(
i).naturalTextRect();
1535 QRectF anchorRect =
d->rectForPosition(
cursor.selectionEnd());
1538 QRectF frameRect(
d->doc->documentLayout()->frameBoundingRect(
cursor.currentFrame()));
1539 r.setLeft(frameRect.
left());
1540 r.setRight(frameRect.
right());
1543 r.adjust(-1, -1, 1, 1);
1556 Qt::MouseButtons buttons,
const QPoint &globalPos)
1562#if QT_CONFIG(draganddrop)
1614 if (cursorPos == -1) {
1639#if QT_CONFIG(draganddrop)
1650 q->ensureCursorVisible();
1652 emit q->cursorPositionChanged();
1656 emit q->cursorPositionChanged();
1657 emit q->microFocusChanged();
1666 Qt::MouseButtons buttons,
const QPoint &globalPos)
1671 QString anchor =
q->anchorAt(mousePos);
1674 emit q->linkHovered(anchor);
1705 if (newCursorPos != selectionStartPos) {
1714 if (newCursorPos == -1)
1734 emit q->cursorPositionChanged();
1743 emit q->cursorPositionChanged();
1744 emit q->microFocusChanged();
1760 Qt::MouseButtons buttons,
const QPoint &globalPos)
1773#if QT_CONFIG(draganddrop)
1783#ifndef QT_NO_CLIPBOARD
1792 q->insertFromMimeData(md);
1799 emit q->cursorPositionChanged();
1800 emit q->microFocusChanged();
1809 switch (
fmt.marker()) {
1845 if (anchorPos < 0) {
1859 Qt::KeyboardModifiers
modifiers, Qt::MouseButtons buttons,
1867#if QT_CONFIG(draganddrop)
1875 bool doEmit =
false;
1876 if (
line.isValid() &&
line.textLength()) {
1889#ifndef QT_NO_CLIPBOARD
1892 emit q->cursorPositionChanged();
1902 Qt::KeyboardModifiers
modifiers, Qt::MouseButtons buttons,
const QPoint &globalPos)
1910#if !defined(QT_NO_IM)
1917 if (cursorPos < 0 || cursorPos >
layout->preeditAreaText().size())
1920 if (cursorPos >= 0) {
1924 e->setAccepted(
true);
1936#ifdef QT_NO_CONTEXTMENU
1977 emit q->updateRequest(crect);
1989 if (cursorPos != -1) {
1992 emit q->updateRequest(crect);
1998 emit q->updateRequest(crect);
2020 cursor = insertionCursor;
2023 q->ensureCursorVisible();
2034 bool isGettingInput = !
e->commitString().isEmpty()
2036 ||
e->replacementLength() > 0;
2038 if (!isGettingInput &&
e->attributes().isEmpty()) {
2046 if (isGettingInput) {
2053 if (!
e->commitString().isEmpty() ||
e->replacementLength()) {
2059 c.insertText(
e->commitString());
2062 for (
int i = 0;
i <
e->attributes().
size(); ++
i) {
2069 q->ensureCursorVisible();
2080 overrides.
reserve(
e->attributes().size());
2084 for (
int i = 0;
i <
e->attributes().
size(); ++
i) {
2091 f.
merge(qvariant_cast<QTextFormat>(
a.value).toCharFormat());
2095 o.length =
a.length;
2100 while (
it != overrides.
begin()) {
2102 if (
o.start >= previous->start) {
2117 int end =
start +
e->preeditString().size();
2120 while (
it != overrides.
end()) {
2122 int rangeStart =
range.start;
2123 if (rangeStart >
start) {
2126 o.length = rangeStart -
start;
2143 layout->setFormats(overrides);
2150 emit q->cursorPositionChanged();
2152 emit q->microFocusChanged();
2163 return d->rectForPosition(
d->cursor.anchor());
2165 return QVariant(
d->cursor.charFormat().font());
2174 return QVariant(
d->cursor.selectedText());
2183 return QVariant(
d->cursor.position()); }
2188 int localPos =
d->cursor.position() - block.
position();
2203 int localPos =
d->cursor.position() - block.
position();
2205 int resultLen = localPos;
2238 emit q->updateRequest(
q->selectionRect());
2239 if (
e->gotFocus()) {
2240#ifdef QT_KEYPAD_NAVIGATION
2241 if (!QApplicationPrivate::keypadNavigationEnabled() || (hasEditFocus && (
e->reason() ==
Qt::PopupFocusReason))) {
2247#ifdef QT_KEYPAD_NAVIGATION
2278#ifdef QT_KEYPAD_NAVIGATION
2279void QWidgetTextControlPrivate::editFocusEvent(
QEvent *
e)
2283 if (QApplicationPrivate::keypadNavigationEnabled()) {
2288 q->ensureCursorVisible();
2291 emit q->cursorPositionChanged();
2292 emit q->microFocusChanged();
2302 hasEditFocus =
e->type() == QEvent::EnterEditFocus;
2306#ifndef QT_NO_CONTEXTMENU
2324 if (
d->linkToCopy.isEmpty() && !showTextSelectionActions)
2332 a->setEnabled(
d->doc->isUndoAvailable());
2336 a->setEnabled(
d->doc->isRedoAvailable());
2341#ifndef QT_NO_CLIPBOARD
2343 a->setEnabled(
d->cursor.hasSelection());
2349#ifndef QT_NO_CLIPBOARD
2350 if (showTextSelectionActions) {
2352 a->setEnabled(
d->cursor.hasSelection());
2361 a->setEnabled(!
d->linkToCopy.isEmpty());
2367#ifndef QT_NO_CLIPBOARD
2374 a->setEnabled(
d->cursor.hasSelection());
2380 if (showTextSelectionActions) {
2383 a->setEnabled(!
d->doc->isEmpty());
2402 if (cursorPos == -1)
2405 c.setPosition(cursorPos);
2415 return d->rectForPosition(
cursor.position());
2435 return d->doc->documentLayout()->anchorAt(
pos);
2442 return d->anchorForCursor(
d->cursor);
2448 return d->doc->documentLayout()->blockWithMarkerAt(
pos);
2454 return d->overwriteMode;
2460 d->overwriteMode = overwrite;
2466 return d->doc->documentLayout()->property(
"cursorWidth").toInt();
2474 d->doc->documentLayout()->setProperty(
"cursorWidth",
width);
2481 return d->acceptRichText;
2487 d->acceptRichText = accept;
2490#if QT_CONFIG(textedit)
2497 for (
int i = 0;
i <
d->extraSelections.size(); ++
i) {
2502 for (
int i = 0;
i < selections.
size(); ++
i) {
2516 r.setWidth(
qreal(INT_MAX));
2526 r.setWidth(
qreal(INT_MAX));
2531 d->extraSelections.resize(selections.
size());
2532 for (
int i = 0;
i < selections.
size(); ++
i) {
2533 d->extraSelections[
i].cursor = selections.
at(
i).cursor;
2534 d->extraSelections[
i].format = selections.
at(
i).format;
2542 const int numExtraSelections =
d->extraSelections.size();
2543 selections.
reserve(numExtraSelections);
2544 for (
int i = 0;
i < numExtraSelections; ++
i) {
2559 d->doc->setTextWidth(
width);
2565 return d->doc->textWidth();
2571 return d->doc->size();
2577 d->openExternalLinks =
open;
2583 return d->openExternalLinks;
2589 return d->ignoreUnusedNavigationEvents;
2595 d->ignoreUnusedNavigationEvents = ignore;
2602 const bool moved =
d->cursor.movePosition(op,
mode);
2603 d->_q_updateCurrentCharFormatAndSelection();
2605 d->repaintOldAndNewSelection(oldSelection);
2612#ifndef QT_NO_CLIPBOARD
2625 d->cursorIsFocusIndicator =
b;
2632 return d->cursorIsFocusIndicator;
2645 return d->dragEnabled;
2657 return d->wordSelectionEnabled;
2662 return d_func()->isPreediting();
2665#ifndef QT_NO_PRINTER
2674 if (!
d->cursor.hasSelection())
2686 doc->
documentLayout()->d_func()->handlers =
d->doc->documentLayout()->d_func()->handlers;
2688 doc->
print(printer);
2703 if (
d->acceptRichText)
2704 return (
source->hasText() && !
source->text().isEmpty())
2706 ||
source->hasFormat(
"application/x-qrichtext"_L1)
2707 ||
source->hasFormat(
"application/x-qt-richtext"_L1);
2718 bool hasData =
false;
2720#if QT_CONFIG(textmarkdownreader)
2724 fragment = QTextDocumentFragment::fromMarkdown(
s);
2728#ifndef QT_NO_TEXTHTMLPARSER
2729 if (
source->hasFormat(
"application/x-qrichtext"_L1) &&
d->acceptRichText) {
2731 const QString richtext =
"<meta name=\"qrichtext\" content=\"1\" />"_L1
2735 }
else if (
source->hasHtml() &&
d->acceptRichText) {
2749 d->cursor.insertFragment(fragment);
2757 int anchorStart = -1;
2767 while (!
it.atEnd() &&
it.fragment().position() < startPos)
2774 for (; !
it.atEnd(); ++
it) {
2780 anchorHref =
fmt.anchorHref();
2785 if (anchorStart != -1) {
2789 for (; !
it.atEnd(); ++
it) {
2793 if (!
fmt.isAnchor() ||
fmt.anchorHref() != anchorHref) {
2799 if (anchorEnd == -1)
2806 block = block.
next();
2818 if (startPos == block.
position()) {
2822 if (
it == blockStart) {
2828 }
while (!
it.atEnd() &&
it.fragment().position() +
it.fragment().length() - 1 > startPos);
2841 anchorHref =
fmt.anchorHref();
2845 if (
it == blockStart)
2849 }
while (!
it.atEnd());
2852 if (anchorStart != -1 && !
it.atEnd()) {
2859 if (!
fmt.isAnchor() ||
fmt.anchorHref() != anchorHref) {
2864 if (
it == blockStart)
2868 }
while (!
it.atEnd());
2870 if (anchorEnd == -1)
2880 blockStart = block.
begin();
2885 if (anchorStart != -1 && anchorEnd != -1) {
2886 newAnchor =
d->cursor;
2916 for (; !
it.atEnd(); ++
it) {
2918 const int fragmentPos = fragment.
position();
2919 if (fragmentPos <= cursorPos &&
2920 fragmentPos + fragment.
length() > cursorPos) {
2926 if (!linkFragment.
atEnd()) {
2936 }
while (
it != block.
begin());
2939 for (
it = linkFragment; !
it.atEnd(); ++
it) {
2956#ifndef QT_NO_DESKTOPSERVICES
2961 emit q_func()->linkActivated(href);
2964#if QT_CONFIG(tooltip)
2965void QWidgetTextControlPrivate::showToolTip(
const QPoint &globalPos,
const QPointF &
pos,
QWidget *contextWidget)
2967 const QString toolTip = q_func()->cursorForPosition(
pos).charFormat().toolTip();
3013 if (!
d->cursor.hasSelection()) {
3023 d->cursor = newAnchor;
3024 d->cursorIsFocusIndicator =
true;
3026 d->cursor.clearSelection();
3029 if (
d->cursor.hasSelection()) {
3047 const QString anchorHref =
d->anchorForCursor(newCursor);
3057 d->cursorIsFocusIndicator =
true;
3068 if (
flags ==
d->interactionFlags)
3070 d->interactionFlags =
flags;
3079 return d->interactionFlags;
3085 d->cursor.mergeCharFormat(modifier);
3086 d->updateCurrentCharFormat();
3092 d->cursor.setCharFormat(
format);
3093 d->updateCurrentCharFormat();
3099 return d->cursor.charFormat();
3105 d->cursor.insertText(
text);
3108#ifndef QT_NO_TEXTHTMLPARSER
3112 d->cursor.insertHtml(
text);
3123 for (
QTextBlock block =
d->doc->begin(); block.isValid(); block = block.next()) {
3126 r =
d->rectForPosition(block.position());
3148 d->doc->adjustSize();
3162#if QT_CONFIG(regularexpression)
3180#ifndef QT_NO_TEXTHTMLPARSER
3187#if QT_CONFIG(textmarkdownwriter)
3188QString QWidgetTextControl::toMarkdown(QTextDocument::MarkdownFeatures features)
const
3190 return document()->toMarkdown(features);
3230 if (blockFmtChanged)
3251#ifndef QT_NO_TEXTHTMLPARSER
3289 QRectF crect =
d->rectForPosition(
d->cursor.position()).adjusted(-5, 0, 5, 0);
3312 ctx.selections =
d->extraSelections;
3313 ctx.palette =
d->palette;
3314#if QT_CONFIG(style_stylesheet)
3323 if (
d->cursorOn &&
d->isEnabled) {
3325 ctx.cursorPosition = -1;
3326 else if (
d->preeditCursor != 0)
3327 ctx.cursorPosition = - (
d->preeditCursor + 2);
3329 ctx.cursorPosition =
d->cursor.position();
3332 if (!
d->dndFeedbackCursor.isNull())
3333 ctx.cursorPosition =
d->dndFeedbackCursor.position();
3334#ifdef QT_KEYPAD_NAVIGATION
3335 if (!QApplicationPrivate::keypadNavigationEnabled() ||
d->hasEditFocus)
3337 if (
d->cursor.hasSelection()) {
3340 if (
d->cursorIsFocusIndicator) {
3348 selection.format = qvariant_cast<QTextFormat>(
ret.variant).toCharFormat();
3377 d->doc->documentLayout()->draw(
p,
ctx);
3383#ifndef QT_NO_CLIPBOARD
3393 return d->doc->documentLayout()->hitTest(point, accuracy);
3399 return d->doc->documentLayout()->blockBoundingRect(block);
3402#ifndef QT_NO_CONTEXTMENU
3403#define NUM_CONTROL_CHARACTERS 14
3408 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"LRM Left-to-right mark"), 0x200e },
3409 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"RLM Right-to-left mark"), 0x200f },
3410 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"ZWJ Zero width joiner"), 0x200d },
3411 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"ZWNJ Zero width non-joiner"), 0x200c },
3412 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"ZWSP Zero width space"), 0x200b },
3413 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"LRE Start of left-to-right embedding"), 0x202a },
3414 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"RLE Start of right-to-left embedding"), 0x202b },
3415 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"LRO Start of left-to-right override"), 0x202d },
3416 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"RLO Start of right-to-left override"), 0x202e },
3417 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"PDF Pop directional formatting"), 0x202c },
3418 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"LRI Left-to-right isolate"), 0x2066 },
3419 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"RLI Right-to-left isolate"), 0x2067 },
3420 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"FSI First strong isolate"), 0x2068 },
3421 {
QT_TRANSLATE_NOOP(
"QUnicodeControlCharacterMenu",
"PDI Pop directional isolate"), 0x2069 }
3427 setTitle(
tr(
"Insert Unicode control character"));
3433void QUnicodeControlCharacterMenu::menuActionTriggered()
3442#if QT_CONFIG(textedit)
3443 if (
QTextEdit *
edit = qobject_cast<QTextEdit *>(editWidget)) {
3449 control->insertPlainText(
str);
3451#if QT_CONFIG(lineedit)
3452 if (
QLineEdit *
edit = qobject_cast<QLineEdit *>(editWidget)) {
3463 return QStringList() << u
"text/plain"_s << u
"text/html"_s
3464#if QT_CONFIG(textmarkdownwriter)
3465 << u
"text/markdown"_s
3467#ifndef QT_NO_TEXTODFWRITER
3468 << u
"application/vnd.oasis.opendocument.text"_s
3482void QTextEditMimeData::setup()
const
3485#ifndef QT_NO_TEXTHTMLPARSER
3488#if QT_CONFIG(textmarkdownwriter)
3489 that->
setData(
"text/markdown"_L1, fragment.toMarkdown().toUtf8());
3491#ifndef QT_NO_TEXTODFWRITER
3495 writer.write(fragment);
3497 that->
setData(
"application/vnd.oasis.opendocument.text"_L1,
buffer.data());
3506#include "moc_qwidgettextcontrol_p.cpp"
void documentSizeChanged(const QSizeF &newSize)
This signal is emitted when the size of the document layout changes to newSize.
void updateBlock(const QTextBlock &block)
void update(const QRectF &=QRectF(0., 0., 1000000000., 1000000000.))
This signal is emitted when the rectangle rect has been updated.
The QAction class provides an abstraction for user commands that can be added to different user inter...
void setIcon(const QIcon &icon)
static QStyle * style()
Returns the application's style object.
static QPalette palette()
Returns the current application palette.
int doubleClickInterval
the time limit in milliseconds that distinguishes a double click from two consecutive mouse clicks
int startDragDistance
the minimum distance required for a drag and drop operation to start.
void start(int msec, QObject *obj)
\obsolete Use chrono overload instead.
void stop()
Stops the timer.
bool isActive() const noexcept
Returns true if the timer is running and has not been stopped; otherwise returns false.
\inmodule QtCore \reentrant
The QClipboard class provides access to the window system clipboard.
void setMimeData(QMimeData *data, Mode mode=Clipboard)
Sets the clipboard data to src.
const QMimeData * mimeData(Mode mode=Clipboard) const
Returns a pointer to a QMimeData representation of the current clipboard data (can be \nullptr if the...
bool supportsSelection() const
Returns true if the clipboard supports mouse selection; otherwise returns false.
Mode
\keyword clipboard mode
static bool openUrl(const QUrl &url)
Opens the given url in the appropriate Web browser for the user's desktop environment,...
Qt::DropAction exec(Qt::DropActions supportedActions=Qt::MoveAction)
void setMimeData(QMimeData *data)
Sets the data to be sent to the given MIME data.
QObject * target() const
Returns the target of the drag and drop operation.
Type
This enum type defines the valid event types in Qt.
@ GraphicsSceneContextMenu
@ GraphicsSceneMouseRelease
@ GraphicsSceneMousePress
@ GraphicsSceneHoverLeave
@ GraphicsSceneMouseDoubleClick
@ GraphicsSceneHoverEnter
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
The QFocusEvent class contains event parameters for widget focus events.
\reentrant \inmodule QtGui
int horizontalAdvance(const QString &, int len=-1) const
Returns the horizontal advance in pixels of the first len characters of text.
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framewor...
Qt::DropAction dropAction() const
Returns the action that was performed in this drag and drop.
const QMimeData * mimeData() const
This function returns the MIME data of the event.
void acceptProposedAction()
Sets the proposed action as accepted, i.e, the drop action is set to the proposed action.
QWidget * source() const
This function returns the QGraphicsView that created the QGraphicsSceneDragDropEvent.
QPointF pos() const
Returns the mouse position of the event relative to the view that sent the event.
The QGraphicsSceneEvent class provides a base class for all graphics view related events.
QWidget * widget() const
Returns the widget where the event originated, or \nullptr if the event originates from another appli...
The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
QPointF pos() const
Returns the position of the mouse cursor in item coordinates at the moment the hover event was sent.
QPoint screenPos() const
Returns the position of the mouse cursor in screen coordinates at the moment the hover event was sent...
Qt::KeyboardModifiers modifiers() const
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
Qt::MouseButton button() const
Returns the mouse button (if any) that caused the event.
QPointF pos() const
Returns the mouse cursor position in item coordinates.
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifiers in use at the time the event was sent.
QPoint screenPos() const
Returns the mouse cursor position in screen coordinates.
Qt::MouseButtons buttons() const
Returns the combination of mouse buttons that were pressed at the time the event was sent.
static QClipboard * clipboard()
Returns the object for interacting with the clipboard.
static QStyleHints * styleHints()
Returns the application's style hints.
static QInputMethod * inputMethod()
returns the input method.
The QHelpEvent class provides an event that is used to request helpful information about a particular...
const QPoint & globalPos() const
Returns the mouse cursor position when the event was generated in global coordinates.
const QPoint & pos() const
Returns the mouse cursor position when the event was generated, relative to the widget to which the e...
The QIcon class provides scalable icons in different modes and states.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
static QIcon fromTheme(const QString &name)
The QKeyEvent class describes a key event.
@ InsertParagraphSeparator
bool isEmpty() const override
\reimp
The QLineEdit widget is a one-line text editor.
void insert(const QString &)
Deletes any selected text, inserts newText, and validates the result.
qsizetype size() const noexcept
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
const_iterator constBegin() const noexcept
void remove(qsizetype i, qsizetype n=1)
void prepend(rvalue_ref t)
void reserve(qsizetype size)
void append(parameter_type t)
const_iterator constEnd() const noexcept
void setData(const QString &mimetype, const QByteArray &data)
Sets the data associated with the MIME type given by mimeType to the specified data.
void setText(const QString &text)
Sets text as the plain text (MIME type text/plain) used to represent the data.
virtual QVariant retrieveData(const QString &mimetype, QMetaType preferredType) const
Returns a variant with the given type containing data for the MIME type specified by mimeType.
virtual QStringList formats() const
Returns a list of formats supported by the object.
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
QVariant property(const char *name) const
Returns the value of the object's name property.
static QPagedPaintDevicePrivate * get(QPagedPaintDevice *pd)
The QPainter class performs low-level painting on widgets and other paint devices.
The QPalette class contains color groups for each widget state.
ColorGroup
\value Disabled \value Active \value Inactive \value Normal synonym for Active
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns fa...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr void setRight(qreal pos) noexcept
Sets the right edge of the rectangle to the given finite x coordinate.
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr bool isValid() const noexcept
Returns true if the rectangle is valid, otherwise returns false.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
\inmodule QtCore \reentrant
QPointF globalPosition() const
Returns the position of the point in this event on the screen or virtual desktop.
QPointF position() const
Returns the position of the point in this event, relative to the widget or item that received the eve...
Qt::MouseButton button() const
Returns the button that caused the event.
Qt::MouseButtons buttons() const
Returns the button state when the event was generated.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isNull() const
Returns true if this string is null; otherwise returns false.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QByteArray toUtf8() const &
The QStyleHintReturnVariant class provides style hints that return a QVariant.
void cursorFlashTimeChanged(int cursorFlashTime)
int cursorFlashTime
the text cursor's flash (blink) time in milliseconds.
bool useRtlExtensions
the writing direction.
The QStyleOption class stores the parameters used by QStyle functions.
void initFrom(const QWidget *w)
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
@ SH_TextControl_FocusIndicatorTextCharFormat
@ SH_BlinkCursorWhenTextSelected
@ SH_RichText_FullWidthSelection
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
void setIndent(int indent)
Sets the paragraph's indentation.
int indent() const
Returns the paragraph's indent.
bool atEnd() const
Returns true if the current item is the last item in the text block.
iterator begin() const
Returns a text block iterator pointing to the beginning of the text block.
iterator Iterator
Qt-style synonym for QTextBlock::iterator.
int length() const
Returns the length of the block in characters.
QTextBlockFormat blockFormat() const
Returns the QTextBlockFormat that describes block-specific properties.
iterator end() const
Returns a text block iterator pointing to the end of the text block.
bool isValid() const
Returns true if this text block is valid; otherwise returns false.
QTextBlock next() const
Returns the text block in the document after this block, or an empty text block if this is the last o...
QTextLayout * layout() const
Returns the QTextLayout that is used to lay out and display the block's contents.
int position() const
Returns the index of the block's first character within the document.
QString text() const
Returns the block's contents as plain text.
QTextBlock previous() const
Returns the text block in the document before this block, or an empty text block if this is the first...
bool isValid() const
Returns true if this character format is valid; otherwise returns false.
QString anchorHref() const
Returns the text format's hypertext link, or an empty string if none has been set.
\reentrant \inmodule QtGui
QString selectedText() const
Returns the current selection's text (which may be empty).
QTextBlockFormat blockFormat() const
Returns the block format of the block the cursor is in.
QTextCharFormat charFormat() const
Returns the format of the character immediately before the cursor position().
QTextBlock block() const
Returns the block that contains the cursor.
void beginEditBlock()
Indicates the start of a block of editing operations on the document that should appear as a single o...
bool atBlockStart() const
Returns true if the cursor is at the start of a block; otherwise returns false.
void setPosition(int pos, MoveMode mode=MoveAnchor)
Moves the cursor to the absolute position in the document specified by pos using a MoveMode specified...
int selectionStart() const
Returns the start of the selection or position() if the cursor doesn't have a selection.
bool movePosition(MoveOperation op, MoveMode=MoveAnchor, int n=1)
Moves the cursor by performing the given operation n times, using the specified mode,...
bool atBlockEnd() const
Returns true if the cursor is at the end of a block; otherwise returns false.
int anchor() const
Returns the anchor position; this is the same as position() unless there is a selection in which case...
void insertHtml(const QString &html)
void clearSelection()
Clears the current selection by setting the anchor to the cursor position.
void insertFragment(const QTextDocumentFragment &fragment)
Inserts the text fragment at the current position().
bool isNull() const
Returns true if the cursor is null; otherwise returns false.
MoveMode
\value MoveAnchor Moves the anchor to the same position as the cursor itself.
void setBlockFormat(const QTextBlockFormat &format)
Sets the block format of the current block (or all blocks that are contained in the selection) to for...
void setCharFormat(const QTextCharFormat &format)
Sets the cursor's current character format to the given format.
bool visualNavigation() const
void removeSelectedText()
If there is a selection, its content is deleted; otherwise does nothing.
int selectionEnd() const
Returns the end of the selection or position() if the cursor doesn't have a selection.
void select(SelectionType selection)
Selects text in the document according to the given selection.
void insertText(const QString &text)
Inserts text at the current position, using the current character format.
QTextList * currentList() const
Returns the current list if the cursor position() is inside a block that is part of a list; otherwise...
void setVisualNavigation(bool b)
bool isCopyOf(const QTextCursor &other) const
Returns true if this cursor and other are copies of each other, i.e.
void insertBlock()
Inserts a new empty block at the cursor position() with the current blockFormat() and charFormat().
bool hasSelection() const
Returns true if the cursor contains a selection; otherwise returns false.
void endEditBlock()
Indicates the end of a block of editing operations on the document that should appear as a single ope...
MoveOperation
\value NoMove Keep the cursor where it is
void mergeBlockFormat(const QTextBlockFormat &modifier)
Modifies the block format of the current block (or all blocks that are contained in the selection) wi...
bool hasComplexSelection() const
Returns true if the cursor contains a selection that is not simply a range from selectionStart() to s...
QTextTable * currentTable() const
Returns a pointer to the current table if the cursor position() is inside a block that is part of a t...
void deletePreviousChar()
If there is no selected text, deletes the character before the current cursor position; otherwise del...
int position() const
Returns the absolute position of the cursor within the document.
void deleteChar()
If there is no selected text, deletes the character at the current cursor position; otherwise deletes...
QTextFrame * currentFrame() const
Returns a pointer to the current frame.
QTextList * createList(const QTextListFormat &format)
Creates and returns a new list with the given format, and makes the current paragraph the cursor is i...
QString toPlainText() const
This function returns the same as toRawText(), but will replace some unicode characters with ASCII al...
bool isEmpty() const
Returns true if the fragment is empty; otherwise returns false.
static QTextDocumentFragment fromHtml(const QString &html, const QTextDocument *resourceProvider=nullptr)
static QTextDocumentFragment fromPlainText(const QString &plainText)
Returns a document fragment that contains the given plainText.
The QTextDocumentWriter class provides a format-independent interface for writing a QTextDocument to ...
\reentrant \inmodule QtGui
void setModified(bool m=true)
void contentsChange(int from, int charsRemoved, int charsAdded)
This signal is emitted whenever the document's content changes; for example, when text is inserted or...
void setHtml(const QString &html)
Replaces the entire contents of the document with the given HTML-formatted text in the html string.
bool isEmpty() const
Returns true if the document is empty; otherwise returns false.
void setResourceProvider(const ResourceProvider &provider)
QFont defaultFont
the default font used to display the document's text
void redoAvailable(bool)
This signal is emitted whenever redo operations become available (available is true) or unavailable (...
QString toHtml() const
Returns a string containing an HTML representation of the document.
QAbstractTextDocumentLayout * documentLayout() const
Returns the document layout for this document.
bool useDesignMetrics
whether the document uses design metrics of fonts to improve the accuracy of text layout
QSizeF pageSize
the page size that should be used for laying out the document
void modificationChanged(bool m)
This signal is emitted whenever the content of the document changes in a way that affects the modific...
virtual void clear()
Clears the document.
bool isUndoRedoEnabled() const
void print(QPagedPaintDevice *printer) const
Prints the document to the given printer.
void setDefaultFont(const QFont &font)
Sets the default font to use in the document layout.
void setPageSize(const QSizeF &size)
void undoAvailable(bool)
This signal is emitted whenever undo operations become available (available is true) or unavailable (...
QTextDocument::ResourceProvider resourceProvider() const
void cursorPositionChanged(const QTextCursor &cursor)
This signal is emitted whenever the position of a cursor changed due to an editing operation.
void setUndoRedoEnabled(bool enable)
QString toPlainText() const
Returns the plain text contained in the document.
void contentsChanged()
This signal is emitted whenever the document's content changes; for example, when text is inserted or...
QTextBlock findBlock(int pos) const
Returns the text block that contains the {pos}-th character.
QString metaInformation(MetaInformation info) const
Returns meta information about the document of the type specified by info.
void setPlainText(const QString &text)
Replaces the entire contents of the document with the given plain text.
void setMetaInformation(MetaInformation info, const QString &)
Sets the document's meta information of the type specified by info to the given string.
void documentLayoutChanged()
void blockCountChanged(int newBlockCount)
void setUseDesignMetrics(bool b)
int characterCount() const
virtual QVariant retrieveData(const QString &mimeType, QMetaType type) const override
Returns a variant with the given type containing data for the MIME type specified by mimeType.
virtual QStringList formats() const override
Returns a list of formats supported by the object.
The QTextEdit class provides a widget that is used to edit and display both plain and rich text.
@ BlockTrailingHorizontalRulerWidth
bool boolProperty(int propertyId) const
Returns the value of the property specified by propertyId.
bool hasProperty(int propertyId) const
Returns true if the text format has a property with the given propertyId; otherwise returns false.
void clearProperty(int propertyId)
Clears the value of the property given by propertyId.
void merge(const QTextFormat &other)
Merges the other format with this format; where there are conflicts the other format takes precedence...
QTextCharFormat charFormat() const
Returns the text fragment's character format.
int length() const
Returns the number of characters in the text fragment.
int position() const
Returns the position of this text fragment in the document.
QTextLine lineForTextPosition(int pos) const
Returns the line that contains the cursor position specified by pos.
int lineCount() const
Returns the number of lines in this text layout.
QFont font() const
Returns the current font that is used for the layout, or a default font if none is set.
QString preeditAreaText() const
Returns the text that is inserted in the layout before editing occurs.
int textStart() const
Returns the start of the line from the beginning of the string passed to the QTextLayout.
int lineNumber() const
Returns the position of the line in the text engine.
void setStyle(Style style)
Sets the list format's style.
void setIndent(int indent)
Sets the list format's indentation.
int indent() const
Returns the list format's indentation.
int columnSpan() const
Returns the number of columns this cell spans.
int row() const
Returns the number of the row in the table that contains this cell.
QTextCursor firstCursorPosition() const
Returns the first valid cursor position in this cell.
int column() const
Returns the number of the column in the table that contains this cell.
int toInt(bool *ok=nullptr) const
Returns the variant as an int if the variant has userType() \l QMetaType::Int, \l QMetaType::Bool,...
void focusEvent(QFocusEvent *e)
void _q_updateBlock(const QTextBlock &)
void mouseReleaseEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos, Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons, const QPoint &globalPos)
void setCursorVisible(bool visible)
void gotoPreviousTableCell()
void _q_contentsChanged(int from, int charsRemoved, int charsAdded)
void setClipboardSelection()
void setContent(Qt::TextFormat format=Qt::RichText, const QString &text=QString(), QTextDocument *document=nullptr)
void insertParagraphSeparator()
QTextBlock blockWithMarkerUnderMouse
bool wordSelectionEnabled
void setCursorPosition(const QPointF &pos)
Qt::TextInteractionFlags interactionFlags
void contextMenuEvent(const QPoint &screenPos, const QPointF &docPos, QWidget *contextWidget)
void selectionChanged(bool forceEmitSelectionChanged=false)
void repaintOldAndNewSelection(const QTextCursor &oldSelection)
QWidgetTextControlPrivate()
void extendWordwiseSelection(int suggestedNewPosition, qreal mouseXPosition)
void _q_emitCursorPosChanged(const QTextCursor &someCursor)
bool dragEnterEvent(QEvent *e, const QMimeData *mimeData)
void updateCurrentCharFormat()
void _q_documentLayoutChanged()
bool sendMouseEventToInputContext(QEvent *e, QEvent::Type eventType, Qt::MouseButton button, const QPointF &pos, Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons, const QPoint &globalPos)
bool ignoreUnusedNavigationEvents
void init(Qt::TextFormat format=Qt::RichText, const QString &text=QString(), QTextDocument *document=nullptr)
QString highlightedAnchor
bool hadSelectionOnMousePress
bool isPreediting() const
QRectF rectForPosition(int position) const
QPointer< QWidget > contextWidget
QBasicTimer cursorBlinkTimer
bool cursorIsFocusIndicator
int lastSelectionPosition
void setBlinkingCursorEnabled(bool enable)
bool cursorMoveKeyEvent(QKeyEvent *e)
QRectF cursorRectPlusUnicodeDirectionMarkers(const QTextCursor &cursor) const
QString anchorForCursor(const QTextCursor &anchor) const
void append(const QString &text, Qt::TextFormat format=Qt::AutoText)
bool dragMoveEvent(QEvent *e, const QMimeData *mimeData, const QPointF &pos)
QTextCursor selectedWordOnDoubleClick
void inputMethodEvent(QInputMethodEvent *)
void _q_updateCurrentCharFormatAndSelection()
void activateLinkUnderCursor(QString href=QString())
void keyPressEvent(QKeyEvent *e)
void createAutoBulletList()
void mousePressEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos, Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons, const QPoint &globalPos)
QPointF trippleClickPoint
void updateCursorBlinking()
QString anchorOnMousePress
bool dropEvent(const QMimeData *mimeData, const QPointF &pos, Qt::DropAction dropAction, QObject *source)
QBasicTimer trippleClickTimer
QTextCursor selectedBlockOnTrippleClick
QTextCharFormat lastCharFormat
void mouseMoveEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos, Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons, const QPoint &globalPos)
QTextCursor dndFeedbackCursor
void extendBlockwiseSelection(int suggestedNewPosition)
void mouseDoubleClickEvent(QEvent *e, Qt::MouseButton button, const QPointF &pos, Qt::KeyboardModifiers modifiers, Qt::MouseButtons buttons, const QPoint &globalPos)
void setPlainText(const QString &text)
bool ignoreUnusedNavigationEvents
virtual bool event(QEvent *e) override
This virtual function receives events to an object and should return true if the event e was recogniz...
void mergeCurrentCharFormat(const QTextCharFormat &modifier)
bool setFocusToNextOrPreviousAnchor(bool next)
QRectF cursorRect() const
QTextCursor textCursor() const
void setCursorWidth(int width)
void redoAvailable(bool b)
Qt::TextInteractionFlags textInteractionFlags
QString toPlainText() const
void setCursorIsFocusIndicator(bool b)
bool isDragEnabled() const
void insertHtml(const QString &text)
QTextCharFormat currentCharFormat() const
void appendPlainText(const QString &text)
void setOpenExternalLinks(bool open)
void setIgnoreUnusedNavigationEvents(bool ignore)
void setHtml(const QString &text)
void cursorPositionChanged()
virtual QMimeData * createMimeDataFromSelection() const
void setOverwriteMode(bool overwrite)
QAbstractTextDocumentLayout::PaintContext getPaintContext(QWidget *widget) const
void setTextCursor(const QTextCursor &cursor, bool selectionClipboard=false)
virtual Q_INVOKABLE QVariant loadResource(int type, const QUrl &name)
void print(QPagedPaintDevice *printer) const
void undoAvailable(bool b)
void setAcceptRichText(bool accept)
void moveCursor(QTextCursor::MoveOperation op, QTextCursor::MoveMode mode=QTextCursor::MoveAnchor)
void paste(QClipboard::Mode mode=QClipboard::Clipboard)
void modificationChanged(bool m)
QTextBlock blockWithMarkerAt(const QPointF &pos) const
virtual void ensureCursorVisible()
void setFocus(bool focus, Qt::FocusReason=Qt::OtherFocusReason)
void setDragEnabled(bool enabled)
void updateRequest(const QRectF &rect=QRectF())
void setDocument(QTextDocument *document)
void drawContents(QPainter *painter, const QRectF &rect=QRectF(), QWidget *widget=nullptr)
virtual QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const
virtual ~QWidgetTextControl()
virtual QString anchorAt(const QPointF &pos) const
QTextCursor cursorForPosition(const QPointF &pos) const
virtual QRectF blockBoundingRect(const QTextBlock &block) const
virtual void processEvent(QEvent *e, const QTransform &transform, QWidget *contextWidget=nullptr)
void append(const QString &text)
void documentSizeChanged(const QSizeF &)
bool setFocusToAnchor(const QTextCursor &newCursor)
bool isWordSelectionEnabled() const
QPointF anchorPosition(const QString &name) const
virtual int hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const
QMenu * createStandardContextMenu(const QPointF &pos, QWidget *parent)
bool find(const QString &exp, QTextDocument::FindFlags options={ })
virtual void insertFromMimeData(const QMimeData *source)
bool findNextPrevAnchor(const QTextCursor &from, bool next, QTextCursor &newAnchor)
QRectF selectionRect() const
QString anchorAtCursor() const
void insertPlainText(const QString &text)
bool cursorIsFocusIndicator() const
void setWordSelectionEnabled(bool enabled)
void setCurrentCharFormat(const QTextCharFormat &format)
QWidgetTextControl(QObject *parent=nullptr)
void visibilityRequest(const QRectF &rect)
virtual bool canInsertFromMimeData(const QMimeData *source) const
void setPalette(const QPalette &pal)
virtual void timerEvent(QTimerEvent *e) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QTextDocument * document() const
void setTextWidth(qreal width)
void appendHtml(const QString &html)
void blockCountChanged(int newBlockCount)
void setTextInteractionFlags(Qt::TextInteractionFlags flags)
EGLImageKHR int int EGLuint64KHR * modifiers
QHash< int, QWidget * > hash
[35multi]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
@ NavigationModeKeypadDirectional
@ LinksAccessibleByKeyboard
@ TextSelectableByKeyboard
Q_GUI_EXPORT bool mightBeRichText(const QString &)
Returns true if the string text is likely to be rich text; otherwise returns false.
@ ActiveWindowFocusReason
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
GLsizei GLsizei GLchar * source
GLuint GLenum GLenum transform
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void * table
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define QStringLiteral(str)
QStyleSheetStyle * qt_styleSheet(QStyle *style)
#define QT_CONFIG(feature)
#define QT_TRANSLATE_NOOP(scope, x)
QVideoFrameFormat::PixelFormat fmt
static QRectF boundingRectOfFloatsInSelection(const QTextCursor &cursor)
const struct QUnicodeControlCharacter qt_controlCharacters[NUM_CONTROL_CHARACTERS]
#define NUM_CONTROL_CHARACTERS
static QTextLine currentTextLine(const QTextCursor &cursor)
void setActionIcon(QAction *action, const QString &name)
void setActionIcon(QAction *action, const QString &name)
if(qFloatDistance(a, b)<(1<< 7))
[0]
file open(QIODevice::ReadOnly)
myObject disconnect()
[26]
QItemSelection * selection
[0]
\reentrant \inmodule QtGui
\variable QAbstractTextDocumentLayout::PaintContext::cursorPosition
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent