Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtextdocumentlayout.cpp File Reference

(96a87c639f0f0a4b2e1a48b51af8b71c339347e6)

#include "qtextdocumentlayout_p.h"
#include "qtextdocument_p.h"
#include "qtextimagehandler_p.h"
#include "qtexttable.h"
#include "qtextlist.h"
#include "qtextengine_p.h"
#include "private/qguiapplication_p.h"
#include "qabstracttextdocumentlayout_p.h"
#include "qcssparser_p.h"
#include <qpainter.h>
#include <qmath.h>
#include <qrect.h>
#include <qpalette.h>
#include <qdebug.h>
#include <qvarlengtharray.h>
#include <limits.h>
#include <qbasictimer.h>
#include "private/qfunctions_p.h"
#include <qloggingcategory.h>
#include <QtCore/qpointer.h>
#include <algorithm>
#include "moc_qtextdocumentlayout_p.cpp"
Include dependency graph for qtextdocumentlayout.cpp:

Go to the source code of this file.

Classes

class  QTextFrameData
struct  QTextLayoutStruct
struct  EdgeData
class  QTextTableData
struct  QCheckPoint
class  QTextDocumentLayoutPrivate
struct  BorderPaginator

Functions

static EdgeData axisEdgeData (QTextTable *table, const QTextTableData *td, const QTextTableCell &cell, QCss::Edge edge)
static QTextFrameDatacreateData (QTextFrame *f)
static QTextFrameDatadata (QTextFrame *f)
static bool isFrameFromInlineObject (QTextFrame *f)
static bool isEmptyBlockBeforeTable (const QTextBlock &block, const QTextBlockFormat &format, const QTextFrame::Iterator &nextIt)
static bool isEmptyBlockBeforeTable (const QTextFrame::Iterator &it)
static bool isEmptyBlockAfterTable (const QTextBlock &block, const QTextFrame *previousFrame)
static bool isLineSeparatorBlockAfterTable (const QTextBlock &block, const QTextFrame *previousFrame)
 Q_DECLARE_TYPEINFO (QCheckPoint, Q_PRIMITIVE_TYPE)
static bool operator< (const QCheckPoint &checkPoint, QFixed y)
static bool operator< (const QCheckPoint &checkPoint, int pos)
static void fillBackground (QPainter *p, const QRectF &rect, QBrush brush, const QPointF &origin, const QRectF &gradientRect=QRectF())
static void adjustContextSelectionsForCell (QAbstractTextDocumentLayout::PaintContext &cell_context, const QTextTableCell &cell, int r, int c, const int *selectedTableCells)
static bool cellClipTest (QTextTable *table, QTextTableData *td, const QAbstractTextDocumentLayout::PaintContext &cell_context, const QTextTableCell &cell, QRectF cellRect)
static QTextFormat::Property borderPropertyForEdge (QCss::Edge edge)
static QTextFormat::Property borderStylePropertyForEdge (QCss::Edge edge)
static QCss::Edge adjacentEdge (QCss::Edge edge)
static bool isSameAxis (QCss::Edge e1, QCss::Edge e2)
static bool isVerticalAxis (QCss::Edge e)
static QTextTableCell adjacentCell (QTextTable *table, const QTextTableCell &cell, QCss::Edge edge)
static bool sharesAxis (const QTextTableCell &cell, QCss::Edge edge, const QTextTableCell &competingCell, QCss::Edge competingCellEdge)
static EdgeData cellEdgeData (QTextTable *table, const QTextTableData *td, const QTextTableCell &cell, QCss::Edge edge)
static void checkJoinedEdge (QTextTable *table, const QTextTableData *td, const QTextTableCell &cell, QCss::Edge competingEdge, const EdgeData &edgeData, bool couldHaveContinuation, EdgeData *maxCompetingEdgeData, EdgeData *maxOrthogonalEdgeData)
static qreal collapseOffset (const QTextDocumentLayoutPrivate *p, const EdgeData &w)
static double prioritizedEdgeAnchorOffset (const QTextDocumentLayoutPrivate *p, QTextTable *table, const QTextTableData *td, const QTextTableCell &cell, const EdgeData &edgeData, QCss::Edge orthogonalEdge, bool couldHaveContinuation, bool ignoreEdgesAbove)
static void drawCellBorder (const QTextDocumentLayoutPrivate *p, QPainter *painter, QTextTable *table, const QTextTableData *td, const QTextTableCell &cell, const QRectF &borderRect, QCss::Edge edge, int forceHeaderRow, bool adjustTopAnchor, bool adjustBottomAnchor, bool ignoreEdgesAbove)
static QFixed flowPosition (const QTextFrame::iterator &it)
static QFixed firstChildPos (const QTextFrame *f)
static void findWidestOutermostBorder (QTextTable *table, QTextTableData *td, const QTextTableCell &cell, QCss::Edge edge, qreal *outerBorders)
static void getLineHeightParams (const QTextBlockFormat &blockFormat, const QTextLine &line, qreal scaling, QFixed *lineAdjustment, QFixed *lineBreakHeight, QFixed *lineHeight, QFixed *lineBottom)
static void markFrames (QTextFrame *current, int from, int oldLength, int length)

