diff --git a/src/common/QskArcMetrics.h b/src/common/QskArcMetrics.h index 267a9b54..2ff493ee 100644 --- a/src/common/QskArcMetrics.h +++ b/src/common/QskArcMetrics.h @@ -84,9 +84,9 @@ inline bool QskArcMetrics::operator==( const QskArcMetrics& other ) const noexcept { return ( qskFuzzyCompare( m_width, other.m_width ) - && qskFuzzyCompare( m_startAngle, other.m_startAngle ) - && qskFuzzyCompare( m_spanAngle, other.m_spanAngle ) - && m_sizeMode == other.m_sizeMode ); + && qskFuzzyCompare( m_startAngle, other.m_startAngle ) + && qskFuzzyCompare( m_spanAngle, other.m_spanAngle ) + && m_sizeMode == other.m_sizeMode ); } inline bool QskArcMetrics::operator!=( diff --git a/src/common/QskGradient.cpp b/src/common/QskGradient.cpp index 2270e617..eaf98380 100644 --- a/src/common/QskGradient.cpp +++ b/src/common/QskGradient.cpp @@ -145,7 +145,7 @@ static inline QskGradientStops qskExtractedStops( } const auto color = - QskGradientStop::interpolated( stops[i-1], stops[i], from ); + QskGradientStop::interpolated( stops[i - 1], stops[i], from ); extracted += QskGradientStop( 0.0, color ); } @@ -161,7 +161,7 @@ static inline QskGradientStops qskExtractedStops( extracted += QskGradientStop( pos, s.color() ); } - const auto color = QskGradientStop::interpolated( stops[i-1], stops[i], to ); + const auto color = QskGradientStop::interpolated( stops[i - 1], stops[i], to ); extracted += QskGradientStop( 1.0, color ); return extracted; @@ -370,7 +370,7 @@ bool QskGradient::hasStopAt( qreal value ) const uint QskGradient::hash( uint seed ) const { - if ( m_stops.isEmpty() ) + if ( m_stops.isEmpty() ) return seed; uint hash = qHashBits( &m_orientation, sizeof( m_orientation ), seed ); diff --git a/src/common/QskObjectCounter.cpp b/src/common/QskObjectCounter.cpp index 04a8ed17..7cc95051 100644 --- a/src/common/QskObjectCounter.cpp +++ b/src/common/QskObjectCounter.cpp @@ -342,7 +342,7 @@ void QskObjectCounter::debugStatistics( QDebug debug, ObjectType objectType ) co { debug << "\tClass: " << object->metaObject()->className(); if ( !object->objectName().isEmpty() ) - debug << " Name: " << object->objectName(); + debug << " Name: " << object->objectName(); debug << '\n'; } } diff --git a/src/common/QskRgbPalette.cpp b/src/common/QskRgbPalette.cpp index 13817014..79d715b6 100644 --- a/src/common/QskRgbPalette.cpp +++ b/src/common/QskRgbPalette.cpp @@ -10,10 +10,10 @@ #define RGB( color, weight ) color ## weight #define RGBTABLE( c ) \ -{ \ - RGB( c, 50 ), RGB( c, 100 ), RGB( c, 200 ), RGB( c, 300 ), RGB( c, 400 ), \ - RGB( c, 500 ), RGB( c, 600 ), RGB( c, 700 ), RGB( c, 800 ), RGB( c, 900 ) \ -} + { \ + RGB( c, 50 ), RGB( c, 100 ), RGB( c, 200 ), RGB( c, 300 ), RGB( c, 400 ), \ + RGB( c, 500 ), RGB( c, 600 ), RGB( c, 700 ), RGB( c, 800 ), RGB( c, 900 ) \ + } namespace { @@ -77,7 +77,7 @@ static QskGradientStops qskColorStops( for ( int i = 1; i < count; i++ ) { const qreal pos = i * step; - stops += QskGradientStop( pos, rgb[i-1] ); + stops += QskGradientStop( pos, rgb[i - 1] ); stops += QskGradientStop( pos, rgb[i] ); } } diff --git a/src/controls/QskGraphicLabelSkinlet.cpp b/src/controls/QskGraphicLabelSkinlet.cpp index c37705d6..ea85c8f8 100644 --- a/src/controls/QskGraphicLabelSkinlet.cpp +++ b/src/controls/QskGraphicLabelSkinlet.cpp @@ -151,7 +151,7 @@ QSizeF QskGraphicLabelSkinlet::sizeHint( const QskSkinnable* skinnable, constexpr qreal max = std::numeric_limits< int >::max(); QRectF r( 0.0, 0.0, max, max ); - + if ( constraint.width() >= 0.0 ) r.setWidth( constraint.width() ); else @@ -164,7 +164,7 @@ QSizeF QskGraphicLabelSkinlet::sizeHint( const QskSkinnable* skinnable, if ( constraint.width() >= 0.0 ) hint.setHeight( innerConstraint.width() / aspectRatio ); - else + else hint.setWidth( innerConstraint.height() * aspectRatio ); } diff --git a/src/controls/QskListViewSkinlet.cpp b/src/controls/QskListViewSkinlet.cpp index 52dfcfee..c7245306 100644 --- a/src/controls/QskListViewSkinlet.cpp +++ b/src/controls/QskListViewSkinlet.cpp @@ -437,7 +437,7 @@ QSGNode* QskListViewSkinlet::updateCellNode( const QskListView* listView, QskAspect::States rowStates; if ( row == listView->selectedRow() ) rowStates |= QskListView::Selected; - + QskSkinStateChanger stateChanger( listView, rowStates ); QSGNode* newNode = nullptr; diff --git a/src/controls/QskMenu.cpp b/src/controls/QskMenu.cpp index 5a6dd5b5..8db00e79 100644 --- a/src/controls/QskMenu.cpp +++ b/src/controls/QskMenu.cpp @@ -17,15 +17,15 @@ QSK_SYSTEM_STATE( QskMenu, Selected, QskAspect::FirstSystemState << 2 ) class QskMenu::PrivateData { - public: - QVector< Entry > entries; - QVector< QskGraphic > icons; + public: + QVector< Entry > entries; + QVector< QskGraphic > icons; - QskTextOptions textOptions; - QPointF origin; + QskTextOptions textOptions; + QPointF origin; - int currentIndex = 0; - bool isPressed = false; + int currentIndex = 0; + bool isPressed = false; }; QskMenu::QskMenu( QQuickItem* parent ) @@ -48,14 +48,14 @@ QskMenu::~QskMenu() } void QskMenu::setOrigin( const QPointF& origin ) -{ +{ if ( origin != m_data->origin ) { m_data->origin = origin; Q_EMIT originChanged( origin ); } } - + QPointF QskMenu::origin() const { return m_data->origin; @@ -275,7 +275,7 @@ void QskMenu::mouseReleaseEvent( QMouseEvent* event ) } void QskMenu::aboutToShow() -{ +{ setGeometry( QRectF( m_data->origin, sizeConstraint() ) ); Inherited::aboutToShow(); } @@ -293,7 +293,7 @@ void QskMenu::setSelectedIndex( int index ) if ( index >= 0 ) setCurrentIndex( index ); - + Q_EMIT triggered( index ); close(); } diff --git a/src/controls/QskMenu.h b/src/controls/QskMenu.h index 73f0bf26..2c6638a6 100644 --- a/src/controls/QskMenu.h +++ b/src/controls/QskMenu.h @@ -19,12 +19,12 @@ class QSK_EXPORT QskMenu : public QskPopup Q_OBJECT Q_PROPERTY( QPointF origin READ origin - WRITE setOrigin NOTIFY originChanged ) + WRITE setOrigin NOTIFY originChanged ) Q_PROPERTY( int count READ count ) Q_PROPERTY( int currentIndex READ currentIndex - WRITE setCurrentIndex NOTIFY currentIndexChanged ) + WRITE setCurrentIndex NOTIFY currentIndexChanged ) using Inherited = QskPopup; diff --git a/src/controls/QskMenuSkinlet.cpp b/src/controls/QskMenuSkinlet.cpp index 0b653255..bc9799e5 100644 --- a/src/controls/QskMenuSkinlet.cpp +++ b/src/controls/QskMenuSkinlet.cpp @@ -52,19 +52,19 @@ static QSizeF qskIconSize( const QskMenu* menu ) const auto hint = menu->strutSizeHint( QskMenu::Graphic ); const qreal textHeight = QFontMetrics( menu->effectiveFont( QskMenu::Text ) ).height(); - + const auto h = qMax( hint.height(), textHeight ); - + qreal maxW = 0.0; for ( int i = 0; i < menu->count(); i++ ) { const auto w = menu->graphicAt( i ).widthForHeight( h ); - if( w > maxW ) + if( w > maxW ) maxW = w; - } - + } + const auto w = qMax( hint.width(), maxW ); - + return QSizeF( w, h ); } @@ -98,7 +98,7 @@ static QSGNode* qskUpdateTextNode( const QskMenu* menu, QskMenu::Text, Qt::AlignVCenter | Qt::AlignLeft ); return QskSkinlet::updateTextNode( menu, node, rect, alignment, - text, menu->textOptions(), QskMenu::Text ); + text, menu->textOptions(), QskMenu::Text ); } static QSGNode* qskUpdateBackgroundNode( const QskMenu*, QSGNode* ) @@ -213,7 +213,7 @@ static QSGNode* qskUpdateItemsNode( const QskMenu* menu, QSGNode* rootNode ) auto textRect = cellRect; textRect.setX( graphicRect.right() + spacing ); - + qskUpdateItemNode( menu, graphicRect, menu->graphicAt( i ), textRect, menu->entryAt( i ).text, node ); } @@ -284,7 +284,7 @@ QSGNode* QskMenuSkinlet::updateContentsNode( { newNode = qskUpdateItemsNode( menu, oldNode ); break; - } + } } QskSGNode::replaceChildNode( roles, role, contentsNode, oldNode, newNode ); diff --git a/src/controls/QskMenuSkinlet.h b/src/controls/QskMenuSkinlet.h index f70f9dc2..45afc170 100644 --- a/src/controls/QskMenuSkinlet.h +++ b/src/controls/QskMenuSkinlet.h @@ -20,8 +20,8 @@ class QSK_EXPORT QskMenuSkinlet : public QskPopupSkinlet Q_INVOKABLE QskMenuSkinlet( QskSkin* = nullptr ); ~QskMenuSkinlet() = default; - QRectF subControlRect( const QskSkinnable*, const QRectF&, - QskAspect::Subcontrol ) const override; + QRectF subControlRect( const QskSkinnable*, + const QRectF&, QskAspect::Subcontrol ) const override; QSizeF sizeHint( const QskSkinnable*, Qt::SizeHint, const QSizeF& ) const override; diff --git a/src/controls/QskPopup.cpp b/src/controls/QskPopup.cpp index d109248a..5fbd2af3 100644 --- a/src/controls/QskPopup.cpp +++ b/src/controls/QskPopup.cpp @@ -144,7 +144,7 @@ QskPopup::QskPopup( QQuickItem* parent ) Unfortunatly derived classes can't use setAcceptedMouseButtons anymore. Need to think about a solution TODO ... */ - + Inherited::setAcceptedMouseButtons( Qt::AllButtons ); Inherited::setWheelEnabled( true ); diff --git a/src/controls/QskPushButton.h b/src/controls/QskPushButton.h index a1f968fc..0a9cc6b8 100644 --- a/src/controls/QskPushButton.h +++ b/src/controls/QskPushButton.h @@ -39,7 +39,7 @@ class QSK_EXPORT QskPushButton : public QskAbstractButton Q_PROPERTY( bool flat READ isFlat WRITE setFlat NOTIFY flatChanged FINAL ) Q_PROPERTY( QskBoxShapeMetrics shape READ shape - WRITE setShape RESET resetShape NOTIFY shapeChanged ) + WRITE setShape RESET resetShape NOTIFY shapeChanged ) using Inherited = QskAbstractButton; diff --git a/src/controls/QskSkinHintTable.cpp b/src/controls/QskSkinHintTable.cpp index 9b198b6f..9bac96f0 100644 --- a/src/controls/QskSkinHintTable.cpp +++ b/src/controls/QskSkinHintTable.cpp @@ -32,7 +32,7 @@ inline const QVariant* qskResolvedHint( QskAspect aspect, We intend to remove the obscure mechanism of resolving a hint by dropping the state bits ony by one in the future. Instead we will have methods in QskSkinHintTableEditor, that allow - to set combinations of states in one call. + to set combinations of states in one call. */ if ( const auto topState = aspect.topState() ) { diff --git a/src/controls/QskSkinHintTableEditor.cpp b/src/controls/QskSkinHintTableEditor.cpp index f05521be..2eb5234a 100644 --- a/src/controls/QskSkinHintTableEditor.cpp +++ b/src/controls/QskSkinHintTableEditor.cpp @@ -19,7 +19,7 @@ namespace { using StateInt = typename std::underlying_type< QskAspect::State >::type; - const auto count = qCountTrailingZeroBits( static_cast< StateInt >( mask ) ); + const auto count = qCountTrailingZeroBits( static_cast< StateInt >( mask ) ); return static_cast< QskAspect::State >( 1 << count ); } @@ -46,19 +46,19 @@ namespace inline bool removeHintStateMask( QskSkinHintTable* table, QskAspect aspect, bool noState, QskAspect::States states, QskAspect::States mask ) - { + { if ( mask == 0 ) - { + { if ( noState || states != 0 ) return table->removeHint( aspect | states ); - + return false; } - + const auto stateLow = lowestState( mask ); - + mask &= ~stateLow; - + bool ret = removeHintStateMask( table, aspect, noState, states, mask ); ret |= removeHintStateMask( table, aspect, noState, states | stateLow, mask ); diff --git a/src/controls/QskSkinlet.cpp b/src/controls/QskSkinlet.cpp index 2ac36f97..cd43a5e9 100644 --- a/src/controls/QskSkinlet.cpp +++ b/src/controls/QskSkinlet.cpp @@ -26,7 +26,7 @@ #include #include -static inline QRectF qskSceneAlignedRect( const QQuickItem* item , const QRectF& rect ) +static inline QRectF qskSceneAlignedRect( const QQuickItem* item, const QRectF& rect ) { /* Aligning rect according to scene coordinates, so that @@ -568,7 +568,7 @@ QSizeF QskSkinlet::hintWithoutConstraint( { /* This method is useful in situations, where a hint has been calculated - from a constraint and we want to return the calculated part only + from a constraint and we want to return the calculated part only */ QSizeF h; diff --git a/src/controls/QskSkinlet.h b/src/controls/QskSkinlet.h index 2b058c9e..f5e42795 100644 --- a/src/controls/QskSkinlet.h +++ b/src/controls/QskSkinlet.h @@ -122,7 +122,7 @@ class QSK_EXPORT QskSkinlet void replaceChildNode( quint8 nodeRole, QSGNode* parentNode, QSGNode* oldNode, QSGNode* newNode ) const; - QSizeF hintWithoutConstraint( + QSizeF hintWithoutConstraint( const QSizeF& hint, const QSizeF& constraint ) const; private: diff --git a/src/controls/QskStatusIndicator.h b/src/controls/QskStatusIndicator.h index 98314b2b..42c62399 100644 --- a/src/controls/QskStatusIndicator.h +++ b/src/controls/QskStatusIndicator.h @@ -44,7 +44,7 @@ class QSK_EXPORT QskStatusIndicator : public QskControl int status() const; bool hasStatus( int status ) const; - QList statusList() const; + QList< int > statusList() const; public Q_SLOTS: void setStatus( int status ); diff --git a/src/dialogs/QskDialogButtonBox.cpp b/src/dialogs/QskDialogButtonBox.cpp index 63912342..440c1142 100644 --- a/src/dialogs/QskDialogButtonBox.cpp +++ b/src/dialogs/QskDialogButtonBox.cpp @@ -67,7 +67,7 @@ namespace for ( int i = 0; i < buttons.count(); i++ ) addItem( buttons[ i ] ); } - } + } }; } diff --git a/src/nodes/QskArcNode.cpp b/src/nodes/QskArcNode.cpp index edb0f92c..c57f6f40 100644 --- a/src/nodes/QskArcNode.cpp +++ b/src/nodes/QskArcNode.cpp @@ -15,7 +15,7 @@ QskArcNode::~QskArcNode() } void QskArcNode::setArcData( const QRectF& rect, const QskArcMetrics& metrics, - const QskGradient &gradient, QQuickWindow* window ) + const QskGradient& gradient, QQuickWindow* window ) { m_metrics = metrics; m_gradient = gradient; @@ -23,7 +23,7 @@ void QskArcNode::setArcData( const QRectF& rect, const QskArcMetrics& metrics, update( window, QskTextureRenderer::AutoDetect, rect.toRect() ); } -void QskArcNode::paint( QPainter* painter, const QSizeF &size ) +void QskArcNode::paint( QPainter* painter, const QSizeF& size ) { const qreal w = m_metrics.width(); const QRectF rect( 0.5 * w, 0.5 * w, size.width() - w, size.height() - w );