6#include "QskTextOptions.h"
7#include <qtextdocument.h>
9static void qskRegisterTextOptions()
11 qRegisterMetaType< QskTextOptions >();
13#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
14 QMetaType::registerEqualsComparator< QskTextOptions >();
18Q_CONSTRUCTOR_FUNCTION( qskRegisterTextOptions )
20int QskTextOptions::textFlags() const noexcept
26 case QskTextOptions::NoWrap:
31 case QskTextOptions::WordWrap:
33 flags |= Qt::TextWordWrap;
36 case QskTextOptions::WrapAnywhere:
38 flags |= Qt::TextWrapAnywhere;
41 case QskTextOptions::Wrap:
44 flags |= Qt::TextWrapAnywhere;
45 flags |= Qt::TextWordWrap;
53QskTextOptions::TextFormat QskTextOptions::effectiveFormat(
const QString& text )
const
58 if ( m_format == QskTextOptions::AutoText )
59 return Qt::mightBeRichText( text ) ? StyledText : PlainText;
64QskHashValue QskTextOptions::hash( QskHashValue seed )
const noexcept
66 auto hash = qHash( m_maximumLineCount, seed );
67 hash = qHash( m_fontSizeMode, hash );
68 hash = qHash( m_wrapMode, hash );
69 hash = qHash( m_format, hash );
70 hash = qHash( m_elideMode, hash );
75#ifndef QT_NO_DEBUG_STREAM
81 QDebugStateSaver saver( debug );
83 debug <<
"TextOptions" <<
'(';
84 debug << options.format() <<
"," << options.elideMode()
85 << options.fontSizeMode() << options.wrapMode()
86 <<
"," << options.maximumLineCount();
93#include "moc_QskTextOptions.cpp"