Function Documentation

◆ adjacentCell()

QTextTableCell adjacentCell ( QTextTable * table,
const QTextTableCell & cell,
QCss::Edge edge )
inlinestatic

◆ adjacentEdge()

QCss::Edge adjacentEdge ( QCss::Edge edge)
inlinestatic

Definition at line 1235 of file qtextdocumentlayout.cpp.

References QCss::BottomEdge, QCss::LeftEdge, QCss::NumEdges, QCss::RightEdge, and QCss::TopEdge.

Referenced by axisEdgeData(), and isSameAxis().

Here is the caller graph for this function:

◆ adjustContextSelectionsForCell()

void adjustContextSelectionsForCell ( QAbstractTextDocumentLayout::PaintContext & cell_context,
const QTextTableCell & cell,
int r,
int c,
const int * selectedTableCells )
static

Definition at line 977 of file qtextdocumentlayout.cpp.

◆ axisEdgeData()

EdgeData axisEdgeData ( QTextTable * table,
const QTextTableData * td,
const QTextTableCell & cell,
QCss::Edge edge )
inlinestatic

Definition at line 1371 of file qtextdocumentlayout.cpp.

References adjacentEdge(), QTextTableData::borderCollapse, QCss::BottomEdge, cellEdgeData(), QCss::LeftEdge, QCss::RightEdge, and QCss::TopEdge.

Referenced by QTextTableData::cellBorderWidth(), cellClipTest(), checkJoinedEdge(), and drawCellBorder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ borderPropertyForEdge()

QTextFormat::Property borderPropertyForEdge ( QCss::Edge edge)
inlinestatic

Definition at line 1203 of file qtextdocumentlayout.cpp.

◆ borderStylePropertyForEdge()

QTextFormat::Property borderStylePropertyForEdge ( QCss::Edge edge)
inlinestatic

Definition at line 1219 of file qtextdocumentlayout.cpp.

◆ cellClipTest()

bool cellClipTest ( QTextTable * table,
QTextTableData * td,
const QAbstractTextDocumentLayout::PaintContext & cell_context,
const QTextTableCell & cell,
QRectF cellRect )
static

Definition at line 1011 of file qtextdocumentlayout.cpp.

References axisEdgeData(), QTextTableData::borderCollapse, QCss::BottomEdge, QCss::LeftEdge, QCss::RightEdge, and QCss::TopEdge.

Here is the call graph for this function:

◆ cellEdgeData()

EdgeData cellEdgeData ( QTextTable * table,
const QTextTableData * td,
const QTextTableCell & cell,
QCss::Edge edge )
inlinestatic

Definition at line 1333 of file qtextdocumentlayout.cpp.

References EdgeData::EdgeData(), QCss::BottomEdge, EdgeData::ClassExplicit, EdgeData::ClassGrid, EdgeData::ClassNone, EdgeData::ClassTableBorder, QTextTableData::drawGrid, QCss::LeftEdge, QCss::RightEdge, and QCss::TopEdge.

