uncrustified

This commit is contained in:
Uwe Rathmann 2020-12-05 15:09:31 +01:00
parent 6281c43dda
commit fbf2a33a9a
47 changed files with 189 additions and 191 deletions

View File

@ -15,30 +15,30 @@ namespace
{ {
class ProgressBar : public QskProgressBar class ProgressBar : public QskProgressBar
{ {
public: public:
ProgressBar( QskLinearBox* box ) ProgressBar( QskLinearBox* box )
: QskProgressBar( box ) : QskProgressBar( box )
{ {
setOrientation( ( box->orientation() == Qt::Horizontal ) setOrientation( ( box->orientation() == Qt::Horizontal )
? Qt::Vertical : Qt::Horizontal ); ? Qt::Vertical : Qt::Horizontal );
setBoundaries( 0, 100 ); setBoundaries( 0, 100 );
} }
void setTheme( QskRgbPalette::Theme theme ) void setTheme( QskRgbPalette::Theme theme )
{ {
const auto pal = QskRgbPalette::palette( theme ); const auto pal = QskRgbPalette::palette( theme );
QVector< QRgb > rgb; QVector< QRgb > rgb;
rgb += pal.rgb( QskRgbPalette::W200 ); rgb += pal.rgb( QskRgbPalette::W200 );
rgb += pal.rgb( QskRgbPalette::W400 ); rgb += pal.rgb( QskRgbPalette::W400 );
rgb += pal.rgb( QskRgbPalette::W600 ); rgb += pal.rgb( QskRgbPalette::W600 );
rgb += pal.rgb( QskRgbPalette::W900 ); rgb += pal.rgb( QskRgbPalette::W900 );
const auto stops = QskRgbPalette::colorStops( rgb, true ); const auto stops = QskRgbPalette::colorStops( rgb, true );
setBarGradient( QskGradient( orientation(), stops ) ); setBarGradient( QskGradient( orientation(), stops ) );
} }
}; };
} }

View File

@ -204,7 +204,7 @@ class ScrollArea : public QskScrollArea
setFlickRecognizerTimeout( 300 ); setFlickRecognizerTimeout( 300 );
connect( this, &QskScrollView::scrollPosChanged, connect( this, &QskScrollView::scrollPosChanged,
this, &ScrollArea::updateVisibilities ); this, &ScrollArea::updateVisibilities );
} }
protected: protected:

View File

