6#include "QskTextNode.h"
7#include "QskTextColors.h"
8#include "QskTextOptions.h"
9#include "QskTextRenderer.h"
14static inline QskHashValue qskHash(
15 const QString& text,
const QSizeF& size,
const QFont& font,
17 Qt::Alignment alignment, Qsk::TextStyle textStyle )
19 QskHashValue hash = 11000;
21 hash = qHash( text, hash );
22 hash = qHash( font, hash );
23 hash = options.hash( hash );
24 hash = qHash( alignment, hash );
25 hash = qHash( textStyle, hash );
26 hash = colors.hash( hash );
27 hash = qHashBits( &size,
sizeof( QSizeF ), hash );
32QskTextNode::QskTextNode()
37QskTextNode::~QskTextNode()
41void QskTextNode::setTextData(
42 const QQuickItem* item,
const QString& text,
const QRectF& rect,
44 Qt::Alignment alignment, Qsk::TextStyle textStyle )
47 matrix.translate( rect.left(), rect.top() );
49 if ( matrix != this->matrix() )
52 const auto hash = qskHash( text, rect.size(), font,
53 options, colors, alignment, textStyle );
59 const QRectF textRect( 0, 0, rect.width(), rect.height() );
66 QskTextRenderer::updateNode( text, font, options, textStyle,
67 colors, alignment, textRect, item,
this );