Referenced by axisEdgeData(), and findWidestOutermostBorder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkJoinedEdge()

void checkJoinedEdge ( QTextTable * table,
const QTextTableData * td,
const QTextTableCell & cell,
QCss::Edge competingEdge,
const EdgeData & edgeData,
bool couldHaveContinuation,
EdgeData * maxCompetingEdgeData,
EdgeData * maxOrthogonalEdgeData )
inlinestatic

Definition at line 1423 of file qtextdocumentlayout.cpp.

References axisEdgeData(), EdgeData::edge, isSameAxis(), isVerticalAxis(), and EdgeData::operator>().

Referenced by prioritizedEdgeAnchorOffset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ collapseOffset()

qreal collapseOffset ( const QTextDocumentLayoutPrivate * p,
const EdgeData & w )
inlinestatic

Definition at line 1446 of file qtextdocumentlayout.cpp.

◆ createData()

QTextFrameData * createData ( QTextFrame * f)
static

Definition at line 293 of file qtextdocumentlayout.cpp.

Referenced by data().

Here is the caller graph for this function:

◆ data()

QTextFrameData * data ( QTextFrame * f)
inlinestatic

Definition at line 304 of file qtextdocumentlayout.cpp.

References createData().

Referenced by QTextDocumentLayoutPrivate::drawFrame(), QTextDocumentLayoutPrivate::findY(), QTextDocumentLayoutPrivate::floatMargins(), QTextDocumentLayoutPrivate::frameBoundingRectInternal(), QTextDocumentLayoutPrivate::hitTest(), QTextDocumentLayoutPrivate::layoutCell(), QTextDocumentLayoutPrivate::layoutFlow(), QTextDocumentLayoutPrivate::layoutFrame(), QTextDocumentLayoutPrivate::layoutFrame(), markFrames(), and QTextDocumentLayoutPrivate::positionFloat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawCellBorder()

void drawCellBorder ( const QTextDocumentLayoutPrivate * p,
QPainter * painter,
QTextTable * table,
const QTextTableData * td,
const QTextTableCell & cell,
const QRectF & borderRect,
QCss::Edge edge,
int forceHeaderRow,
bool adjustTopAnchor,
bool adjustBottomAnchor,
bool ignoreEdgesAbove )
inlinestatic

Definition at line 1562 of file qtextdocumentlayout.cpp.

References axisEdgeData(), QTextTableData::borderCollapse, QCss::BottomEdge, EdgeData::ClassExplicit, QTextTableData::drawGrid, EdgeData::edge, EdgeData::edgeClass, QCss::LeftEdge, prioritizedEdgeAnchorOffset(), QCss::RightEdge, and QCss::TopEdge.

Here is the call graph for this function:

◆ fillBackground()

void fillBackground ( QPainter * p,
const QRectF & rect,
QBrush brush,
const QPointF & origin,
const QRectF & gradientRect = QRectF() )
static

Definition at line 458 of file qtextdocumentlayout.cpp.

◆ findWidestOutermostBorder()

void findWidestOutermostBorder ( QTextTable * table,
QTextTableData * td,
const QTextTableCell & cell,
QCss::Edge edge,
qreal * outerBorders )
inlinestatic

Definition at line 2355 of file qtextdocumentlayout.cpp.

References cellEdgeData().

Here is the call graph for this function:

◆ firstChildPos()

QFixed firstChildPos ( const QTextFrame * f)
static

Definition at line 2258 of file qtextdocumentlayout.cpp.

◆ flowPosition()

QFixed flowPosition ( const QTextFrame::iterator & it)
static

Definition at line 2241 of file qtextdocumentlayout.cpp.

◆ getLineHeightParams()

void getLineHeightParams ( const QTextBlockFormat & blockFormat,
const QTextLine & line,
qreal scaling,
QFixed * lineAdjustment,
QFixed * lineBreakHeight,
QFixed * lineHeight,
QFixed * lineBottom )
inlinestatic

