cleaning up QskTextNode

This commit is contained in:
Uwe Rathmann 2017-10-20 15:29:50 +02:00
parent 609bd9aac7
commit 2aa7877152
7 changed files with 7 additions and 13 deletions

View File

@ -27,7 +27,7 @@ QSizeF QskSkinRenderer::textSize( const QskSkinnable* skinnable,
renderer.setFont( font );
renderer.setOptions( options );
return renderer.implicitSizeHint( text );
return renderer.textSize( text );
}
else
{
@ -35,7 +35,7 @@ QSizeF QskSkinRenderer::textSize( const QskSkinnable* skinnable,
renderer.setFont( font );
renderer.setOptions( options );
return renderer.implicitSizeHint( text );
return renderer.textSize( text );
}
}

View File

@ -51,7 +51,7 @@ void QskPlainTextRenderer::setAlignment( Qt::Alignment alignment )
m_alignment = alignment;
}
QSizeF QskPlainTextRenderer::implicitSizeHint( const QString& text ) const
QSizeF QskPlainTextRenderer::textSize( const QString& text ) const
{
// result differs from QskTextRenderer::implicitSizeHint ???
return textRect( QSizeF( 10e6, 10e6 ), text ).size();

View File

@ -38,8 +38,7 @@ public:
static void updateNodeColor( QSGNode* parentNode,
const QColor& textColor, Qsk::TextStyle, const QColor& styleColor );
QSizeF implicitSizeHint( const QString& ) const;
QSizeF textSize( const QString& ) const;
QRectF textRect( const QSizeF&, const QString& ) const;
private:

View File

@ -7,6 +7,7 @@
#include "QskTextOptions.h"
#include <QFont>
#include <QColor>
#include <QString>
QskTextNode::QskTextNode():

View File

@ -10,7 +10,6 @@
#include "QskNamespace.h"
#include <QSGTransformNode>
#include <QColor>
#include <Qt>
class QskTextOptions;
@ -27,10 +26,6 @@ public:
const QColor& textColor, const QColor& styleColor, const QColor& linkColor );
private:
uint m_hash;
QColor m_textRgb;
QColor m_styleRgb;
QColor m_linkRgb;
};
#endif

View File

@ -96,7 +96,7 @@ void QskTextRenderer::setAlignment( Qt::Alignment alignment )
m_alignment = alignment;
}
QSizeF QskTextRenderer::implicitSizeHint( const QString& text ) const
QSizeF QskTextRenderer::textSize( const QString& text ) const
{
if ( qskLayoutHelper == NULL )
qskLayoutHelper = new QskTextHelperItem();

View File

@ -39,8 +39,7 @@ public:
QSGTransformNode*, const QColor& textColor, Qsk::TextStyle,
const QColor& styleColor, const QColor& linkColor );
QSizeF implicitSizeHint( const QString& ) const;
QSizeF textSize( const QString& ) const;
QRectF textRect( const QSizeF&, const QString& ) const;
private: