diff --git a/src/controls/QskControl.cpp b/src/controls/QskControl.cpp index ce106c95..0c85e56d 100644 --- a/src/controls/QskControl.cpp +++ b/src/controls/QskControl.cpp @@ -102,7 +102,7 @@ namespace Q_GLOBAL_STATIC( QskWindowStore, qskReleasedWindowCounter ) -class QskControlPrivate : public QQuickItemPrivate +class QskControlPrivate final : public QQuickItemPrivate { Q_DECLARE_PUBLIC(QskControl) diff --git a/src/controls/QskEvent.h b/src/controls/QskEvent.h index 18799f22..c7a40e0b 100644 --- a/src/controls/QskEvent.h +++ b/src/controls/QskEvent.h @@ -72,7 +72,7 @@ public: virtual ~QskGestureEvent(); inline const QskGesture* gesture() const { return m_gesture; } - inline bool isGestureOwnedByEvent() const { return m_gestureOwnedByEvent; }; + inline bool isGestureOwnedByEvent() const { return m_gestureOwnedByEvent; } private: const QskGesture* m_gesture; @@ -92,7 +92,7 @@ public: virtual ~QskAnimatorEvent(); inline QskAspect::Aspect aspect() const { return m_aspect; } - inline State state() const { return m_state; }; + inline State state() const { return m_state; } private: const QskAspect::Aspect m_aspect; diff --git a/src/controls/QskObjectTree.h b/src/controls/QskObjectTree.h index 489d8dc0..257b55c0 100644 --- a/src/controls/QskObjectTree.h +++ b/src/controls/QskObjectTree.h @@ -17,6 +17,8 @@ namespace QskObjectTree class Visitor { public: + virtual ~Visitor() = default; + virtual bool visitDown( QObject* object ) = 0; virtual bool visitUp( const QObject* object ) = 0; }; diff --git a/src/controls/QskPageIndicator.h b/src/controls/QskPageIndicator.h index af7c0e22..67d09a8a 100644 --- a/src/controls/QskPageIndicator.h +++ b/src/controls/QskPageIndicator.h @@ -15,7 +15,7 @@ class QSK_EXPORT QskPageIndicator : public QskControl Q_OBJECT Q_PROPERTY ( int count READ count WRITE setCount NOTIFY countChanged FINAL ) - Q_PROPERTY ( int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL ) + Q_PROPERTY ( qreal currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL ) Q_PROPERTY ( Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL ) using Inherited = QskControl; diff --git a/src/controls/QskSkinnable.cpp b/src/controls/QskSkinnable.cpp index 049a7ece..6f6c3e0c 100644 --- a/src/controls/QskSkinnable.cpp +++ b/src/controls/QskSkinnable.cpp @@ -776,7 +776,7 @@ void QskSkinnable::setSkinStateFlag( QskAspect::State state, bool on ) Starting an animator for all primitives, that differ between the states */ - for ( int primitive = 0; primitive <= LastPrimitive; primitive++ ) + for ( uint primitive = 0; primitive <= LastPrimitive; primitive++ ) { aspect.setPrimitive( type, primitive ); diff --git a/src/controls/QskStatusIndicator.cpp b/src/controls/QskStatusIndicator.cpp index e399b7fb..35cb3fa3 100644 --- a/src/controls/QskStatusIndicator.cpp +++ b/src/controls/QskStatusIndicator.cpp @@ -16,11 +16,6 @@ namespace class StatusData { public: - StatusData(): - isDirty( false ) - { - } - StatusData( const QskGraphic& graphic ): graphic( graphic ), isDirty( false ) diff --git a/src/controls/QskSubWindowArea.cpp b/src/controls/QskSubWindowArea.cpp index c4c336ae..31162e38 100644 --- a/src/controls/QskSubWindowArea.cpp +++ b/src/controls/QskSubWindowArea.cpp @@ -50,7 +50,7 @@ static Qt::Edges qskSelectedEdges( const QRectF& rect, const QPointF& pos ) return edges; } -void qskDragWindow( const QPointF& off, Qt::Edges edges, QskSubWindow* window ) +static void qskDragWindow( const QPointF& off, Qt::Edges edges, QskSubWindow* window ) { if ( edges == 0 ) { diff --git a/src/dialogs/QskDialogSubWindow.cpp b/src/dialogs/QskDialogSubWindow.cpp index b432785c..2819ced7 100644 --- a/src/dialogs/QskDialogSubWindow.cpp +++ b/src/dialogs/QskDialogSubWindow.cpp @@ -112,7 +112,7 @@ void QskDialogSubWindow::updateLayout() QRectF rect; rect.setSize( sizeHint() ); - rect.moveCenter( QPoint( 0.5 * parentItem()->width(), 0.5 * parentItem()->height() ) ); + rect.moveCenter( QPointF( 0.5 * parentItem()->width(), 0.5 * parentItem()->height() ) ); setGeometry( rect ); } diff --git a/src/graphic/QskColorFilter.cpp b/src/graphic/QskColorFilter.cpp index b2f241db..e1a744d5 100644 --- a/src/graphic/QskColorFilter.cpp +++ b/src/graphic/QskColorFilter.cpp @@ -18,7 +18,7 @@ static inline QRgb qskSubstitutedRgb( const QRgb rgb = rgba | QskRgbValue::AlphaMask; - for ( const auto s : substitions ) + for ( const auto& s : substitions ) { if ( rgb == s.first ) { @@ -92,7 +92,7 @@ static inline QskColorFilter qskInterpolatedFilter( QskColorFilter interpolated; - for ( const auto pairTo : to.substitutions() ) + for ( const auto& pairTo : to.substitutions() ) { QRgb rgb = pairTo.first; @@ -117,11 +117,11 @@ static inline QskColorFilter qskInterpolatedFilter( of the substitution in from. */ - for ( const auto pairFrom : from.substitutions() ) + for ( const auto& pairFrom : from.substitutions() ) { bool hasRgb = false; - for ( const auto pairTo : to.substitutions() ) + for ( const auto& pairTo : to.substitutions() ) { if ( pairTo.first == pairFrom.first ) { diff --git a/src/graphic/QskGraphicTextureFactory.cpp b/src/graphic/QskGraphicTextureFactory.cpp index 557f7411..8805cd91 100644 --- a/src/graphic/QskGraphicTextureFactory.cpp +++ b/src/graphic/QskGraphicTextureFactory.cpp @@ -11,9 +11,11 @@ #include // VS2012+ disable keyword macroizing unless _ALLOW_KEYWORD_MACROS is set +#ifdef _MSC_VER #if ( _MSC_VER >= 1700 ) && !defined( _ALLOW_KEYWORD_MACROS ) #define _ALLOW_KEYWORD_MACROS #endif +#endif #define private public #include diff --git a/src/graphic/QskStandardSymbol.cpp b/src/graphic/QskStandardSymbol.cpp index 612b4a45..eb57c870 100644 --- a/src/graphic/QskStandardSymbol.cpp +++ b/src/graphic/QskStandardSymbol.cpp @@ -159,8 +159,8 @@ static void qskInformationGraphic( QPainter* painter ) const double w = 40; const double h = 50; - const QRect dotRect( 0.3 * w, 0.15 * h, 0.4 * w, 0.2 * h ); - const QRect barRect( 0.3 * w, 0.4 * h, 0.4 * w, 0.5 * h ); + const QRectF dotRect( 0.3 * w, 0.15 * h, 0.4 * w, 0.2 * h ); + const QRectF barRect( 0.3 * w, 0.4 * h, 0.4 * w, 0.5 * h ); QPainterPath path; diff --git a/src/layouts/QskGridBox.cpp b/src/layouts/QskGridBox.cpp index d6603f4c..8ea6c0ce 100644 --- a/src/layouts/QskGridBox.cpp +++ b/src/layouts/QskGridBox.cpp @@ -195,7 +195,7 @@ void QskGridBox::setHorizontalSpacing( qreal spacing ) } } -int QskGridBox::horizontalSpacing() const +qreal QskGridBox::horizontalSpacing() const { return engine().spacing( Qt::Horizontal ); } @@ -219,7 +219,7 @@ void QskGridBox::setVerticalSpacing( qreal spacing ) } } -int QskGridBox::verticalSpacing() const +qreal QskGridBox::verticalSpacing() const { return engine().spacing( Qt::Vertical ); } diff --git a/src/layouts/QskGridBox.h b/src/layouts/QskGridBox.h index 0216c1f4..fc2d8fe4 100644 --- a/src/layouts/QskGridBox.h +++ b/src/layouts/QskGridBox.h @@ -52,11 +52,11 @@ public: void setHorizontalSpacing( qreal spacing ); void resetHorizontalSpacing(); - int horizontalSpacing() const; + qreal horizontalSpacing() const; void setVerticalSpacing( qreal spacing ); void resetVerticalSpacing(); - int verticalSpacing() const; + qreal verticalSpacing() const; Q_INVOKABLE void setRowSpacing( int row, qreal spacing ); Q_INVOKABLE qreal rowSpacing( int row ) const; diff --git a/src/layouts/QskLayoutConstraint.cpp b/src/layouts/QskLayoutConstraint.cpp index f6c6e723..335671e3 100644 --- a/src/layouts/QskLayoutConstraint.cpp +++ b/src/layouts/QskLayoutConstraint.cpp @@ -26,7 +26,7 @@ static inline qreal qskHintFor( const QQuickItem* item, return -1; } -static inline qreal qskHasHintFor( const QQuickItem* item, const char* method ) +static inline bool qskHasHintFor( const QQuickItem* item, const char* method ) { if ( item->metaObject()->indexOfMethod( method ) >= 0 ) { diff --git a/src/layouts/QskLinearBox.cpp b/src/layouts/QskLinearBox.cpp index 357c8d45..92eb4c9f 100644 --- a/src/layouts/QskLinearBox.cpp +++ b/src/layouts/QskLinearBox.cpp @@ -12,7 +12,7 @@ class QskLinearBox::PrivateData { public: - PrivateData( Qt::Orientation orient, int dim ): + PrivateData( Qt::Orientation orient, uint dim ): dimension( dim ), orientation( orient ), transposeAlignments( false ) @@ -37,7 +37,7 @@ QskLinearBox::QskLinearBox( Qt::Orientation orientation, QQuickItem* parent ): } QskLinearBox::QskLinearBox( Qt::Orientation orientation, - int dimension, QQuickItem* parent ): + uint dimension, QQuickItem* parent ): Inherited( parent ), m_data ( new PrivateData( orientation, dimension ) ) { diff --git a/src/layouts/QskLinearBox.h b/src/layouts/QskLinearBox.h index 81db6a5e..a385e8ea 100644 --- a/src/layouts/QskLinearBox.h +++ b/src/layouts/QskLinearBox.h @@ -32,7 +32,7 @@ public: explicit QskLinearBox( QQuickItem* parent = nullptr ); explicit QskLinearBox( Qt::Orientation, QQuickItem* parent = nullptr ); - QskLinearBox( Qt::Orientation, int dimension, QQuickItem* parent = nullptr ); + QskLinearBox( Qt::Orientation, uint dimension, QQuickItem* parent = nullptr ); virtual ~QskLinearBox(); diff --git a/src/nodes/QskPlainTextRenderer.cpp b/src/nodes/QskPlainTextRenderer.cpp index 9c6c748e..1ad026ae 100644 --- a/src/nodes/QskPlainTextRenderer.cpp +++ b/src/nodes/QskPlainTextRenderer.cpp @@ -38,7 +38,7 @@ QRectF QskPlainTextRenderer::textRect( const QString& text, const QFont& font, const QskTextOptions& options, const QSizeF& size ) { const QFontMetricsF fm( font ); - const QRect r( 0, 0, size.width(), size.height() ); + const QRectF r( 0, 0, size.width(), size.height() ); return fm.boundingRect( r, options.textFlags(), text ); } diff --git a/src/nodes/QskRichTextRenderer.cpp b/src/nodes/QskRichTextRenderer.cpp index 5216e47d..8e14a3be 100644 --- a/src/nodes/QskRichTextRenderer.cpp +++ b/src/nodes/QskRichTextRenderer.cpp @@ -57,9 +57,6 @@ namespace setWrapMode( static_cast< QQuickText::WrapMode >( options.wrapMode() ) ); } - void refWindow( QQuickWindow* window ); - void derefWindow(); - void begin() { classBegin(); } void end() { componentComplete(); } diff --git a/src/nodes/QskTextureNode.cpp b/src/nodes/QskTextureNode.cpp index fb0fd767..ae553935 100644 --- a/src/nodes/QskTextureNode.cpp +++ b/src/nodes/QskTextureNode.cpp @@ -35,13 +35,13 @@ namespace virtual QSGMaterialType* type() const override; virtual QSGMaterialShader* createShader() const override; - void setTextureId(int ); - int textureId() const; + void setTextureId( uint ); + uint textureId() const; virtual int compare(const QSGMaterial* ) const override; private: - int m_textureId; + uint m_textureId; const bool m_isOpaque : 1; }; @@ -101,12 +101,12 @@ namespace setFlag(Blending, true ); // alpha blending } - void Material::setTextureId( int id ) + void Material::setTextureId( uint id ) { m_textureId = id; } - int Material::textureId() const + uint Material::textureId() const { return m_textureId; } @@ -133,11 +133,15 @@ namespace int Material::compare( const QSGMaterial* other ) const { const auto otherMaterial = static_cast< const Material* >( other ); - return m_textureId - otherMaterial->m_textureId; + + if ( m_textureId == otherMaterial->m_textureId ) + return 0; + + return ( m_textureId > otherMaterial->m_textureId ) ? 1 : -1; } } -class QskTextureNodePrivate : public QSGGeometryNodePrivate +class QskTextureNodePrivate final : public QSGGeometryNodePrivate { public: QskTextureNodePrivate(): @@ -199,7 +203,7 @@ QRectF QskTextureNode::rect() const return d->rect; } -void QskTextureNode::setTextureId( int textureId ) +void QskTextureNode::setTextureId( uint textureId ) { Q_D( QskTextureNode ); @@ -227,7 +231,7 @@ void QskTextureNode::setTextureId( int textureId ) markDirty( dirty ); } -int QskTextureNode::textureId() const +uint QskTextureNode::textureId() const { Q_D( const QskTextureNode ); return d->material.textureId(); diff --git a/src/nodes/QskTextureNode.h b/src/nodes/QskTextureNode.h index 6d602730..4714d90a 100644 --- a/src/nodes/QskTextureNode.h +++ b/src/nodes/QskTextureNode.h @@ -22,8 +22,8 @@ public: void setRect(const QRectF& rect); QRectF rect() const; - void setTextureId( int id ); - int textureId() const; + void setTextureId( uint id ); + uint textureId() const; void setMirrored( Qt::Orientations ); Qt::Orientations mirrored() const; diff --git a/src/skins/material/QskMaterialSkin.cpp b/src/skins/material/QskMaterialSkin.cpp index 7552cc66..8eb14d71 100644 --- a/src/skins/material/QskMaterialSkin.cpp +++ b/src/skins/material/QskMaterialSkin.cpp @@ -44,7 +44,7 @@ static const int qskDuration = 150; static inline QColor qskShadedColor( const QColor color, qreal opacity ) { QColor c = color; - c.setAlpha( 255 * opacity ); + c.setAlphaF( opacity ); return c; }