Clang: reduce warnings
This commit is contained in:
parent
03d9dbe099
commit
bd37572fd8
@ -29,7 +29,7 @@
|
|||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
static QHash< QString, QHash< int, QHash< qint64, QPixmap > > > s_cache;
|
static QHash< QString, QHash< int, QHash< qint64, QPixmap > > > s_cache;
|
||||||
ImageRegistry* ImageRegistry::s_instance = 0;
|
ImageRegistry* ImageRegistry::s_instance = nullptr;
|
||||||
|
|
||||||
|
|
||||||
ImageRegistry*
|
ImageRegistry*
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
class QJsonTreeItem
|
class QJsonTreeItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QJsonTreeItem(QJsonTreeItem * parent = 0);
|
QJsonTreeItem(QJsonTreeItem * parent = nullptr);
|
||||||
virtual ~QJsonTreeItem();
|
virtual ~QJsonTreeItem();
|
||||||
void appendChild(QJsonTreeItem * item);
|
void appendChild(QJsonTreeItem * item);
|
||||||
QJsonTreeItem *child(int row);
|
QJsonTreeItem *child(int row);
|
||||||
@ -41,7 +41,7 @@ public:
|
|||||||
QJsonValue::Type type() const;
|
QJsonValue::Type type() const;
|
||||||
|
|
||||||
|
|
||||||
static QJsonTreeItem* load(const QJsonValue& value, QJsonTreeItem * parent = 0);
|
static QJsonTreeItem* load(const QJsonValue& value, QJsonTreeItem * parent = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class QJsonModel : public QAbstractItemModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QJsonModel(QObject *parent = 0);
|
explicit QJsonModel(QObject *parent = nullptr);
|
||||||
virtual ~QJsonModel();
|
virtual ~QJsonModel();
|
||||||
bool load(const QString& fileName);
|
bool load(const QString& fileName);
|
||||||
bool load(QIODevice * device);
|
bool load(QIODevice * device);
|
||||||
|
@ -61,6 +61,8 @@ ViewStep::setModuleInstanceKey( const QString& instanceKey )
|
|||||||
|
|
||||||
void
|
void
|
||||||
ViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
ViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
{}
|
{
|
||||||
|
Q_UNUSED( configurationMap );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,14 +28,14 @@ class ClickableLabel : public QLabel
|
|||||||
public:
|
public:
|
||||||
explicit ClickableLabel( QWidget* parent = nullptr, Qt::WindowFlags f = 0 );
|
explicit ClickableLabel( QWidget* parent = nullptr, Qt::WindowFlags f = 0 );
|
||||||
explicit ClickableLabel( const QString& text, QWidget* parent = nullptr, Qt::WindowFlags f = 0 );
|
explicit ClickableLabel( const QString& text, QWidget* parent = nullptr, Qt::WindowFlags f = 0 );
|
||||||
virtual ~ClickableLabel();
|
virtual ~ClickableLabel() override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void clicked();
|
void clicked();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void mousePressEvent( QMouseEvent* event );
|
virtual void mousePressEvent( QMouseEvent* event ) override;
|
||||||
virtual void mouseReleaseEvent( QMouseEvent* event );
|
virtual void mouseReleaseEvent( QMouseEvent* event ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QTime m_time;
|
QTime m_time;
|
||||||
|
@ -42,6 +42,7 @@ FixedAspectRatioLabel::setPixmap( const QPixmap& pixmap )
|
|||||||
void
|
void
|
||||||
FixedAspectRatioLabel::resizeEvent( QResizeEvent* event )
|
FixedAspectRatioLabel::resizeEvent( QResizeEvent* event )
|
||||||
{
|
{
|
||||||
|
Q_UNUSED( event );
|
||||||
QLabel::setPixmap( m_pixmap.scaled(
|
QLabel::setPixmap( m_pixmap.scaled(
|
||||||
contentsRect().size(),
|
contentsRect().size(),
|
||||||
Qt::KeepAspectRatio,
|
Qt::KeepAspectRatio,
|
||||||
|
@ -28,7 +28,7 @@ class FixedAspectRatioLabel : public QLabel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit FixedAspectRatioLabel( QWidget* parent = nullptr );
|
explicit FixedAspectRatioLabel( QWidget* parent = nullptr );
|
||||||
virtual ~FixedAspectRatioLabel();
|
virtual ~FixedAspectRatioLabel() override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setPixmap( const QPixmap &pixmap );
|
void setPixmap( const QPixmap &pixmap );
|
||||||
|
@ -57,7 +57,7 @@ void QtWaitingSpinner::paintEvent(QPaintEvent* /*ev*/) {
|
|||||||
for (int i = 0; i < myLinesNumber; ++i) {
|
for (int i = 0; i < myLinesNumber; ++i) {
|
||||||
painter.save();
|
painter.save();
|
||||||
painter.translate(myRadius + myLength, myRadius + myLength);
|
painter.translate(myRadius + myLength, myRadius + myLength);
|
||||||
qreal rotateAngle = (qreal)360 * qreal(i) / qreal(myLinesNumber);
|
qreal rotateAngle = 360.0 * qreal(i) / qreal(myLinesNumber);
|
||||||
painter.rotate(rotateAngle);
|
painter.rotate(rotateAngle);
|
||||||
painter.translate(myRadius, 0);
|
painter.translate(myRadius, 0);
|
||||||
int distance = lineDistance(i, myCurrentCounter, myLinesNumber);
|
int distance = lineDistance(i, myCurrentCounter, myLinesNumber);
|
||||||
@ -160,14 +160,14 @@ QColor QtWaitingSpinner::countTrailColor(int distance, int lines, int trail, int
|
|||||||
if (distance == 0) {
|
if (distance == 0) {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
const qreal minAlphaF = (qreal)minOpacity / 100;
|
const qreal minAlphaF = qreal(minOpacity) / 100.0;
|
||||||
int distanceThreshold = ceil( (lines - 1) * (qreal)trail / 100);
|
int distanceThreshold = ceil( (lines - 1) * qreal(trail) / 100.0);
|
||||||
if (distance > distanceThreshold) {
|
if (distance > distanceThreshold) {
|
||||||
color.setAlphaF(minAlphaF);
|
color.setAlphaF(minAlphaF);
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
qreal alphaDiff = color.alphaF() - (qreal)minAlphaF;
|
qreal alphaDiff = color.alphaF() - minAlphaF;
|
||||||
qreal gradation = alphaDiff / (qreal)(distanceThreshold + 1);
|
qreal gradation = alphaDiff / qreal(distanceThreshold + 1);
|
||||||
qreal resultAlpha = color.alphaF() - gradation * distance;
|
qreal resultAlpha = color.alphaF() - gradation * distance;
|
||||||
resultAlpha = std::min(1.0, std::max(0.0, resultAlpha)); //if alpha is out of bound, force it to bounds
|
resultAlpha = std::min(1.0, std::max(0.0, resultAlpha)); //if alpha is out of bound, force it to bounds
|
||||||
color.setAlphaF(resultAlpha);
|
color.setAlphaF(resultAlpha);
|
||||||
|
@ -33,7 +33,7 @@ class UIDLLEXPORT QtWaitingSpinner : public QWidget {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QtWaitingSpinner(int linesNumber = 12, int length = 7, int width = 5, int radius = 10, QWidget* parent = 0);
|
explicit QtWaitingSpinner(int linesNumber = 12, int length = 7, int width = 5, int radius = 10, QWidget* parent = nullptr);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void start();
|
void start();
|
||||||
|
@ -34,7 +34,7 @@ class PLUGINDLLEXPORT KeyboardViewStep : public Calamares::ViewStep
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit KeyboardViewStep( QObject* parent = nullptr );
|
explicit KeyboardViewStep( QObject* parent = nullptr );
|
||||||
virtual ~KeyboardViewStep();
|
virtual ~KeyboardViewStep() override;
|
||||||
|
|
||||||
QString prettyName() const override;
|
QString prettyName() const override;
|
||||||
QString prettyStatus() const override;
|
QString prettyStatus() const override;
|
||||||
|
@ -34,7 +34,7 @@ class PLUGINDLLEXPORT NetInstallViewStep : public Calamares::ViewStep
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit NetInstallViewStep( QObject* parent = nullptr );
|
explicit NetInstallViewStep( QObject* parent = nullptr );
|
||||||
virtual ~NetInstallViewStep();
|
virtual ~NetInstallViewStep() override;
|
||||||
|
|
||||||
QString prettyName() const override;
|
QString prettyName() const override;
|
||||||
QString prettyStatus() const override;
|
QString prettyStatus() const override;
|
||||||
|
@ -35,7 +35,7 @@ class PackageModel : public QAbstractItemModel
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PackageModel( const YAML::Node& data, QObject* parent = 0 );
|
explicit PackageModel( const YAML::Node& data, QObject* parent = nullptr );
|
||||||
~PackageModel();
|
~PackageModel();
|
||||||
|
|
||||||
QVariant data( const QModelIndex& index, int role ) const override;
|
QVariant data( const QModelIndex& index, int role ) const override;
|
||||||
|
Loading…
Reference in New Issue
Block a user