15#if QT_CONFIG(regularexpression)
29#include "private/qdataurl_p.h"
32#include <private/qabstracttextdocumentlayout_p.h>
34#include "private/qpagedpaintdevice_p.h"
35#if QT_CONFIG(textmarkdownreader)
36#include <private/qtextmarkdownimporter_p.h>
38#if QT_CONFIG(textmarkdownwriter)
39#include <private/qtextmarkdownwriter_p.h>
109 QVarLengthArray<char16_t>
tag;
112 if (current.isDigit() || current.isLetter())
113 tag.append(current.toLower().unicode());
114 else if (!
tag.isEmpty() && current.isSpace())
116 else if (!
tag.isEmpty() && current == u
'/' &&
i + 1 == close)
118 else if (!current.isSpace() && (!
tag.isEmpty() || current != u
'!'))
121#ifndef QT_NO_TEXTHTMLPARSER
157 if (plain[
i] == u
'\n'){
159 while (
i+1 < plain.size() && plain[
i+1] == u
'\n') {
183 else if (plain[
i] == u
'<')
185 else if (plain[
i] == u
'>')
187 else if (plain[
i] == u
'&')
325 const auto blockFormat = thisCursor.blockFormat();
326 if (blockFormat.isValid() && !blockFormat.isEmpty())
329 const auto blockCharFormat = thisCursor.blockCharFormat();
330 if (blockCharFormat.isValid() && !blockCharFormat.isEmpty())
337 priv->title =
d->title;
339 priv->cssMedia =
d->cssMedia;
340 priv->pageSize =
d->pageSize;
341 priv->indentWidth =
d->indentWidth;
342 priv->defaultTextOption =
d->defaultTextOption;
343 priv->setDefaultFont(
d->defaultFont());
344 priv->resources =
d->resources;
345 priv->cachedResources.clear();
346 priv->resourceProvider =
d->resourceProvider;
347#ifndef QT_NO_CSSPARSER
348 priv->defaultStyleSheet =
d->defaultStyleSheet;
349 priv->parsedDefaultStyleSheet =
d->parsedDefaultStyleSheet;
362 return d->length() <= 1;
372 d->resources.clear();
390 const int pos =
d->undoRedo(
true);
407 const int pos =
d->undoRedo(
false);
435 d->clearUndoRedoStacks(stacksToClear,
true);
466 d->appendUndoItem(
item);
485 return d->isUndoRedoEnabled();
512 return d->maximumBlockCount;
518 d->maximumBlockCount = maximum;
519 d->ensureMaximumBlockCount();
533 return d->defaultTextOption;
546 d->lout->documentChanged(0, 0,
d->length());
574 if (
d->baseUrl !=
url) {
577 d->lout->documentChanged(0, 0,
d->length());
591 return d->defaultCursorMoveStyle;
602 d->defaultCursorMoveStyle = style;
615 d->documentChange(from,
length);
616 if (!
d->inContentsChange) {
618 d->lout->documentChanged(
d->docChangeFrom,
d->docChangeOldLength,
d->docChangeLength);
619 d->docChangeFrom = -1;
643 if (
b ==
d->defaultTextOption.useDesignMetrics())
645 d->defaultTextOption.setUseDesignMetrics(
b);
647 d->lout->documentChanged(0, 0,
d->length());
653 return d->defaultTextOption.useDesignMetrics();
677 if (
d->layoutEnabled ==
b)
679 d->layoutEnabled =
b;
681 d->lout->documentChanged(0, 0,
d->length());
687 return d->layoutEnabled;
700 if (
rect.isValid()) {
701 p->setClipRect(
rect);
734 qCDebug(lcLayout) <<
"page size" << sz <<
"-> width" <<
width;
743 return d->pageSize.width();
757 return lout->idealWidth();
770 return d->documentMargin;
776 if (
d->documentMargin != margin) {
777 d->documentMargin = margin;
785 d->lout->documentChanged(0, 0,
d->length());
802 return d->indentWidth;
819 if (
d->indentWidth !=
width) {
822 d->lout->documentChanged(0, 0,
d->length());
841 int mw = fm.horizontalAdvance(u
'x') * 80;
845 if (
size.width() != 0) {
850 if (
w*3 < 5*
size.height()) {
894 return d->blockMap().numNodes();
909 return d->blockMap().length(2);
939 if (pos < 0 || pos >=
d->length())
943 const int offsetInFragment =
qMax(0,
pos - fragIt.position());
944 return d->text.at(frag->stringPosition + offsetInFragment);
963#ifndef QT_NO_CSSPARSER
967 d->defaultStyleSheet = sheet;
971 parser.
parse(&
d->parsedDefaultStyleSheet);
977 return d->defaultStyleSheet;
1065 return d->isUndoAvailable();
1076 return d->isRedoAvailable();
1088 return d->availableUndoSteps();
1100 return d->availableRedoSteps();
1163 return d->frontMatter;
1204 return d->plainText();
1229 constexpr char16_t delims[] = { 0xfdd0, 0xfdd1,
1230 QChar::ParagraphSeparator, QChar::LineSeparator, QChar::Nbsp };
1232 const size_t pos = std::u16string_view(
txt).find_first_of(
1233 std::u16string_view(delims, std::size(delims)));
1234 if (
pos == std::u16string_view::npos)
1240 for (uc +=
pos; uc != e; ++uc) {
1241 switch (uc->unicode()) {
1244 case QChar::ParagraphSeparator:
1245 case QChar::LineSeparator:
1267 bool previousState =
d->isUndoRedoEnabled();
1268 d->enableUndoRedo(
false);
1269 d->beginEditBlock();
1273 d->enableUndoRedo(previousState);
1295#ifndef QT_NO_TEXTHTMLPARSER
1300 bool previousState =
d->isUndoRedoEnabled();
1301 d->enableUndoRedo(
false);
1302 d->beginEditBlock();
1308 d->enableUndoRedo(previousState);
1360 const int start = idx;
1399 if (subString.isEmpty())
1419 block = block.
next();
1423 if (blockOffset == block.
length() - 1)
1429 blockOffset = block.
length() - 2;
1461 return find(subString,
pos, options);
1464#if QT_CONFIG(regularexpression)
1480 const int start = idx;
1549 block = block.
next();
1557 blockOffset = block.
length() - 1;
1592 return find(expr,
pos, options);
1608 if (
f.isListFormat())
1610 else if (
f.isTableFormat())
1612 else if (
f.isFrameFormat())
1626 return d->frameAt(
pos);
1635 return d->rootFrame();
1644 return d->objectForIndex(objectIndex);
1653 return d->objectForFormat(
f);
1758 d->lout->documentChanged(0, 0,
d->length());
1781 d->setDefaultFont(
font);
1783 d->lout->documentChanged(0, 0,
d->length());
1792 return d->defaultFont();
1807 d->formats.setSuperScriptBaseline(baseline);
1821 return d->formats.defaultTextFormat().superScriptBaseline();
1836 d->formats.setSubScriptBaseline(baseline);
1850 return d->formats.defaultTextFormat().subScriptBaseline();
1866 d->formats.setBaselineOffset(baseline);
1881 return d->formats.defaultTextFormat().baselineOffset();
1910 return d->isModified();
1919#ifndef QT_NO_PRINTER
1939 if (!pageNumberPos.isNull()) {
1977 bool documentPaginated =
d->pageSize.isValid() && !
d->pageSize.isNull()
1978 &&
d->pageSize.height() != INT_MAX;
1982 if (!documentPaginated &&
m.left() == 0. &&
m.right() == 0. &&
m.top() == 0. &&
m.bottom() == 0.) {
1998 QScopedPointer<QTextDocument> clonedDoc;
2009 if (documentPaginated) {
2018 p.scale(dpiScaleX, dpiScaleY);
2020 QSizeF scaledPageSize =
d->pageSize;
2021 scaledPageSize.
rwidth() *= dpiScaleX;
2022 scaledPageSize.rheight() *= dpiScaleY;
2027 p.scale(printerPageSize.width() / scaledPageSize.width(),
2028 printerPageSize.height() / scaledPageSize.height());
2034 srcBlock.isValid() && dstBlock.isValid();
2035 srcBlock = srcBlock.next(), dstBlock = dstBlock.next()) {
2036 dstBlock.layout()->setFormats(srcBlock.layout()->formats());
2040 layout->setPaintDevice(
p.device());
2046 const int horizontalMargin = int((2/2.54)*sourceDpiX);
2047 const int verticalMargin = int((2/2.54)*sourceDpiY);
2050 fmt.setRightMargin(horizontalMargin);
2051 fmt.setTopMargin(verticalMargin);
2052 fmt.setBottomMargin(verticalMargin);
2056 const int dpiy =
p.device()->logicalDpiY();
2058 pageNumberPos =
QPointF(body.
width() - horizontalMargin * dpiScaleX,
2059 body.
height() - verticalMargin * dpiScaleY
2062 clonedDoc->setPageSize(body.
size());
2067 int toPage = pageRanges.
lastPage();
2069 if (fromPage == 0 && toPage == 0) {
2074 fromPage =
qMax(1, fromPage);
2077 if (toPage < fromPage) {
2091 int page = fromPage;
2154 r =
d->cachedResources.value(
url);
2158 if (
d->resourceProvider)
2159 r =
d->resourceProvider(
url);
2161 r = defaultProvider(
url);
2203 return d->resourceProvider;
2223 d->resourceProvider = provider;
2238 qt_defaultResourceProvider = provider;
2250 return qt_defaultResourceProvider;
2297 if (!qobject_cast<QTextDocument *>(
p) &&
r.isNull()) {
2300 if (
name.isRelative()) {
2305 || (currentURL.
scheme() ==
"file"_L1
2307 || (
name.hasFragment() &&
name.path().isEmpty())) {
2317 }
else if (currentURL.
isEmpty()) {
2318 resourceUrl.setScheme(
"file"_L1);
2323 QString s = resourceUrl.toLocalFile();
2336 image.loadFromData(
r.toByteArray());
2337 if (!
image.isNull())
2346 d->cachedResources.insert(
name,
r);
2368 if (
color.alpha() == 255) {
2370 }
else if (
color.alpha()) {
2372 while (alphaValue.size() > 1 && alphaValue.at(alphaValue.size() - 1) == u
'0')
2374 if (alphaValue.at(alphaValue.size() - 1) == u
'.')
2381 result =
"transparent"_L1;
2388 : doc(_doc), fragmentMarkers(
false)
2391 defaultCharFormat.
setFont(defaultFont);
2396 return format.fontFamilies().toStringList();
2406 html =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" "
2407 "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
2408 "<html><head><meta name=\"qrichtext\" content=\"1\" />"_L1;
2413 html +=
"<meta charset=\"utf-8\" />"_L1;
2417 html +=
"<title>"_L1;
2419 html +=
"</title>"_L1;
2421 html +=
"<style type=\"text/css\">\n"_L1;
2422 html +=
"p, li { white-space: pre-wrap; }\n"_L1;
2423 html +=
"hr { height: 1px; border-width: 0; }\n"_L1;
2424 html +=
"li.unchecked::marker { content: \"\\2610\"; }\n"_L1;
2425 html +=
"li.checked::marker { content: \"\\2612\"; }\n"_L1;
2426 html +=
"</style>"_L1;
2427 html +=
"</head><body"_L1;
2430 html +=
" style=\""_L1;
2435 html +=
" font-size:"_L1;
2439 html +=
" font-size:"_L1;
2444 html +=
" font-weight:"_L1;
2448 html +=
" font-style:"_L1;
2449 html += (defaultCharFormat.
fontItalic() ?
"italic"_L1 :
"normal"_L1);
2455 html +=
" letter-spacing:"_L1;
2460 html += percentSpacing ?
"em;"_L1 :
"px;"_L1;
2465 html +=
" word-spacing:"_L1;
2470 QString decorationTag(
" text-decoration:"_L1);
2471 bool atLeastOneDecorationSet =
false;
2474 decorationTag +=
" underline"_L1;
2475 atLeastOneDecorationSet =
true;
2480 decorationTag +=
" overline"_L1;
2481 atLeastOneDecorationSet =
true;
2486 decorationTag +=
" line-through"_L1;
2487 atLeastOneDecorationSet =
true;
2490 if (atLeastOneDecorationSet)
2491 html += decorationTag + u
';';
2496 emitBackgroundAttribute(
fmt);
2509 if (rootFmt == defaultFmt)
2514 html +=
"</body></html>"_L1;
2529 bool attributesEmitted =
false;
2534 emitFontFamily(families);
2535 attributesEmitted =
true;
2541 html +=
" font-size:"_L1;
2544 attributesEmitted =
true;
2546 static const char sizeNameData[] =
2550 static const quint8 sizeNameOffsets[] = {
2553 sizeof(
"small") +
sizeof(
"medium") + 3,
2554 sizeof(
"small") +
sizeof(
"medium") + 1,
2555 sizeof(
"small") +
sizeof(
"medium"),
2557 const char *
name =
nullptr;
2559 if (idx >= 0 && idx <= 4) {
2560 name = sizeNameData + sizeNameOffsets[idx];
2563 html +=
" font-size:"_L1;
2566 attributesEmitted =
true;
2571 html +=
" font-size:"_L1;
2574 attributesEmitted =
true;
2579 html +=
" font-weight:"_L1;
2582 attributesEmitted =
true;
2587 html +=
" font-style:"_L1;
2588 html += (
format.fontItalic() ?
"italic"_L1 :
"normal"_L1);
2590 attributesEmitted =
true;
2593 const auto decorationTag =
" text-decoration:"_L1;
2594 html += decorationTag;
2595 bool hasDecoration =
false;
2596 bool atLeastOneDecorationSet =
false;
2600 hasDecoration =
true;
2601 if (
format.fontUnderline()) {
2602 html +=
" underline"_L1;
2603 atLeastOneDecorationSet =
true;
2609 hasDecoration =
true;
2610 if (
format.fontOverline()) {
2611 html +=
" overline"_L1;
2612 atLeastOneDecorationSet =
true;
2618 hasDecoration =
true;
2619 if (
format.fontStrikeOut()) {
2620 html +=
" line-through"_L1;
2621 atLeastOneDecorationSet =
true;
2625 if (hasDecoration) {
2626 if (!atLeastOneDecorationSet)
2630 html +=
" text-decoration-color:"_L1;
2634 attributesEmitted =
true;
2636 html.
chop(decorationTag.size());
2646 html +=
" -qt-fg-texture-cachekey:"_L1;
2656 html +=
" -qt-foreground: qlineargradient("_L1;
2657 html +=
"x1:"_L1 +
QString::number(linearGradient->start().x()) + u
',';
2658 html +=
"y1:"_L1 +
QString::number(linearGradient->start().y()) + u
',';
2659 html +=
"x2:"_L1 +
QString::number(linearGradient->finalStop().x()) + u
',';
2660 html +=
"y2:"_L1 +
QString::number(linearGradient->finalStop().y()) + u
',';
2664 html +=
" -qt-foreground: qradialgradient("_L1;
2665 html +=
"cx:"_L1 +
QString::number(radialGradient->center().x()) + u
',';
2666 html +=
"cy:"_L1 +
QString::number(radialGradient->center().y()) + u
',';
2667 html +=
"fx:"_L1 +
QString::number(radialGradient->focalPoint().x()) + u
',';
2668 html +=
"fy:"_L1 +
QString::number(radialGradient->focalPoint().y()) + u
',';
2669 html +=
"radius:"_L1 +
QString::number(radialGradient->radius()) + u
',';
2673 html +=
" -qt-foreground: qconicalgradient("_L1;
2674 html +=
"cx:"_L1 +
QString::number(conicalGradient->center().x()) + u
',';
2675 html +=
"cy:"_L1 +
QString::number(conicalGradient->center().y()) + u
',';
2676 html +=
"angle:"_L1 +
QString::number(conicalGradient->angle()) + u
',';
2679 const QStringList coordinateModes = {
"logical"_L1,
"stretchtodevice"_L1,
"objectbounding"_L1,
"object"_L1 };
2680 html +=
"coordinatemode:"_L1;
2684 const QStringList spreads = {
"pad"_L1,
"reflect"_L1,
"repeat"_L1 };
2685 html +=
"spread:"_L1;
2686 html += spreads.
at(
int(gradient->
spread()));
2689 html +=
",stop:"_L1;
2697 html +=
" color:"_L1;
2701 attributesEmitted =
true;
2706 html +=
" background-color:"_L1;
2709 attributesEmitted =
true;
2715 html +=
" vertical-align:"_L1;
2723 html +=
"middle"_L1;
2727 html +=
"bottom"_L1;
2730 attributesEmitted =
true;
2736 html +=
" text-transform:uppercase;"_L1;
2738 html +=
" text-transform:lowercase;"_L1;
2740 html +=
" font-variant:small-caps;"_L1;
2741 attributesEmitted =
true;
2744 if (
format.fontWordSpacing() != 0.0) {
2745 html +=
" word-spacing:"_L1;
2748 attributesEmitted =
true;
2753 html +=
" -qt-stroke-color:"_L1;
2757 html +=
" -qt-stroke-width:"_L1;
2761 html +=
" -qt-stroke-linecap:"_L1;
2763 html +=
"squarecap;"_L1;
2765 html +=
"flatcap;"_L1;
2767 html +=
"roundcap;"_L1;
2769 html +=
" -qt-stroke-linejoin:"_L1;
2771 html +=
"miterjoin;"_L1;
2773 html +=
"svgmiterjoin;"_L1;
2775 html +=
"beveljoin;"_L1;
2777 html +=
"roundjoin;"_L1;
2781 html +=
" -qt-stroke-miterlimit:"_L1;
2787 html +=
" -qt-stroke-dasharray:"_L1;
2789 QList<qreal> dashes = outlinePen.dashPattern();
2791 for (
int i = 0;
i < dashes.length() - 1;
i++) {
2797 html += dashArrayString;
2800 html +=
" -qt-stroke-dashoffset:"_L1;
2805 attributesEmitted =
true;
2808 return attributesEmitted;
2827void QTextHtmlExporter::emitAlignment(Qt::Alignment align)
2832 html +=
" align=\"right\""_L1;
2834 html +=
" align=\"center\""_L1;
2836 html +=
" align=\"justify\""_L1;
2844 if (
mode == EmitStyleTag)
2845 html +=
" style=\"float:"_L1;
2847 html +=
" float:"_L1;
2850 html +=
" left;"_L1;
2852 html +=
" right;"_L1;
2854 Q_ASSERT_X(0,
"QTextHtmlExporter::emitFloatStyle()",
"pos should be a valid enum type");
2856 if (
mode == EmitStyleTag)
2874 return "dot-dash"_L1;
2876 return "dot-dot-dash"_L1;
2895 html +=
" border-style:"_L1;
2900void QTextHtmlExporter::emitPageBreakPolicy(QTextFormat::PageBreakFlags
policy)
2903 html +=
" page-break-before:always;"_L1;
2906 html +=
" page-break-after:always;"_L1;
2909void QTextHtmlExporter::emitFontFamily(
const QStringList &families)
2911 html +=
" font-family:"_L1;
2914 for (
const QString &family : families) {
2915 auto quote =
"\'"_L1;
2916 if (family.contains(u
'\''))
2917 quote =
"""_L1;
2932 html +=
" margin-top:"_L1;
2936 html +=
" margin-bottom:"_L1;
2940 html +=
" margin-left:"_L1;
2944 html +=
" margin-right:"_L1;
2949void QTextHtmlExporter::emitFragment(
const QTextFragment &fragment)
2953 bool closeAnchor =
false;
2957 if (!
names.isEmpty()) {
2958 html +=
"<a name=\""_L1;
2960 html +=
"\"></a>"_L1;
2964 html +=
"<a href=\""_L1;
2972 const bool isObject =
txt.
contains(QChar::ObjectReplacementCharacter);
2973 const bool isImage = isObject &&
format.isImageFormat();
2975 const auto styleTag =
"<span style=\""_L1;
2978 bool attributesEmitted =
false;
2980 attributesEmitted = emitCharFormatStyle(
format);
2981 if (attributesEmitted)
2984 html.
chop(styleTag.size());
2987 for (
int i = 0; isImage &&
i <
txt.size(); ++
i) {
2996 maxWidthCss +=
"max-width:"_L1;
3004 emitAttribute(
"src", imgFmt.name());
3019 html +=
" style=\"vertical-align: middle;"_L1 + maxWidthCss + u
'\"';
3021 html +=
" style=\"vertical-align: top;"_L1 + maxWidthCss + u
'\"';
3022 else if (!maxWidthCss.isEmpty())
3023 html +=
" style=\""_L1 + maxWidthCss + u
'\"';
3026 emitFloatStyle(imageFrame->frameFormat().position());
3031 Q_ASSERT(!
txt.contains(QChar::ObjectReplacementCharacter));
3033 txt =
txt.toHtmlEscaped();
3037 txt.replace(u
'\n',
"<br />"_L1);
3038 txt.replace(QChar::LineSeparator,
"<br />"_L1);
3042 if (attributesEmitted)
3043 html +=
"</span>"_L1;
3058void QTextHtmlExporter::emitBlockAttributes(
const QTextBlock &block)
3061 emitAlignment(
format.alignment());
3066 html +=
" dir='rtl'"_L1;
3068 const auto style =
" style=\""_L1;
3071 const bool emptyBlock = block.
begin().
atEnd();
3073 html +=
"-qt-paragraph-type:empty;"_L1;
3081 html +=
" -qt-block-indent:"_L1;
3085 html +=
" text-indent:"_L1;
3090 html +=
" -qt-user-state:"_L1;
3096 html +=
" line-height:"_L1
3098 switch (
format.lineHeightType()) {
3103 html +=
"; -qt-line-height-type: fixed;"_L1;
3109 html +=
"; -qt-line-height-type: line-distance;"_L1;
3117 emitPageBreakPolicy(
format.pageBreakPolicy());
3133 emitCharFormatStyle(diff);
3139void QTextHtmlExporter::emitBlock(
const QTextBlock &block)
3162 if (
list->itemNumber(block) == 0) {
3164 const int style =
format.style();
3165 bool ordered =
false;
3175 default: html +=
"<ul"_L1;
3178 if (ordered &&
format.start() != 1) {
3179 html +=
" start=\""_L1;
3185 styleString +=
"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px;"_L1;
3188 styleString +=
" -qt-list-indent: "_L1;
3190 styleString += u
';';
3195 numberPrefix.
replace(u
'"',
"\\22"_L1);
3196 numberPrefix.
replace(u
'\'',
"\\27"_L1);
3197 styleString +=
" -qt-list-number-prefix: "_L1;
3198 styleString += u
'\'';
3199 styleString += numberPrefix;
3200 styleString += u
'\'';
3201 styleString += u
';';
3205 if (
format.numberSuffix() !=
"."_L1) {
3207 numberSuffix.
replace(u
'"',
"\\22"_L1);
3208 numberSuffix.
replace(u
'\'',
"\\27"_L1);
3209 styleString +=
" -qt-list-number-suffix: "_L1;
3210 styleString += u
'\'';
3211 styleString += numberSuffix;
3212 styleString += u
'\'';
3213 styleString += u
';';
3217 html +=
" style=\""_L1;
3218 html += styleString;
3225 if (!blockFmt.properties().isEmpty()) {
3226 html +=
" style=\""_L1;
3227 emitCharFormatStyle(blockFmt);
3235 html +=
" class=\"checked\""_L1;
3238 html +=
" class=\"unchecked\""_L1;
3252 emitTextLength(
"width",
width);
3256 html +=
"style=\""_L1;
3257 html +=
"background-color:"_L1;
3274 if (headingLevel > 0 && headingLevel <= 6)
3280 emitBlockAttributes(block);
3284 html +=
"<br />"_L1;
3287 if (fragmentMarkers && !
it.atEnd() && block == doc->
begin())
3288 html +=
"<!--StartFragment-->"_L1;
3290 for (; !
it.atEnd(); ++
it)
3291 emitFragment(
it.fragment());
3294 html +=
"<!--EndFragment-->"_L1;
3299 html +=
"</pre>"_L1;
3301 closeTags +=
"</li>"_L1;
3304 if (headingLevel > 0 && headingLevel <= 6)
3313 closeTags +=
"</ol>"_L1;
3315 closeTags +=
"</ul>"_L1;
3321 if (nextBlock.isValid() && nextBlock.textList() &&
3322 nextBlock.textList()->itemNumber(nextBlock) == 0 &&
3323 nextBlock.textList()->format().indent() >
list->format().indent()) {
3325 if (!closingTags.isEmpty() &&
list->itemNumber(block) ==
list->
count() - 1)
3326 lastTag = closingTags.takeLast();
3327 lastTag.prepend(closeTags);
3328 closingTags << lastTag;
3333 if (!closingTags.isEmpty())
3334 html += closingTags.takeLast();
3340 defaultCharFormat = oldDefaultCharFormat;
3352 return findUrlForImage(parent,
cacheKey, isPixmap);
3358 for (;
it !=
priv->cachedResources.constEnd(); ++
it) {
3361 if (
v.userType() == QMetaType::QImage && !isPixmap) {
3366 if (
v.userType() == QMetaType::QPixmap && isPixmap) {
3372 if (
it !=
priv->cachedResources.constEnd())
3373 url =
it.key().toString();
3383 cachedResources.
insert(
priv->cachedResources);
3390 emitAttribute(
"background",
url);
3402 emitAttribute(
"background",
url);
3411 html +=
"\n<table"_L1;
3416 emitFrameStyle(
format, TableFrame);
3418 emitAlignment(
format.alignment());
3419 emitTextLength(
"width",
format.width());
3426 emitBackgroundAttribute(
format);
3430 const int rows =
table->rows();
3431 const int columns =
table->columns();
3433 QList<QTextLength> columnWidths =
format.columnWidthConstraints();
3434 if (columnWidths.isEmpty()) {
3435 columnWidths.resize(columns);
3438 Q_ASSERT(columnWidths.size() == columns);
3440 QVarLengthArray<bool> widthEmittedForColumn(columns);
3441 for (
int i = 0;
i < columns; ++
i)
3442 widthEmittedForColumn[
i] =
false;
3444 const int headerRowCount =
qMin(
format.headerRowCount(), rows);
3445 if (headerRowCount > 0)
3446 html +=
"<thead>"_L1;
3449 html +=
"\n<tr>"_L1;
3451 for (
int col = 0; col < columns; ++col) {
3458 if (cell.
column() != col)
3463 if (!widthEmittedForColumn[col] && cell.
columnSpan() == 1) {
3464 emitTextLength(
"width", columnWidths.at(col));
3465 widthEmittedForColumn[col] =
true;
3475 emitBackgroundAttribute(cellFormat);
3483 styleString +=
" vertical-align:"_L1;
3486 styleString +=
"middle"_L1;
3489 styleString +=
"top"_L1;
3492 styleString +=
"bottom"_L1;
3497 styleString += u
';';
3501 defaultCharFormat.
merge(temp);
3505 styleString +=
" padding-left:"_L1 +
QString::number(cellFormat.leftPadding()) + u
';';
3507 styleString +=
" padding-right:"_L1 +
QString::number(cellFormat.rightPadding()) + u
';';
3509 styleString +=
" padding-top:"_L1 +
QString::number(cellFormat.topPadding()) + u
';';
3511 styleString +=
" padding-bottom:"_L1 +
QString::number(cellFormat.bottomPadding()) + u
';';
3514 styleString +=
" border-top:"_L1 +
QString::number(cellFormat.topBorder()) +
"px;"_L1;
3516 styleString +=
" border-right:"_L1 +
QString::number(cellFormat.rightBorder()) +
"px;"_L1;
3518 styleString +=
" border-bottom:"_L1 +
QString::number(cellFormat.bottomBorder()) +
"px;"_L1;
3520 styleString +=
" border-left:"_L1 +
QString::number(cellFormat.leftBorder()) +
"px;"_L1;
3523 styleString +=
" border-top-color:"_L1 + cellFormat.topBorderBrush().color().name() + u
';';
3525 styleString +=
" border-right-color:"_L1 + cellFormat.rightBorderBrush().color().name() + u
';';
3527 styleString +=
" border-bottom-color:"_L1 + cellFormat.bottomBorderBrush().color().name() + u
';';
3529 styleString +=
" border-left-color:"_L1 + cellFormat.leftBorderBrush().color().name() + u
';';
3541 html +=
" style=\""_L1 + styleString + u
'\"';
3545 emitFrame(cell.
begin());
3549 defaultCharFormat = oldDefaultCharFormat;
3553 if (headerRowCount > 0 &&
row == headerRowCount - 1)
3554 html +=
"</thead>"_L1;
3557 html +=
"</table>"_L1;
3562 if (!frameIt.atEnd()) {
3566 && frameIt.currentFrame() ==
nullptr
3567 && frameIt.parentFrame() != doc->
rootFrame()
3573 !
it.atEnd(); ++
it) {
3580 }
else if (
it.currentBlock().isValid()) {
3581 emitBlock(
it.currentBlock());
3586void QTextHtmlExporter::emitTextFrame(
const QTextFrame *
f)
3588 FrameType frameType =
f->parentFrame() ? TextFrame : RootFrame;
3590 html +=
"\n<table"_L1;
3596 emitFrameStyle(
format, frameType);
3598 emitTextLength(
"width",
format.width());
3599 emitTextLength(
"height",
format.height());
3602 if (frameType != RootFrame)
3603 emitBackgroundAttribute(
format);
3606 html +=
"\n<tr>\n<td style=\"border: none;\">"_L1;
3607 emitFrame(
f->begin());
3608 html +=
"</td></tr></table>"_L1;
3613 const auto styleAttribute =
" style=\""_L1;
3614 html += styleAttribute;
3617 if (frameType == TextFrame)
3618 html +=
"-qt-table-type: frame;"_L1;
3619 else if (frameType == RootFrame)
3620 html +=
"-qt-table-type: root;"_L1;
3624 emitFloatStyle(
format.position(), OmitStyleTag);
3625 emitPageBreakPolicy(
format.pageBreakPolicy());
3628 html +=
" border-color:"_L1;
3634 emitBorderStyle(
format.borderStyle());
3647 html +=
" border-collapse:collapse;"_L1;
3649 if (html.
size() == originalHtmlLength)
3650 html.
chop(styleAttribute.size());
3665#ifndef QT_NO_TEXTHTMLPARSER
3679#if QT_CONFIG(textmarkdownwriter)
3680QString QTextDocument::toMarkdown(QTextDocument::MarkdownFeatures features)
const
3685 if (
w.writeAll(
this))
3721#if QT_CONFIG(textmarkdownreader)
3722void QTextDocument::setMarkdown(
const QString &markdown, QTextDocument::MarkdownFeatures features)
3734 return d->formatCollection()->formats;
3746#include "moc_qtextdocument.cpp"
virtual int pageCount() const =0
Returns the number of pages contained in the layout.
virtual void draw(QPainter *painter, const PaintContext &context)=0
Draws the layout with the given painter using the given context.
QPaintDevice * paintDevice() const
Returns the paint device used to render the document's layout.
virtual QSizeF documentSize() const =0
Returns the total size of the document's layout.
Qt::BrushStyle style() const
Returns the brush style.
The QColor class provides colors based on RGB, HSV or CMYK values.
bool parse(StyleSheet *styleSheet, Qt::CaseSensitivity nameCaseSensitivity=Qt::CaseSensitive)
static QChar separator()
Returns the native directory separator: "/" under Unix and "\\" under Windows.
bool isAbsolute() const
Returns true if the file system entry's path is absolute, otherwise returns false (that is,...
\reentrant \inmodule QtGui
int horizontalAdvance(const QString &, int len=-1) const
Returns the horizontal advance in pixels of the first len characters of text.
int ascent() const
Returns the ascent of the font.
ConstIterator last() const
uint findNode(int k, uint field=0) const
Spread spread() const
Returns the spread method use by this gradient.
CoordinateMode coordinateMode() const
Type type() const
Returns the type of gradient.
qsizetype count() const noexcept
iterator insert(const Key &key, const T &value)
constexpr void setLeft(qreal aleft) noexcept
Sets the left margin to aleft (which must be finite).
QObject * parent() const
Returns a pointer to the parent object.
QMarginsF margins() const
Returns the margins of the page layout using the currently set units.
virtual bool newPage()=0
Starts a new page.
virtual bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units=QPageLayout::Millimeter)
QPageRanges pageRanges() const
QPageLayout pageLayout() const
The QPainter class performs low-level painting on widgets and other paint devices.
void setClipping(bool enable)
Enables clipping if enable is true, or disables clipping if enable is false.
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation.
void restore()
Restores the current painter state (pops a saved state off the stack).
QFontMetrics fontMetrics() const
Returns the font metrics for the painter if the painter is active.
void save()
Saves the current painter state (pushes the state onto a stack).
void setFont(const QFont &f)
Sets the painter's font to the given font.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position.
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
bool loadFromData(const uchar *buf, uint len, const char *format=nullptr, Qt::ImageConversionFlags flags=Qt::AutoColor)
Loads a pixmap from the len first bytes of the given binary data.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
constexpr qreal top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
\inmodule QtCore \reentrant
\inmodule QtCore \reentrant
bool isValid() const
Returns true if the regular expression is a valid regular expression (that is, it contains no syntax ...
PatternOptions patternOptions() const
Returns the pattern options for the regular expression.
constexpr qreal & rwidth() noexcept
Returns a reference to the width.
constexpr void setHeight(qreal h) noexcept
Sets the height to the given finite height.
constexpr void setWidth(qreal w) noexcept
Sets the width to the given finite width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype indexOf(QLatin1StringView s, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
QString & replace(qsizetype i, qsizetype len, QChar after)
void reserve(qsizetype size)
Ensures the string has space for at least size characters.
void chop(qsizetype n)
Removes n characters from the end of the string.
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString mid(qsizetype position, qsizetype n=-1) const &
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
qsizetype size() const noexcept
Returns the number of characters in this string.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString static QString asprintf(const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1
QString toHtmlEscaped() const
MarkerType marker() const
bool nonBreakableLines() const
Returns true if the lines in the paragraph are non-breakable; otherwise returns false.
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.
int length() const
Returns the length of the block in characters.
QTextBlockFormat blockFormat() const
Returns the QTextBlockFormat that describes block-specific properties.
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...
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.
Qt::LayoutDirection textDirection() const
QTextCharFormat charFormat() const
Returns the QTextCharFormat that describes the block's character format.
QTextList * textList() const
If the block represents a list item, returns the list that the item belongs to; otherwise returns \nu...
QTextBlock previous() const
Returns the text block in the document before this block, or an empty text block if this is the first...
qreal fontLetterSpacing() const
VerticalAlignment
This enum describes the ways that adjacent characters can be vertically aligned.
QStringList anchorNames() const
int fontWeight() const
Returns the text format's font weight.
qreal fontPointSize() const
Returns the font size used to display text in this format.
bool fontStrikeOut() const
Returns true if the text format's font is struck out (has a horizontal line drawn through it); otherw...
void setVerticalAlignment(VerticalAlignment alignment)
Sets the vertical alignment used for the characters with this format to the alignment specified.
qreal fontWordSpacing() const
bool fontOverline() const
Returns true if the text format's font is overlined; otherwise returns false.
VerticalAlignment verticalAlignment() const
Returns the vertical alignment used for characters with this format.
QFont::SpacingType fontLetterSpacingType() const
bool fontItalic() const
Returns true if the text format's font is italic; otherwise returns false.
bool fontUnderline() const
Returns true if the text format's font is underlined; otherwise returns false.
void setFont(const QFont &font, FontPropertiesInheritanceBehavior behavior=FontPropertiesAll)
static QTextCursor fromPosition(QTextDocumentPrivate *d, int pos)
\reentrant \inmodule QtGui
void setBlockCharFormat(const QTextCharFormat &format)
Sets the block char format of the current block (or all blocks that are contained in the selection) t...
void insertFragment(const QTextDocumentFragment &fragment)
Inserts the text fragment at the current position().
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 insertText(const QString &text)
Inserts text at the current position, using the current character format.
const BlockMap & blockMap() const
static const QTextDocumentPrivate * get(const QTextDocument *document)
FragmentMap::ConstIterator FragmentIterator
void mergeCachedResources(const QTextDocumentPrivate *priv)
\reentrant \inmodule QtGui
void setModified(bool m=true)
QString defaultStyleSheet
QTextDocument * clone(QObject *parent=nullptr) const
Creates a new QTextDocument that is a copy of this text document.
void setDefaultCursorMoveStyle(Qt::CursorMoveStyle style)
void setSuperScriptBaseline(qreal baseline)
void setBaselineOffset(qreal baseline)
void setIndentWidth(qreal width)
QTextBlock findBlockByLineNumber(int blockNumber) const
int maximumBlockCount
Specifies the limit for blocks in the document.
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.
QTextFrame * frameAt(int pos) const
MetaInformation
This enum describes the different types of meta information that can be added to a document.
qreal baselineOffset() const
void setDefaultTextOption(const QTextOption &option)
int availableRedoSteps() const
Stacks
\value UndoStack The undo stack.
void setResourceProvider(const ResourceProvider &provider)
bool isLayoutEnabled() const
QList< QTextFormat > allFormats() const
Returns a list of text formats for all the formats used in the document.
bool isRedoAvailable() const
Returns true if redo is available; otherwise returns false.
QFont defaultFont
the default font used to display the document's text
QString toHtml() const
Returns a string containing an HTML representation of the document.
QTextBlock findBlockByNumber(int blockNumber) const
int availableUndoSteps() const
int blockCount
the number of text blocks in the document.
QAbstractTextDocumentLayout * documentLayout() const
Returns the document layout for this document.
QString toRawText() const
Returns the raw text contained in the document without any formatting information.
bool useDesignMetrics
whether the document uses design metrics of fonts to improve the accuracy of text layout
QSizeF size
the actual size of the document. This is equivalent to documentLayout()->documentSize();
QSizeF pageSize
the page size that should be used for laying out the document
void appendUndoItem(QAbstractUndoItem *)
QTextObject * objectForFormat(const QTextFormat &) const
Returns the text object associated with the format f.
virtual void clear()
Clears the document.
bool isUndoRedoEnabled() const
void baseUrlChanged(const QUrl &url)
int pageCount() const
returns the number of pages in this document.
QTextBlock begin() const
Returns the document's first text block.
bool isUndoAvailable() const
Returns true if undo is available; otherwise returns false.
void setLayoutEnabled(bool b)
QTextOption defaultTextOption() const
the default text option will be set on all \l{QTextLayout}s in the document.
void print(QPagedPaintDevice *printer) const
Prints the document to the given printer.
QVariant resource(int type, const QUrl &name) const
Returns data of the specified type from the resource with the given name.
void setDefaultFont(const QFont &font)
Sets the default font to use in the document layout.
QChar characterAt(int pos) const
void setPageSize(const QSizeF &size)
QTextDocument(QObject *parent=nullptr)
Constructs an empty QTextDocument with the given parent.
QTextDocument::ResourceProvider resourceProvider() const
void setDefaultStyleSheet(const QString &sheet)
void setUndoRedoEnabled(bool enable)
QUrl baseUrl
the base URL used to resolve relative resource URLs within the document.
QString toPlainText() const
Returns the plain text contained in the document.
virtual Q_INVOKABLE QVariant loadResource(int type, const QUrl &name)
Loads data of the specified type from the resource with the given name.
QTextObject * object(int objectIndex) const
Returns the text object associated with the given objectIndex.
void clearUndoRedoStacks(Stacks historyToClear=UndoAndRedoStacks)
QTextCursor find(const QString &subString, int from=0, FindFlags options=FindFlags()) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setDocumentMargin(qreal margin)
QTextBlock findBlock(int pos) const
Returns the text block that contains the {pos}-th character.
qreal subScriptBaseline() const
QTextBlock end() const
This function returns a block to test for the end of the document while iterating over it.
QString metaInformation(MetaInformation info) const
Returns meta information about the document of the type specified by info.
Qt::CursorMoveStyle defaultCursorMoveStyle() const
QTextBlock firstBlock() const
static void setDefaultResourceProvider(const ResourceProvider &provider)
void setPlainText(const QString &text)
Replaces the entire contents of the document with the given plain text.
void setMaximumBlockCount(int maximum)
QTextFrame * rootFrame() const
Returns the document's root frame.
void setDocumentLayout(QAbstractTextDocumentLayout *layout)
Sets the document to use the given layout.
void setMetaInformation(MetaInformation info, const QString &)
Sets the document's meta information of the type specified by info to the given string.
qreal superScriptBaseline() const
static QTextDocument::ResourceProvider defaultResourceProvider()
void setBaseUrl(const QUrl &url)
QTextBlock lastBlock() const
void addResource(int type, const QUrl &name, const QVariant &resource)
Adds the resource resource to the resource cache, using type and name as identifiers.
void setSubScriptBaseline(qreal baseline)
~QTextDocument()
Destroys the document.
void undo()
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual QTextObject * createObject(const QTextFormat &f)
Creates and returns a new document object (a QTextObject), based on the given format.
std::function< QVariant(const QUrl &)> ResourceProvider
void markContentsDirty(int from, int length)
Marks the contents specified by the given position and length as "dirty", informing the document that...
void setUseDesignMetrics(bool b)
void setTextWidth(qreal width)
void drawContents(QPainter *painter, const QRectF &rect=QRectF())
int characterCount() const
void redo()
This is an overloaded member function, provided for convenience. It differs from the above function o...
QBrush background() const
Returns the brush used to paint the document's background.
@ TableCellBottomBorderStyle
@ TableCellTopBorderStyle
@ TableCellBottomBorderBrush
@ TableCellRightBorderStyle
@ BlockTrailingHorizontalRulerWidth
@ TableCellTopBorderBrush
@ TableCellRightBorderBrush
@ TableCellLeftBorderStyle
@ TableCellLeftBorderBrush
QTextLength lengthProperty(int propertyId) const
Returns the value of the property given by propertyId.
int intProperty(int propertyId) const
Returns the value of the property specified by propertyId.
void setProperty(int propertyId, const QVariant &value)
Sets the property specified by the propertyId to the given value.
QTextImageFormat toImageFormat() const
Returns this format as an image format.
QMap< int, QVariant > properties() const
Returns a map with all properties of this text format.
QTextTableCellFormat toTableCellFormat() const
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...
QVariant property(int propertyId) const
Returns the property specified by the given propertyId.
QBrush foreground() const
Returns the brush used to render foreground details, such as text, frame outlines,...
QString text() const
Returns the text fragment's as plain text.
QTextCharFormat charFormat() const
Returns the text fragment's character format.
QBrush borderBrush() const
void setLeftMargin(qreal margin)
BorderStyle borderStyle() const
Position
This enum describes how a frame is located relative to the surrounding text.
void setMargin(qreal margin)
Sets the frame's margin in pixels.
bool atEnd() const
Returns true if the current item is the last item in the text frame.
void setFrameFormat(const QTextFrameFormat &format)
Sets the frame's format.
QTextFrameFormat frameFormat() const
Returns the frame's format.
iterator begin() const
Returns an iterator pointing to the first document element inside the frame.
QString toHtml(ExportMode mode=ExportEntireDocument)
Returns the document in HTML format.
QTextHtmlExporter(const QTextDocument *_doc)
static int lookupElement(QStringView element)
void import(const QString &markdown)
QTextCharFormat format() const
Returns the cell's character format.
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.
int rowSpan() const
Returns the number of rows this cell spans.
int column() const
Returns the number of the column in the table that contains this cell.
QTextFrame::iterator begin() const
Returns a frame iterator pointing to the beginning of the table's cell.
static QThread * currentThread()
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
QString url(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
bool isRelative() const
Returns true if the URL is relative; otherwise returns false.
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
QString scheme() const
Returns the scheme of the URL.
QString toString(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
QSet< QString >::iterator it
@ StyleSheetOrigin_UserAgent
Combined button and popup list for selecting options.
Q_GUI_EXPORT QString convertFromPlainText(const QString &plain, WhiteSpaceMode mode=WhiteSpacePre)
Converts the plain text string plain to an HTML-formatted paragraph while preserving most of its look...
Q_GUI_EXPORT bool mightBeRichText(QAnyStringView)
Returns true if the string text is likely to be rich text; otherwise returns false.
bool Q_GUI_EXPORT qHasPixmapTexture(const QBrush &brush)
QPair< qreal, QColor > QGradientStop
#define Q_DECL_CONST_FUNCTION
AudioChannelLayoutTag tag
Q_CORE_EXPORT bool qDecodeDataUrl(const QUrl &uri, QString &mimeType, QByteArray &payload)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
EGLOutputLayerEXT EGLint attribute
int qRound(qfloat16 d) noexcept
Q_GUI_EXPORT int qt_defaultDpiX()
Q_GUI_EXPORT int qt_defaultDpiY()
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION unsigned int qt_int_sqrt(unsigned int n)
\inmodule QtCore \title Global Qt Declarations
static QByteArray cacheKey(Args &&...args)
#define qCDebug(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
#define Q_RETURN_ARG(Type, data)
#define Q_ARG(Type, data)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLdouble GLdouble GLdouble GLdouble top
GLenum GLuint GLsizei const GLenum * props
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLenum GLenum GLsizei void * row
GLenum GLenum GLsizei void * table
GLsizei const GLchar *const * string
[0]
#define Q_ASSERT_X(cond, x, msg)
static QString colorValue(QColor color)
static bool isOrderedList(int style)
static QLatin1StringView richtextBorderStyleToHtmlBorderStyle(QTextFrameFormat::BorderStyle style)
static QStringList resolvedFontFamilies(const QTextCharFormat &format)
static void printPage(int index, QPainter *painter, const QTextDocument *doc, const QRectF &body, const QPointF &pageNumberPos)
Q_CORE_EXPORT Q_DECL_CONST_FUNCTION unsigned int qt_int_sqrt(unsigned int n)
\inmodule QtCore \title Global Qt Declarations
static bool mightBeRichTextImpl(T text)
static bool findInBlock(const QTextBlock &block, const QString &expression, int offset, QTextDocument::FindFlags options, QTextCursor *cursor)
static QTextFormat formatDifference(const QTextFormat &from, const QTextFormat &to)
bool qHasPixmapTexture(const QBrush &brush)
#define QTextBeginningOfFrame
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
static QString quote(const QString &str)
QVideoFrameFormat::PixelFormat fmt
file open(QIODevice::ReadOnly)
QUrl url("example.com")
[constructor-url-reference]
\reentrant \inmodule QtGui