making clang happy

This commit is contained in:
Uwe Rathmann 2021-07-14 14:43:12 +02:00
parent 3df57c6025
commit 13867df163
9 changed files with 41 additions and 20 deletions

View File

@ -24,7 +24,6 @@ class Box : public QskLinearBox
private:
QString m_title;
QskTextLabel* m_label;
QskControl* m_content;
};
#endif // BOX_H

View File

@ -10,7 +10,7 @@
#include <QskLinearBox.h>
#include <QskTextLabel.h>
class MenuBarTopLabel : public QskGraphicLabel
class MenuBarTopLabel final : public QskGraphicLabel
{
Q_OBJECT
@ -23,7 +23,7 @@ class MenuBarTopLabel : public QskGraphicLabel
}
QskAspect::Subcontrol effectiveSubcontrol(
QskAspect::Subcontrol subControl ) const override final
QskAspect::Subcontrol subControl ) const override
{
if( subControl == QskGraphicLabel::Graphic )
{
@ -34,7 +34,7 @@ class MenuBarTopLabel : public QskGraphicLabel
}
};
class MenuBarGraphicLabel : public QskGraphicLabel
class MenuBarGraphicLabel final : public QskGraphicLabel
{
Q_OBJECT
@ -47,7 +47,7 @@ class MenuBarGraphicLabel : public QskGraphicLabel
}
QskAspect::Subcontrol effectiveSubcontrol(
QskAspect::Subcontrol subControl ) const override final
QskAspect::Subcontrol subControl ) const override
{
if( subControl == QskGraphicLabel::Graphic )
{
@ -58,7 +58,7 @@ class MenuBarGraphicLabel : public QskGraphicLabel
}
};
class MenuBarLabel : public QskTextLabel
class MenuBarLabel final : public QskTextLabel
{
Q_OBJECT
@ -71,7 +71,7 @@ class MenuBarLabel : public QskTextLabel
}
QskAspect::Subcontrol effectiveSubcontrol(
QskAspect::Subcontrol subControl ) const override final
QskAspect::Subcontrol subControl ) const override
{
if( subControl == QskTextLabel::Text )
{
@ -82,7 +82,7 @@ class MenuBarLabel : public QskTextLabel
}
};
class MenuItem : public QskLinearBox
class MenuItem final : public QskLinearBox
{
Q_OBJECT
@ -92,14 +92,13 @@ class MenuItem : public QskLinearBox
MenuItem( const QString& name, QQuickItem* parent );
QskAspect::Subcontrol effectiveSubcontrol( QskAspect::Subcontrol subControl ) const override final;
QskAspect::Subcontrol effectiveSubcontrol( QskAspect::Subcontrol ) const override;
private:
QString m_name;
bool m_isActive = false;
};
class MenuBar : public QskLinearBox
class MenuBar final : public QskLinearBox
{
Q_OBJECT
@ -109,7 +108,7 @@ class MenuBar : public QskLinearBox
MenuBar( QQuickItem* parent );
QskAspect::Subcontrol effectiveSubcontrol(
QskAspect::Subcontrol subControl ) const override final;
QskAspect::Subcontrol ) const override;
private:
QList< QString > m_entryStrings;

View File

@ -523,7 +523,7 @@ QSK_EXPORT void qskDebugAspect( QDebug, const QMetaObject*, QskAspect );
#define QSK_STATE( type, name, value ) \
static_assert( \
( value >= QskAspect::FirstUserState ) && ( value <= QskAspect::LastUserState ), \
( ( value ) >= QskAspect::FirstUserState ) && ( ( value ) <= QskAspect::LastUserState ), \
"Invalid state" \
); \
const QskAspect::State type::name = \
@ -531,8 +531,8 @@ QSK_EXPORT void qskDebugAspect( QDebug, const QMetaObject*, QskAspect );
#define QSK_SYSTEM_STATE( type, name, value ) \
static_assert( \
( value >= QskAspect::FirstSystemState && value < QskAspect::FirstUserState ) || \
( value > QskAspect::LastUserState && value <= QskAspect::LastSystemState ), \
( ( value ) >= QskAspect::FirstSystemState && ( value ) < QskAspect::FirstUserState ) || \
( ( value ) > QskAspect::LastUserState && ( value ) <= QskAspect::LastSystemState ), \
"Invalid system state" \
); \
const QskAspect::State type::name = \

View File

@ -190,7 +190,8 @@ inline void QskBoxShapeMetrics::setRadius(
inline constexpr QSizeF QskBoxShapeMetrics::radius( Qt::Corner corner ) const noexcept
{
return ( ( corner >= 0 ) && ( corner < 4 ) ) ? m_radii[ corner ] : QSizeF();
return ( ( static_cast< int >( corner ) >= 0 ) && ( static_cast< int >( corner ) < 4 ) )
? m_radii[ corner ] : QSizeF();
}
inline void QskBoxShapeMetrics::setSizeMode( Qt::SizeMode sizeMode ) noexcept

View File

@ -63,7 +63,7 @@ QRectF QskProgressBarSkinlet::subControlRect(
{
const auto bar = static_cast< const QskProgressBar* >( skinnable );
if( ( subControl == QskProgressBar::Groove ) )
if( subControl == QskProgressBar::Groove )
{
const auto extent = bar->extent();

View File

@ -195,14 +195,14 @@ QskSkin* QskSetup::setSkin( const QString& skinName )
if ( m_data->skin && ( skinName == m_data->skinName ) )
return m_data->skin;
QskSkin* skin = QskSkinManager::instance()->createSkin( skinName );
auto skin = QskSkinManager::instance()->createSkin( skinName );
if ( skin == nullptr )
return nullptr;
if ( skin->parent() == nullptr )
skin->setParent( this );
const QskSkin* oldSkin = m_data->skin;
const auto oldSkin = m_data->skin;
m_data->skin = skin;
m_data->skinName = skinName;

View File

@ -1040,7 +1040,7 @@ QDebug operator<<( QDebug debug, const QskGraphic& graphic )
debug << "\n controlPointsRect:" << graphic.boundingRect();
debug << "\n commandTypes:" << graphic.commandTypes();
for ( const auto command : graphic.commands() )
for ( const auto& command : graphic.commands() )
{
switch ( command.type() )
{

View File

@ -167,6 +167,7 @@ namespace
public:
Element( QQuickItem*, const QRect& );
Element( const QSizeF& spacing, const QRect& );
Element( const Element& );
Element& operator=( const Element& );
@ -210,6 +211,16 @@ Element::Element( const QSizeF& spacing, const QRect& grid )
{
}
Element::Element( const Element& other )
: m_grid( other.m_grid )
, m_isSpacer (other.m_isSpacer )
{
if ( other.m_isSpacer )
m_spacing = other.m_spacing;
else
m_item = other.m_item;
}
Element& Element::operator=( const Element& other )
{
m_isSpacer = other.m_isSpacer;

View File

@ -18,6 +18,7 @@ namespace
public:
Element( QQuickItem* item );
Element( qreal spacing );
Element( const Element& );
Element& operator=( const Element& );
@ -63,6 +64,16 @@ Element::Element( qreal spacing )
{
}
Element::Element( const Element& other )
: m_stretch( other.m_stretch )
, m_isSpacer( other.m_isSpacer )
{
if ( other.m_isSpacer )
m_spacing = other.m_spacing;
else
m_item = other.m_item;
}
Element& Element::operator=( const Element& other )
{
m_isSpacer = other.m_isSpacer;