@ -384,9 +384,9 @@ QSizeF AnchorBox::layoutSizeHint( Qt::SizeHint which, const QSizeF& constraint )
void AnchorBox::updateHints() void AnchorBox::updateHints()
{ {
/* /*
The solver seems to run into overflows with The solver seems to run into overflows with
std::numeric_limits< unsigned float >::max() std::numeric_limits< unsigned float >::max()
*/ */
const qreal max = std::numeric_limits< unsigned int >::max(); const qreal max = std::numeric_limits< unsigned int >::max();

View File

@ -326,10 +326,10 @@ void Box::test11()
void Box::test12() void Box::test12()
{ {
/* /*
We have different strategies where to put the spaces, when We have different strategies where to put the spaces, when
there is more space than the elements are willing to accept. there is more space than the elements are willing to accept.
QSkinny has the extraSpacingAt parameter to control this. QSkinny has the extraSpacingAt parameter to control this.
*/ */
insert( "PaleVioletRed", 0, 0 ); insert( "PaleVioletRed", 0, 0 );
@ -364,7 +364,7 @@ class MainWidget : public QWidget
/* /*
Not using layouts here to avoid confusion Not using layouts here to avoid confusion
while debugging. while debugging.
*/ */
const auto r = contentsRect(); const auto r = contentsRect();
const int spacing = 5; const int spacing = 5;

View File

@ -11,15 +11,15 @@ namespace
{ {
class Shader final : public QSGMaterialShader class Shader final : public QSGMaterialShader
{ {
public: public:
Shader(); Shader();
char const *const *attributeNames() const override; char const* const* attributeNames() const override;
void initialize() override; void initialize() override;
void updateState( const QSGMaterialShader::RenderState &state, void updateState( const QSGMaterialShader::RenderState& state,
QSGMaterial *newMaterial, QSGMaterial *oldMaterial) override; QSGMaterial* newMaterial, QSGMaterial* oldMaterial) override;
private: private:
int m_matrixLocation = -1; int m_matrixLocation = -1;
@ -59,7 +59,7 @@ namespace
char const* const* Shader::attributeNames() const char const* const* Shader::attributeNames() const
{ {
static char const *const names[] = { "in_vertex", "in_coord", nullptr }; static char const* const names[] = { "in_vertex", "in_coord", nullptr };
return names; return names;
} }
@ -78,20 +78,20 @@ namespace
m_colorLocation = p->uniformLocation( "color" ); m_colorLocation = p->uniformLocation( "color" );
} }
void Shader::updateState( const QSGMaterialShader::RenderState &state, void Shader::updateState( const QSGMaterialShader::RenderState& state,
QSGMaterial *newMaterial, QSGMaterial *oldMaterial ) QSGMaterial* newMaterial, QSGMaterial* oldMaterial )
{ {
auto p = program(); auto p = program();
if ( state.isMatrixDirty() ) if ( state.isMatrixDirty() )
p->setUniformValue(m_matrixLocation, state.combinedMatrix()); p->setUniformValue(m_matrixLocation, state.combinedMatrix() );
if ( state.isOpacityDirty() ) if ( state.isOpacityDirty() )
p->setUniformValue(m_opacityLocation, state.opacity()); p->setUniformValue(m_opacityLocation, state.opacity() );
if ( oldMaterial == nullptr || newMaterial->compare( oldMaterial ) != 0 ) if ( oldMaterial == nullptr || newMaterial->compare( oldMaterial ) != 0 )
{ {
auto material = static_cast< const Material* >(newMaterial); auto material = static_cast< const Material* >( newMaterial );
p->setUniformValue( m_aspectLocation, material->aspect ); p->setUniformValue( m_aspectLocation, material->aspect );
p->setUniformValue( m_extentLocation, material->extent ); p->setUniformValue( m_extentLocation, material->extent );
@ -165,7 +165,7 @@ void BoxShadowNode::setRect( const QRectF& rect )
{ {
Q_D( BoxShadowNode ); Q_D( BoxShadowNode );
if ( rect == d->rect) if ( rect == d->rect )
return; return;
d->rect = rect; d->rect = rect;
@ -173,7 +173,7 @@ void BoxShadowNode::setRect( const QRectF& rect )
QVector2D newAspect( 1.0, 1.0 ); QVector2D newAspect( 1.0, 1.0 );
if ( rect.width() >= rect.height() ) if ( rect.width() >= rect.height() )
newAspect.setX( rect.width() / rect.height()); newAspect.setX( rect.width() / rect.height() );
else else
newAspect.setY( rect.height() / rect.width() ); newAspect.setY( rect.height() / rect.width() );
@ -188,7 +188,7 @@ void BoxShadowNode::setShape( const QskBoxShapeMetrics& shape )
{ {
Q_D( BoxShadowNode ); Q_D( BoxShadowNode );
const float t = 0.5 * std::min( d->rect.width(), d->rect.height()); const float t = 0.5 * std::min( d->rect.width(), d->rect.height() );
const float r1 = shape.radius( Qt::BottomRightCorner ).width(); const float r1 = shape.radius( Qt::BottomRightCorner ).width();
const float r2 = shape.radius( Qt::TopRightCorner ).width(); const float r2 = shape.radius( Qt::TopRightCorner ).width();
@ -258,8 +258,7 @@ void BoxShadowNode::updateGeometry()
auto rect = d->rect.adjusted( auto rect = d->rect.adjusted(
-sz * aspect.x(), -sz * aspect.y(), -sz * aspect.x(), -sz * aspect.y(),
sz * aspect.x(), sz * aspect.y() sz * aspect.x(), sz * aspect.y() );
);
auto offsetLength = d->material.offset.length(); auto offsetLength = d->material.offset.length();

View File

@ -21,7 +21,7 @@ class BoxShadowNode : public QSGGeometryNode
void updateGeometry(); void updateGeometry();
private: private:
Q_DECLARE_PRIVATE( BoxShadowNode ) Q_DECLARE_PRIVATE( BoxShadowNode )
}; };

View File

@ -80,7 +80,7 @@ namespace
QSK_SUBCONTROL( ShadowedBox, Panel ) QSK_SUBCONTROL( ShadowedBox, Panel )
ShadowedBox::ShadowedBox(QQuickItem *parentItem) ShadowedBox::ShadowedBox( QQuickItem* parentItem )
: QskControl( parentItem ) : QskControl( parentItem )
{ {
setFlag( QQuickItem::ItemHasContents, true ); setFlag( QQuickItem::ItemHasContents, true );

View File

@ -10,7 +10,7 @@ class ShadowedBox : public QskControl
{ {
Q_OBJECT Q_OBJECT
public: public:
QSK_SUBCONTROLS( Panel ) QSK_SUBCONTROLS( Panel )
class Shadow class Shadow
@ -21,7 +21,7 @@ public:
qreal yOffset = 0.0; qreal yOffset = 0.0;
}; };
ShadowedBox(QQuickItem *parent = nullptr); ShadowedBox(QQuickItem* parent = nullptr);
~ShadowedBox() override; ~ShadowedBox() override;
void setShadow( const Shadow& ); void setShadow( const Shadow& );
@ -36,7 +36,7 @@ public:
void setShape( const QskBoxShapeMetrics& ); void setShape( const QskBoxShapeMetrics& );
const QskBoxShapeMetrics& shape() const; const QskBoxShapeMetrics& shape() const;
private: private:
Shadow m_shadow; Shadow m_shadow;
QColor m_shadowColor = Qt::black; QColor m_shadowColor = Qt::black;
QskGradient m_gradient; QskGradient m_gradient;

View File

@ -91,7 +91,7 @@ namespace
private: private:
static void filter( QLoggingCategory *category ) static void filter( QLoggingCategory* category )
{ {
if ( qstrcmp( category->categoryName(), "qt.qml.typeregistration" ) == 0 ) if ( qstrcmp( category->categoryName(), "qt.qml.typeregistration" ) == 0 )
{ {

View File

@ -133,7 +133,7 @@ QVariant QskBoxShapeMetrics::interpolate(
uint QskBoxShapeMetrics::hash( uint seed ) const noexcept uint QskBoxShapeMetrics::hash( uint seed ) const noexcept
{ {
uint hash = qHash( static_cast<int>( m_sizeMode ), seed ); uint hash = qHash( static_cast< int >( m_sizeMode ), seed );
return qHashBits( m_radii, sizeof( m_radii ), hash ); return qHashBits( m_radii, sizeof( m_radii ), hash );
} }

View File

@ -139,7 +139,7 @@ static inline QVector< QskGradientStop > qskExtractedStops(
} }
else else
{ {
for ( i = 1 ; i < stops.count(); i++ ) for ( i = 1; i < stops.count(); i++ )
{ {
if ( stops[i].position() > from ) if ( stops[i].position() > from )
break; break;

View File

@ -11,7 +11,7 @@
class QskMetaFunction::FunctionCall : public QtPrivate::QSlotObjectBase class QskMetaFunction::FunctionCall : public QtPrivate::QSlotObjectBase
{ {
public: public:
typedef void (* InvokeFunction)( typedef void (* InvokeFunction)(
int which, QtPrivate::QSlotObjectBase*, QObject*, void**, bool* ); int which, QtPrivate::QSlotObjectBase*, QObject*, void**, bool* );
@ -33,7 +33,7 @@ public:
m_parameterTypes = types; m_parameterTypes = types;
} }
protected: protected:
explicit inline FunctionCall( InvokeFunction f, explicit inline FunctionCall( InvokeFunction f,
const int* m_parameterTypes = nullptr ): const int* m_parameterTypes = nullptr ):
QSlotObjectBase( f ), QSlotObjectBase( f ),
@ -41,7 +41,7 @@ protected:
{ {
} }
private: private:
const int* m_parameterTypes; // static array, only needed for Qt::QueuedConnection const int* m_parameterTypes; // static array, only needed for Qt::QueuedConnection
}; };
@ -55,7 +55,7 @@ namespace QskMetaFunctionCall
{ {
using MetaCall = StaticFunctionCall< Function, Args, R >; using MetaCall = StaticFunctionCall< Function, Args, R >;
public: public:
explicit inline StaticFunctionCall( Function function ): explicit inline StaticFunctionCall( Function function ):
FunctionCall( &invoke ), FunctionCall( &invoke ),
m_function( function ) m_function( function )
@ -95,7 +95,7 @@ namespace QskMetaFunctionCall
} }
} }
private: private:
Function m_function; Function m_function;
}; };
@ -104,7 +104,7 @@ namespace QskMetaFunctionCall
{ {
using MetaCall = MemberFunctionCall< Function, Args, R >; using MetaCall = MemberFunctionCall< Function, Args, R >;
public: public:
explicit inline MemberFunctionCall( Function function ): explicit inline MemberFunctionCall( Function function ):
FunctionCall( &invoke ), FunctionCall( &invoke ),
m_function( function ) m_function( function )
@ -139,7 +139,7 @@ namespace QskMetaFunctionCall
} }
} }
private: private:
Function m_function; Function m_function;
}; };
@ -148,7 +148,7 @@ namespace QskMetaFunctionCall
{ {
using MetaCall = FunctorFunctionCall< Function, N, Args, R >; using MetaCall = FunctorFunctionCall< Function, N, Args, R >;
public: public:
explicit inline FunctorFunctionCall( Function function ): explicit inline FunctorFunctionCall( Function function ):
FunctionCall( &invoke ), FunctionCall( &invoke ),
m_function( function ) m_function( function )
@ -182,7 +182,7 @@ namespace QskMetaFunctionCall
} }
} }
private: private:
Function m_function; Function m_function;
}; };
} }

View File

@ -23,7 +23,7 @@ static void qskRegisterMetaInvokable()
Q_CONSTRUCTOR_FUNCTION( qskRegisterMetaInvokable ) Q_CONSTRUCTOR_FUNCTION( qskRegisterMetaInvokable )
static inline void *qskMetaTypeCreate( int type, const void *copy ) static inline void* qskMetaTypeCreate( int type, const void* copy )
{ {
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 ) #if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
return QMetaType( type ).create( copy ); return QMetaType( type ).create( copy );

View File

@ -113,7 +113,7 @@ namespace
const int numTicks = qCeil( qAbs( intervalSize / minStep ) ) - 1; const int numTicks = qCeil( qAbs( intervalSize / minStep ) ) - 1;
// Do the minor steps fit into the interval? // Do the minor steps fit into the interval?
if ( fuzzyCompare( ( numTicks + 1 ) * qAbs( minStep ), if ( fuzzyCompare( ( numTicks + 1 ) * qAbs( minStep ),
qAbs( intervalSize ), intervalSize ) > 0 ) qAbs( intervalSize ), intervalSize ) > 0 )
{ {
// The minor steps doesn't fit into the interval // The minor steps doesn't fit into the interval
@ -163,7 +163,7 @@ QskScaleTickmarks QskScaleEngine::divideScale(
const auto interval = QskIntervalF::normalized( x1, x2 ); const auto interval = QskIntervalF::normalized( x1, x2 );
if ( interval.width() > std::numeric_limits<qreal>::max() ) if ( interval.width() > std::numeric_limits< qreal >::max() )
{ {
qWarning() << "QskScaleEngine::divideScale: overflow"; qWarning() << "QskScaleEngine::divideScale: overflow";
return tickmarks; return tickmarks;
@ -223,7 +223,7 @@ QskIntervalF QskScaleEngine::align( const QskIntervalF& interval, qreal stepSize
// when there is no rounding beside some effect, when // when there is no rounding beside some effect, when
// calculating with doubles, we keep the original value // calculating with doubles, we keep the original value
const auto max = std::numeric_limits<qreal>::max(); const auto max = std::numeric_limits< qreal >::max();
if ( -max + stepSize <= x1 ) if ( -max + stepSize <= x1 )
{ {
@ -242,11 +242,11 @@ QskIntervalF QskScaleEngine::align( const QskIntervalF& interval, qreal stepSize
return QskIntervalF( x1, x2 ); return QskIntervalF( x1, x2 );
} }
QVector<qreal> QskScaleEngine::strip( QVector< qreal > QskScaleEngine::strip(
const QVector<qreal>& ticks, const QskIntervalF& interval ) const const QVector< qreal >& ticks, const QskIntervalF& interval ) const
{ {
if ( !interval.isValid() || ticks.count() == 0 ) if ( !interval.isValid() || ticks.count() == 0 )
return QVector<qreal>(); return QVector< qreal >();
if ( fuzzyContains( interval, ticks.first() ) if ( fuzzyContains( interval, ticks.first() )
&& fuzzyContains( interval, ticks.last() ) ) && fuzzyContains( interval, ticks.last() ) )
@ -254,7 +254,7 @@ QVector<qreal> QskScaleEngine::strip(
return ticks; return ticks;
} }
QVector<qreal> strippedTicks; QVector< qreal > strippedTicks;
for ( int i = 0; i < ticks.count(); i++ ) for ( int i = 0; i < ticks.count(); i++ )
{ {
if ( fuzzyContains( interval, ticks[i] ) ) if ( fuzzyContains( interval, ticks[i] ) )
@ -265,13 +265,13 @@ QVector<qreal> QskScaleEngine::strip(
} }
QskScaleTickmarks QskScaleEngine::buildTicks( QskScaleTickmarks QskScaleEngine::buildTicks(
const QskIntervalF &interval, qreal stepSize, int maxMinorSteps ) const const QskIntervalF& interval, qreal stepSize, int maxMinorSteps ) const
{ {
using T = QskScaleTickmarks; using T = QskScaleTickmarks;
const auto boundingInterval = align( interval, stepSize ); const auto boundingInterval = align( interval, stepSize );
QVector<qreal> ticks[3]; QVector< qreal > ticks[3];
ticks[T::MajorTick] = buildMajorTicks( boundingInterval, stepSize ); ticks[T::MajorTick] = buildMajorTicks( boundingInterval, stepSize );
if ( maxMinorSteps > 0 ) if ( maxMinorSteps > 0 )
@ -302,14 +302,14 @@ QskScaleTickmarks QskScaleEngine::buildTicks(
return tickmarks; return tickmarks;
} }
QVector<qreal> QskScaleEngine::buildMajorTicks( QVector< qreal > QskScaleEngine::buildMajorTicks(
const QskIntervalF& interval, qreal stepSize ) const const QskIntervalF& interval, qreal stepSize ) const
{ {
int numTicks = qRound( interval.width() / stepSize ) + 1; int numTicks = qRound( interval.width() / stepSize ) + 1;
if ( numTicks > 10000 ) if ( numTicks > 10000 )
numTicks = 10000; numTicks = 10000;
QVector<qreal> ticks; QVector< qreal > ticks;
ticks.reserve( numTicks ); ticks.reserve( numTicks );
ticks += interval.lowerBound(); ticks += interval.lowerBound();
@ -321,8 +321,8 @@ QVector<qreal> QskScaleEngine::buildMajorTicks(
} }
void QskScaleEngine::buildMinorTicks( void QskScaleEngine::buildMinorTicks(
const QVector<qreal>& majorTicks, int maxMinorSteps, qreal stepSize, const QVector< qreal >& majorTicks, int maxMinorSteps, qreal stepSize,
QVector<qreal> &minorTicks, QVector<qreal> &mediumTicks ) const QVector< qreal >& minorTicks, QVector< qreal >& mediumTicks ) const
{ {
auto minStep = minorStepSize( stepSize, maxMinorSteps ); auto minStep = minorStepSize( stepSize, maxMinorSteps );
if ( minStep == 0.0 ) if ( minStep == 0.0 )

View File

@ -38,21 +38,21 @@ class QSK_EXPORT QskScaleEngine
QskScaleTickmarks divideScale(qreal x1, qreal x2, QskScaleTickmarks divideScale(qreal x1, qreal x2,
int maxMajorSteps, int maxMinorSteps, qreal stepSize = 0.0) const; int maxMajorSteps, int maxMinorSteps, qreal stepSize = 0.0) const;
void autoScale( int maxNumSteps, qreal &x1, qreal &x2, qreal &stepSize ) const; void autoScale( int maxNumSteps, qreal& x1, qreal& x2, qreal& stepSize ) const;
private: private:
QskIntervalF align( const QskIntervalF&, qreal stepSize ) const; QskIntervalF align( const QskIntervalF&, qreal stepSize ) const;
QVector<qreal> strip( const QVector<qreal>&, const QskIntervalF& ) const; QVector< qreal > strip( const QVector< qreal >&, const QskIntervalF& ) const;
QskScaleTickmarks buildTicks( QskScaleTickmarks buildTicks(
const QskIntervalF&, qreal stepSize, int maxMinorSteps ) const; const QskIntervalF&, qreal stepSize, int maxMinorSteps ) const;
QVector<qreal> buildMajorTicks( const QskIntervalF&, qreal stepSize ) const; QVector< qreal > buildMajorTicks( const QskIntervalF&, qreal stepSize ) const;
void buildMinorTicks( const QVector<qreal>& majorTicks, void buildMinorTicks( const QVector< qreal >& majorTicks,
int maxMinorSteps, qreal stepSize, QVector<qreal>& minorTicks, int maxMinorSteps, qreal stepSize, QVector< qreal >& minorTicks,
QVector<qreal>& mediumTicks ) const; QVector< qreal >& mediumTicks ) const;
Attributes m_attributes; Attributes m_attributes;
}; };

View File

@ -26,12 +26,12 @@ int QskScaleTickmarks::tickCount( TickType type ) const noexcept
return m_ticks[ type ].count(); return m_ticks[ type ].count();
} }
QVector<qreal> QskScaleTickmarks::ticks( TickType type ) const noexcept QVector< qreal > QskScaleTickmarks::ticks( TickType type ) const noexcept
{ {
return m_ticks[ type ]; return m_ticks[ type ];
} }
void QskScaleTickmarks::setTicks(TickType type, const QVector<qreal>& ticks ) void QskScaleTickmarks::setTicks(TickType type, const QVector< qreal >& ticks )
{ {
m_ticks[ type ] = ticks; m_ticks[ type ] = ticks;
} }
@ -59,7 +59,7 @@ uint QskScaleTickmarks::hash( uint seed ) const
return seed; return seed;
} }
bool QskScaleTickmarks::operator==( const QskScaleTickmarks &other ) const noexcept bool QskScaleTickmarks::operator==( const QskScaleTickmarks& other ) const noexcept
{ {
return ( m_ticks[ 0 ] == other.m_ticks[ 0 ] ) return ( m_ticks[ 0 ] == other.m_ticks[ 0 ] )
&& ( m_ticks[ 1 ] == other.m_ticks[ 1 ] ) && ( m_ticks[ 1 ] == other.m_ticks[ 1 ] )

View File

@ -13,9 +13,9 @@ class QSK_EXPORT QskScaleTickmarks
{ {
Q_GADGET Q_GADGET
Q_PROPERTY( QVector<qreal> majorTicks READ majorTicks WRITE setMajorTicks ) Q_PROPERTY( QVector< qreal > majorTicks READ majorTicks WRITE setMajorTicks )
Q_PROPERTY( QVector<qreal> mediumTicks READ mediumTicks WRITE setMediumTicks ) Q_PROPERTY( QVector< qreal > mediumTicks READ mediumTicks WRITE setMediumTicks )
Q_PROPERTY( QVector<qreal> minorTicks READ minorTicks WRITE setMinorTicks ) Q_PROPERTY( QVector< qreal > minorTicks READ minorTicks WRITE setMinorTicks )
public: public:
enum TickType enum TickType
@ -36,17 +36,17 @@ class QSK_EXPORT QskScaleTickmarks
int tickCount() const noexcept; int tickCount() const noexcept;
int tickCount( TickType ) const noexcept; int tickCount( TickType ) const noexcept;
QVector<qreal> ticks( TickType ) const noexcept; QVector< qreal > ticks( TickType ) const noexcept;
void setTicks( TickType, const QVector<qreal> & ); void setTicks( TickType, const QVector< qreal >& );
void setMinorTicks( const QVector<qreal>& ); void setMinorTicks( const QVector< qreal >& );
QVector<qreal> minorTicks() const noexcept; QVector< qreal > minorTicks() const noexcept;
void setMediumTicks( const QVector<qreal>& ); void setMediumTicks( const QVector< qreal >& );
QVector<qreal> mediumTicks() const noexcept; QVector< qreal > mediumTicks() const noexcept;
void setMajorTicks( const QVector<qreal>& ); void setMajorTicks( const QVector< qreal >& );
QVector<qreal> majorTicks() const noexcept; QVector< qreal > majorTicks() const noexcept;
void invert(); void invert();
void reset(); void reset();
@ -57,32 +57,32 @@ class QSK_EXPORT QskScaleTickmarks
QVector< qreal > m_ticks[ 3 ]; QVector< qreal > m_ticks[ 3 ];
}; };
inline void QskScaleTickmarks::setMinorTicks( const QVector<qreal>& ticks ) inline void QskScaleTickmarks::setMinorTicks( const QVector< qreal >& ticks )
{ {
setTicks( MinorTick, ticks ); setTicks( MinorTick, ticks );
} }
inline QVector<qreal> QskScaleTickmarks::minorTicks() const noexcept inline QVector< qreal > QskScaleTickmarks::minorTicks() const noexcept
{ {
return ticks( MinorTick ); return ticks( MinorTick );
} }
inline void QskScaleTickmarks::setMediumTicks( const QVector<qreal>& ticks ) inline void QskScaleTickmarks::setMediumTicks( const QVector< qreal >& ticks )
{ {
setTicks( MediumTick, ticks ); setTicks( MediumTick, ticks );
} }
inline QVector<qreal> QskScaleTickmarks::mediumTicks() const noexcept inline QVector< qreal > QskScaleTickmarks::mediumTicks() const noexcept
{ {
return ticks( MediumTick ); return ticks( MediumTick );
} }
inline void QskScaleTickmarks::setMajorTicks( const QVector<qreal>& ticks ) inline void QskScaleTickmarks::setMajorTicks( const QVector< qreal >& ticks )
{ {
setTicks( MajorTick, ticks ); setTicks( MajorTick, ticks );
} }
inline QVector<qreal> QskScaleTickmarks::majorTicks() const noexcept inline QVector< qreal > QskScaleTickmarks::majorTicks() const noexcept
{ {
return ticks( MajorTick ); return ticks( MajorTick );
} }

View File

@ -252,7 +252,7 @@ bool QskShortcutHandler::eventFilter( QObject* object, QEvent* event )
Q_ASSERT( data.item == nullptr || data.item == object ); Q_ASSERT( data.item == nullptr || data.item == object );
data.invoke( ); data.invoke();
return true; return true;
} }

View File

@ -676,7 +676,7 @@ void QskGraphic::render( QPainter* painter, const QRectF& rect,
} }
const auto& pr = m_data->pointRect; const auto& pr = m_data->pointRect;
const auto rc = rect.center(); const auto rc = rect.center();
QTransform tr; QTransform tr;
tr.translate( tr.translate(
@ -1025,7 +1025,7 @@ QDebug operator<<( QDebug debug, const QskGraphic& graphic )
debug << "\n Path(" << path.elementCount() << ")"; debug << "\n Path(" << path.elementCount() << ")";
const char *types[] = { "MoveTo", "LineTo", "CurveTo", "CurveToData" }; const char* types[] = { "MoveTo", "LineTo", "CurveTo", "CurveToData" };
for ( int i = 0; i < path.elementCount(); i++ ) for ( int i = 0; i < path.elementCount(); i++ )
{ {

View File

@ -119,7 +119,7 @@ int QskGridBox::addItem( QQuickItem* item,
} }
int QskGridBox::addItem( QQuickItem* item, int QskGridBox::addItem( QQuickItem* item,
int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment ) int row, int column, int rowSpan, int columnSpan, Qt::Alignment alignment )
{ {
if ( auto control = qskControlCast( item ) ) if ( auto control = qskControlCast( item ) )
control->setLayoutAlignmentHint( alignment ); control->setLayoutAlignmentHint( alignment );
@ -459,7 +459,7 @@ void QskGridBox::itemChange( ItemChange change, const ItemChangeData& value )
bool QskGridBox::event( QEvent* event ) bool QskGridBox::event( QEvent* event )
{ {
switch ( static_cast<int>( event->type() ) ) switch ( static_cast< int >( event->type() ) )
{ {
case QEvent::LayoutRequest: case QEvent::LayoutRequest:
{ {

View File

@ -434,7 +434,7 @@ bool QskGridLayoutEngine::setColumnSizeHint(
if ( !m_data->columnSettings.setHintAt( column, which, width ) ) if ( !m_data->columnSettings.setHintAt( column, which, width ) )
return false; return false;
if ( column >= m_data->columnCount ) if ( column >= m_data->columnCount )
m_data->columnCount = column + 1; m_data->columnCount = column + 1;
invalidate(); invalidate();

View File

@ -237,7 +237,7 @@ void QskLinearBox::itemChange( ItemChange change, const ItemChangeData& value )
bool QskLinearBox::event( QEvent* event ) bool QskLinearBox::event( QEvent* event )
{ {
switch ( static_cast<int>( event->type() ) ) switch ( static_cast< int >( event->type() ) )
{ {
case QEvent::LayoutRequest: case QEvent::LayoutRequest:
{ {

View File

@ -81,7 +81,7 @@ static qreal qskLayoutText( QTextLayout* layout,
with QTextOption::NoWrap - even if word wrapping with QTextOption::NoWrap - even if word wrapping
for elided text does not make any sense. for elided text does not make any sense.
Needs some debugging of QTextLine::layout_helper, TODO ... Needs some debugging of QTextLine::layout_helper, TODO ...
*/ */
auto option = layout->textOption(); auto option = layout->textOption();
option.setWrapMode( QTextOption::WrapAnywhere ); option.setWrapMode( QTextOption::WrapAnywhere );
layout->setTextOption( option ); layout->setTextOption( option );

View File

@ -42,8 +42,7 @@ namespace QskTextureRenderer
virtual void paint( QPainter*, const QSize& ) = 0; virtual void paint( QPainter*, const QSize& ) = 0;
}; };
QSK_EXPORT uint createTexture( QSK_EXPORT uint createTexture( RenderMode, const QSize&, PaintHelper* );
RenderMode, const QSize&, PaintHelper* helper );
QSK_EXPORT uint createTextureFromGraphic( QSK_EXPORT uint createTextureFromGraphic(
RenderMode, const QSize&, const QskGraphic&, RenderMode, const QSize&, const QskGraphic&,

View File

@ -86,7 +86,7 @@ void QskTickmarksNode::update(
for( int i = TM::MinorTick; i <= TM::MajorTick; i++ ) for( int i = TM::MinorTick; i <= TM::MajorTick; i++ )
{ {
const auto tickType = static_cast< TM::TickType >(i); const auto tickType = static_cast< TM::TickType >( i );
const auto ticks = tickmarks.ticks( tickType ); const auto ticks = tickmarks.ticks( tickType );
if ( orientation == Qt::Horizontal ) if ( orientation == Qt::Horizontal )