Definition at line 3395 of file qtextdocumentlayout.cpp.

◆ isEmptyBlockAfterTable()

bool isEmptyBlockAfterTable ( const QTextBlock & block,
const QTextFrame * previousFrame )
inlinestatic

Definition at line 363 of file qtextdocumentlayout.cpp.

◆ isEmptyBlockBeforeTable() [1/2]

bool isEmptyBlockBeforeTable ( const QTextBlock & block,
const QTextBlockFormat & format,
const QTextFrame::Iterator & nextIt )
inlinestatic

Definition at line 342 of file qtextdocumentlayout.cpp.

◆ isEmptyBlockBeforeTable() [2/2]

bool isEmptyBlockBeforeTable ( const QTextFrame::Iterator & it)
inlinestatic

Definition at line 354 of file qtextdocumentlayout.cpp.

◆ isFrameFromInlineObject()

bool isFrameFromInlineObject ( QTextFrame * f)
static

Definition at line 312 of file qtextdocumentlayout.cpp.

Referenced by QTextDocumentLayoutPrivate::hitTest(), and QTextDocumentLayoutPrivate::layoutFrame().

Here is the caller graph for this function:

◆ isLineSeparatorBlockAfterTable()

bool isLineSeparatorBlockAfterTable ( const QTextBlock & block,
const QTextFrame * previousFrame )
inlinestatic

Definition at line 372 of file qtextdocumentlayout.cpp.

◆ isSameAxis()

bool isSameAxis ( QCss::Edge e1,
QCss::Edge e2 )
inlinestatic

Definition at line 1251 of file qtextdocumentlayout.cpp.

References adjacentEdge().

Referenced by checkJoinedEdge().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isVerticalAxis()

bool isVerticalAxis ( QCss::Edge e)
inlinestatic

Definition at line 1256 of file qtextdocumentlayout.cpp.

Referenced by checkJoinedEdge(), prioritizedEdgeAnchorOffset(), and sharesAxis().

Here is the caller graph for this function:

◆ markFrames()

void markFrames ( QTextFrame * current,
int from,
int oldLength,
int length )
static

Definition at line 3739 of file qtextdocumentlayout.cpp.

References data(), QTextFrameData::layoutDirty, and QTextFrameData::sizeDirty.

Here is the call graph for this function:

◆ operator<() [1/2]

bool operator< ( const QCheckPoint & checkPoint,
int pos )
static

Definition at line 453 of file qtextdocumentlayout.cpp.

References QCheckPoint::positionInFrame.

◆ operator<() [2/2]

bool operator< ( const QCheckPoint & checkPoint,
QFixed y )
static

Definition at line 448 of file qtextdocumentlayout.cpp.

◆ prioritizedEdgeAnchorOffset()

double prioritizedEdgeAnchorOffset ( const QTextDocumentLayoutPrivate * p,
QTextTable * table,
const QTextTableData * td,
const QTextTableCell & cell,
const EdgeData & edgeData,
QCss::Edge orthogonalEdge,
bool couldHaveContinuation,
bool ignoreEdgesAbove )
inlinestatic

Definition at line 1488 of file qtextdocumentlayout.cpp.

References QTextTableData::borderCollapse, checkJoinedEdge(), EdgeData::edge, isVerticalAxis(), EdgeData::operator>(), and QCss::TopEdge.

Referenced by drawCellBorder().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Q_DECLARE_TYPEINFO()

Q_DECLARE_TYPEINFO ( QCheckPoint ,
Q_PRIMITIVE_TYPE  )

◆ sharesAxis()

bool sharesAxis ( const QTextTableCell & cell,
QCss::Edge edge,
const QTextTableCell & competingCell,
QCss::Edge competingCellEdge )
inlinestatic

Definition at line 1307 of file qtextdocumentlayout.cpp.

References QCss::BottomEdge, isVerticalAxis(), QCss::LeftEdge, QCss::RightEdge, and QCss::TopEdge.

Here is the call graph for this function: