Skip to content

Commit

Permalink
Markdown format added
Browse files Browse the repository at this point in the history
  • Loading branch information
uwerat committed Dec 9, 2024
1 parent 66d9783 commit d1fa020
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/common/QskTextOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class QSK_EXPORT QskTextOptions
PlainText = Qt::PlainText,
RichText = Qt::RichText,
AutoText = Qt::AutoText,
MarkdownText = Qt::MarkdownText,
StyledText = 4 // taken from QQuickText::StyledText
};
Q_ENUM( TextFormat )
Expand Down Expand Up @@ -81,10 +82,10 @@ class QSK_EXPORT QskTextOptions

private:
int m_maximumLineCount;
FontSizeMode m_fontSizeMode : 2;
WrapMode m_wrapMode : 4;
TextFormat m_format : 3;
Qt::TextElideMode m_elideMode : 2;
unsigned int m_fontSizeMode : 2;
unsigned int m_wrapMode : 4;
unsigned int m_format : 3;
unsigned int m_elideMode : 2;
};

inline constexpr QskTextOptions::QskTextOptions() noexcept
Expand All @@ -103,7 +104,7 @@ inline void QskTextOptions::setFormat( TextFormat format ) noexcept

constexpr inline QskTextOptions::TextFormat QskTextOptions::format() const noexcept
{
return m_format;
return static_cast< QskTextOptions::TextFormat >( m_format );
}

inline void QskTextOptions::setElideMode( Qt::TextElideMode elideMode ) noexcept
Expand All @@ -113,12 +114,12 @@ inline void QskTextOptions::setElideMode( Qt::TextElideMode elideMode ) noexcept

constexpr inline Qt::TextElideMode QskTextOptions::elideMode() const noexcept
{
return m_elideMode;
return static_cast< Qt::TextElideMode >( m_elideMode );
}

constexpr inline Qt::TextElideMode QskTextOptions::effectiveElideMode() const noexcept
{
return ( m_wrapMode != QskTextOptions::NoWrap ) ? Qt::ElideNone : m_elideMode;
return ( wrapMode() != QskTextOptions::NoWrap ) ? Qt::ElideNone : m_elideMode;
}

inline void QskTextOptions::setWrapMode( WrapMode wrapMode ) noexcept
Expand All @@ -128,7 +129,7 @@ inline void QskTextOptions::setWrapMode( WrapMode wrapMode ) noexcept

constexpr inline QskTextOptions::WrapMode QskTextOptions::wrapMode() const noexcept
{
return m_wrapMode;
return static_cast< QskTextOptions::WrapMode >( m_wrapMode );
}

inline void QskTextOptions::setFontSizeMode( FontSizeMode fontSizeMode ) noexcept
Expand All @@ -138,7 +139,7 @@ inline void QskTextOptions::setFontSizeMode( FontSizeMode fontSizeMode ) noexcep

constexpr inline QskTextOptions::FontSizeMode QskTextOptions::fontSizeMode() const noexcept
{
return m_fontSizeMode;
return static_cast< QskTextOptions::FontSizeMode >( m_fontSizeMode );
}

inline void QskTextOptions::setMaximumLineCount( int lineCount ) noexcept
Expand Down

0 comments on commit d1fa020

Please sign in to comment.