Commit 4d50bde2 authored by Laurent Montel's avatar Laurent Montel 😁

Use Q_DECL_OVERRIDE

parent 827f5c2d
......@@ -70,8 +70,8 @@ class QProgressIndicator : public QWidget
return m_color;
}
virtual QSize sizeHint() const;
int heightForWidth(int w) const;
QSize sizeHint() const Q_DECL_OVERRIDE;
int heightForWidth(int w) const Q_DECL_OVERRIDE;
public slots:
/*! Starts the spin animation.
\sa stopAnimation isAnimated
......@@ -101,8 +101,8 @@ class QProgressIndicator : public QWidget
*/
void setColor(const QColor &color);
protected:
virtual void timerEvent(QTimerEvent * event);
virtual void paintEvent(QPaintEvent * event);
void timerEvent(QTimerEvent * event) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent * event) Q_DECL_OVERRIDE;
private:
int m_angle;
int m_timerId;
......
......@@ -240,7 +240,7 @@ class QRoundProgressBar : public QWidget
void setValue(int val);
protected:
virtual void paintEvent(QPaintEvent * event);
void paintEvent(QPaintEvent * event) Q_DECL_OVERRIDE;
virtual void drawBackground(QPainter &p, const QRectF &baseRect);
virtual void drawBase(QPainter &p, const QRectF &baseRect);
virtual void drawValue(QPainter &p, const QRectF &baseRect, double value, double arcLength);
......@@ -250,16 +250,16 @@ class QRoundProgressBar : public QWidget
virtual QString valueToText(double value) const;
virtual void valueFormatChanged();
virtual QSize minimumSizeHint() const
QSize minimumSizeHint() const Q_DECL_OVERRIDE
{
return QSize(32,32);
}
virtual bool hasHeightForWidth() const
bool hasHeightForWidth() const Q_DECL_OVERRIDE
{
return true;
}
virtual int heightForWidth(int w) const
int heightForWidth(int w) const Q_DECL_OVERRIDE
{
return w;
}
......
......@@ -72,7 +72,7 @@ class CachingDms : public dms
* @short Sets the angle in degrees supplied as a double
* @note Re-implements dms::setD() with sine/cosine caching
*/
inline void setD( const double &x )
inline void setD( const double &x ) Q_DECL_OVERRIDE
{
dms::setD( x );
dms::SinCos( m_sin, m_cos );
......@@ -87,7 +87,7 @@ class CachingDms : public dms
/**
* @short Overrides dms::setD()
*/
inline void setD( const int &d, const int &m, const int &s, const int &ms=0 )
inline void setD( const int &d, const int &m, const int &s, const int &ms=0 ) Q_DECL_OVERRIDE
{
dms::setD( d, m, s, ms );
dms::SinCos( m_sin, m_cos );
......@@ -104,7 +104,7 @@ class CachingDms : public dms
* @note Re-implements dms::setH() with sine/cosine caching
* @note While this and other methods internally call setD, we want to avoid unnecessary vtable lookups. We'd rather have inline than virtual when speed matters in general.
*/
inline void setH( const double &x )
inline void setH( const double &x ) Q_DECL_OVERRIDE
{
dms::setH( x );
dms::SinCos( m_sin, m_cos );
......@@ -120,7 +120,7 @@ class CachingDms : public dms
* @short Sets the angle in HMS form
* @note Re-implements dms::setH() with sine/cosine caching
*/
inline void setH( const int &h, const int &m, const int &s, const int &ms=0 )
inline void setH( const int &h, const int &m, const int &s, const int &ms=0 ) Q_DECL_OVERRIDE
{
dms::setH( h, m, s, ms );
dms::SinCos( m_sin, m_cos );
......@@ -133,7 +133,7 @@ class CachingDms : public dms
* @short Sets the angle from string
* @note Re-implements dms::setFromString()
*/
inline bool setFromString( const QString &s, bool isDeg = true )
inline bool setFromString( const QString &s, bool isDeg = true ) Q_DECL_OVERRIDE
{
bool retval = dms::setFromString( s, isDeg );
dms::SinCos( m_sin, m_cos );
......@@ -149,7 +149,7 @@ class CachingDms : public dms
/**
* @short Sets the angle in radians
*/
inline void setRadians( const double &a )
inline void setRadians( const double &a ) Q_DECL_OVERRIDE
{
dms::setRadians( a );
dms::SinCos( m_sin, m_cos );
......
......@@ -42,8 +42,8 @@ class ImageLabel : public QFrame
QImage m_Image; // ImageViewer needs access to the image in order to modify it
protected:
void paintEvent( QPaintEvent * e);
void resizeEvent(QResizeEvent *);
void paintEvent( QPaintEvent * e) Q_DECL_OVERRIDE;
void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
private:
QPixmap pix;
......
......@@ -41,13 +41,13 @@ class SkyObjectListModel : public QAbstractListModel
explicit SkyObjectListModel(QObject * parent = 0);
virtual int rowCount(const QModelIndex &) const
int rowCount(const QModelIndex &) const Q_DECL_OVERRIDE
{
return skyObjects.size();
}
virtual QVariant data(const QModelIndex &index, int role) const;
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
virtual QHash<int, QByteArray> roleNames() const;
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
/**
* @return index of object from skyObjects with name objectName. -1 if object with such
......
......@@ -104,7 +104,7 @@ class FindDialog : public QDialog
* the window with no selection, using reject().
* @param e The QKeyEvent pointer
*/
void keyPressEvent( QKeyEvent * e );
void keyPressEvent( QKeyEvent * e ) Q_DECL_OVERRIDE;
/** @return the currently-selected item from the listbox of named objects */
SkyObject * selectedObject() const;
......
......@@ -55,7 +55,7 @@ class FocusDialog : public QDialog
}
/** @return suggested size of focus window. */
QSize sizeHint() const;
QSize sizeHint() const Q_DECL_OVERRIDE;
/** @return whether user set the AltAz coords */
inline bool usedAltAz() const
......
......@@ -80,7 +80,7 @@ class TimeDialog : public QDialog
void setNow( void );
protected:
void keyReleaseEvent( QKeyEvent * );
void keyReleaseEvent( QKeyEvent * ) Q_DECL_OVERRIDE;
private:
bool UTCNow;
......
......@@ -31,7 +31,7 @@ class SatelliteSortFilterProxyModel : public QSortFilterProxyModel
{
public:
explicit SatelliteSortFilterProxyModel( QObject * parent );
bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const;
bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const Q_DECL_OVERRIDE;
};
/** @class OpsSatellites
......
......@@ -34,10 +34,10 @@ class AzimuthalEquidistantProjector : public Projector
public:
explicit AzimuthalEquidistantProjector(const ViewParams &p);
virtual Projection type() const;
virtual double radius() const;
virtual double projectionK(double x) const;
virtual double projectionL(double x) const;
Projection type() const Q_DECL_OVERRIDE;
double radius() const Q_DECL_OVERRIDE;
double projectionK(double x) const Q_DECL_OVERRIDE;
double projectionL(double x) const Q_DECL_OVERRIDE;
};
#endif // AZIMUTHALEQUIDISTANTPROJECTOR_H
......@@ -32,13 +32,13 @@ class EquirectangularProjector : public Projector
{
public:
explicit EquirectangularProjector(const ViewParams &p);
virtual Projection type() const;
virtual double radius() const;
virtual bool unusablePoint( const QPointF &p) const;
virtual Vector2f toScreenVec(const SkyPoint * o, bool oRefract = true, bool * onVisibleHemisphere = 0) const;
virtual SkyPoint fromScreen(const QPointF &p, dms * LST, const dms * lat) const;
virtual QVector< Vector2f > groundPoly(SkyPoint * labelpoint = 0, bool * drawLabel = 0) const;
virtual void updateClipPoly();
Projection type() const Q_DECL_OVERRIDE;
double radius() const Q_DECL_OVERRIDE;
bool unusablePoint( const QPointF &p) const Q_DECL_OVERRIDE;
Vector2f toScreenVec(const SkyPoint * o, bool oRefract = true, bool * onVisibleHemisphere = 0) const Q_DECL_OVERRIDE;
SkyPoint fromScreen(const QPointF &p, dms * LST, const dms * lat) const Q_DECL_OVERRIDE;
QVector< Vector2f > groundPoly(SkyPoint * labelpoint = 0, bool * drawLabel = 0) const Q_DECL_OVERRIDE;
void updateClipPoly() Q_DECL_OVERRIDE;
};
#endif // EQUIRECTANGULARPROJECTOR_H
......@@ -33,11 +33,11 @@ class GnomonicProjector : public Projector
public:
explicit GnomonicProjector(const ViewParams &p);
virtual Projection type() const;
virtual double radius() const;
virtual double projectionK(double x) const;
virtual double projectionL(double x) const;
virtual double cosMaxFieldAngle() const;
Projection type() const Q_DECL_OVERRIDE;
double radius() const Q_DECL_OVERRIDE;
double projectionK(double x) const Q_DECL_OVERRIDE;
double projectionL(double x) const Q_DECL_OVERRIDE;
double cosMaxFieldAngle() const Q_DECL_OVERRIDE;
};
#endif // GNOMONICPROJECTOR_H
......@@ -33,10 +33,10 @@ class LambertProjector : public Projector
public:
explicit LambertProjector(const ViewParams &p);
virtual ~LambertProjector() {}
virtual Projection type() const;
virtual double radius() const;
virtual double projectionK(double x) const;
virtual double projectionL(double x) const;
Projection type() const Q_DECL_OVERRIDE;
double radius() const Q_DECL_OVERRIDE;
double projectionK(double x) const Q_DECL_OVERRIDE;
double projectionL(double x) const Q_DECL_OVERRIDE;
};
#endif // LAMBERTPROJECTOR_H
......@@ -33,10 +33,10 @@ class OrthographicProjector : public Projector
public:
explicit OrthographicProjector(const ViewParams &p);
virtual Projection type() const;
virtual double radius() const;
virtual double projectionK(double x) const;
virtual double projectionL(double x) const;
Projection type() const Q_DECL_OVERRIDE;
double radius() const Q_DECL_OVERRIDE;
double projectionK(double x) const Q_DECL_OVERRIDE;
double projectionL(double x) const Q_DECL_OVERRIDE;
};
#endif // ORTHOGRAPHICPROJECTOR_H
......@@ -33,10 +33,10 @@ class StereographicProjector : public Projector
public:
explicit StereographicProjector(const ViewParams &p);
virtual Projection type() const;
virtual double radius() const;
virtual double projectionK(double x) const;
virtual double projectionL(double x) const;
Projection type() const Q_DECL_OVERRIDE;
double radius() const Q_DECL_OVERRIDE;
double projectionK(double x) const Q_DECL_OVERRIDE;
double projectionL(double x) const Q_DECL_OVERRIDE;
};
#endif // STEREOGRAPHICPROJECTOR_H
......@@ -54,8 +54,8 @@ class ArtificialHorizonComponent : public NoPrecessIndex
*/
explicit ArtificialHorizonComponent( SkyComposite * parent );
virtual bool selected();
virtual void draw( SkyPainter * skyp );
bool selected() Q_DECL_OVERRIDE;
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
void setLivePreview(LineList * preview)
{
......@@ -72,7 +72,7 @@ class ArtificialHorizonComponent : public NoPrecessIndex
void save();
protected:
virtual void preDraw( SkyPainter * skyp );
void preDraw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
private:
QList<ArtificialHorizonEntity *> m_HorizonList;
......
......@@ -44,9 +44,9 @@ class AsteroidsComponent: public QObject, public SolarSystemListComponent
explicit AsteroidsComponent(SolarSystemComposite * parent);
virtual ~AsteroidsComponent();
virtual void draw( SkyPainter * skyp );
virtual bool selected();
virtual SkyObject * objectNearest( SkyPoint * p, double &maxrad );
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
bool selected() Q_DECL_OVERRIDE;
SkyObject * objectNearest( SkyPoint * p, double &maxrad ) Q_DECL_OVERRIDE;
void updateDataFile();
......
......@@ -54,9 +54,9 @@ class CatalogComponent: public ListComponent
*@short Draw custom catalog objects on the sky map.
*@p psky Reference to the QPainter on which to paint
*/
virtual void draw( SkyPainter * skyp );
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
virtual void update( KSNumbers * num );
void update( KSNumbers * num ) Q_DECL_OVERRIDE;
/** @return the name of the catalog */
inline QString name() const
......@@ -107,7 +107,7 @@ class CatalogComponent: public ListComponent
* Overridden from SkyComponent::selected
* @return bool
**/
virtual bool selected();
bool selected() Q_DECL_OVERRIDE;
protected:
......
......@@ -43,8 +43,8 @@ class CometsComponent : public QObject, public SolarSystemListComponent
explicit CometsComponent(SolarSystemComposite * parent);
virtual ~CometsComponent();
virtual bool selected();
virtual void draw( SkyPainter * skyp );
bool selected() Q_DECL_OVERRIDE;
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
void updateDataFile();
protected slots:
......
......@@ -65,7 +65,7 @@ class ConstellationArtComponent : public SkyComponent
*/
void showList();
virtual void draw( SkyPainter * skyp );
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
QList<ConstellationsArt *> m_ConstList;
......
......@@ -56,9 +56,9 @@ class ConstellationBoundaryLines : public NoPrecessIndex
QString constellationName( SkyPoint * p );
virtual bool selected();
bool selected() Q_DECL_OVERRIDE;
virtual void preDraw( SkyPainter * skyp );
void preDraw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
private:
void appendPoly( PolyList * polyList, int debug=0);
......
......@@ -50,18 +50,18 @@ class ConstellationLines : public LineListIndex
void reindex( KSNumbers * num );
virtual bool selected();
bool selected() Q_DECL_OVERRIDE;
protected:
const IndexHash &getIndexHash(LineList * lineList );
const IndexHash &getIndexHash(LineList * lineList ) Q_DECL_OVERRIDE;
/** @short we need to override the update routine because stars are
* updated differently from mere SkyPoints.
*/
virtual void JITupdate( LineList * lineList );
void JITupdate( LineList * lineList ) Q_DECL_OVERRIDE;
/** @short Set the QColor and QPen for drawing. */
virtual void preDraw( SkyPainter * skyp );
void preDraw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
private:
......
......@@ -57,12 +57,12 @@ class ConstellationNamesComponent : public ListComponent
/** @short Draw constellation names on the sky map.
* @p psky Reference to the QPainter on which to paint
*/
virtual void draw( SkyPainter * skyp );
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
/** @short we need a custom routine (for now) so we don't
* precess the locations of the names.
*/
virtual void update( KSNumbers * num );
void update( KSNumbers * num ) Q_DECL_OVERRIDE;
/** @short Return true if we are using localized constellation names */
inline bool isLocalCNames()
......@@ -70,7 +70,7 @@ class ConstellationNamesComponent : public ListComponent
return localCNames;
}
virtual bool selected();
bool selected() Q_DECL_OVERRIDE;
void loadData(CultureList * cultures);
......
......@@ -38,9 +38,9 @@ class CoordinateGrid : public NoPrecessIndex
*/
CoordinateGrid( SkyComposite * parent, const QString &name );
virtual void preDraw( SkyPainter * skyp ) = 0;
void preDraw( SkyPainter * skyp ) Q_DECL_OVERRIDE = 0;
virtual bool selected() = 0;
bool selected() Q_DECL_OVERRIDE = 0;
};
......
......@@ -68,7 +68,7 @@ class DeepSkyComponent: public SkyComponent
~DeepSkyComponent();
virtual void draw( SkyPainter * skyp );
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
/** @short draw all the labels in the prioritized LabelLists and then
* clear the LabelLists.
......@@ -87,7 +87,7 @@ class DeepSkyComponent: public SkyComponent
* Precession/Nutation computation should be skipped; this computation
* is only occasionally required.
*/
virtual void update( KSNumbers * num=0 );
void update( KSNumbers * num=0 ) Q_DECL_OVERRIDE;
/**
* @short Search the children of this SkyComponent for
......@@ -96,7 +96,7 @@ class DeepSkyComponent: public SkyComponent
* @return a pointer to the SkyObject whose name matches
* the argument, or a nullptr pointer if no match was found.
*/
virtual SkyObject * findByName( const QString &name );
SkyObject * findByName( const QString &name ) Q_DECL_OVERRIDE;
/**
* @short Searches the region(s) and appends the SkyObjects found to the list of sky objects
......@@ -107,9 +107,9 @@ class DeepSkyComponent: public SkyComponent
* @p region defines the regions in which the search for SkyObject should be done within
* @return void
*/
virtual void objectsInArea( QList<SkyObject *> &list, const SkyRegion &region );
void objectsInArea( QList<SkyObject *> &list, const SkyRegion &region ) Q_DECL_OVERRIDE;
virtual SkyObject * objectNearest( SkyPoint * p, double &maxrad );
SkyObject * objectNearest( SkyPoint * p, double &maxrad ) Q_DECL_OVERRIDE;
const QList<DeepSkyObject *> &objectList() const
{
......@@ -118,7 +118,7 @@ class DeepSkyComponent: public SkyComponent
void clear();
bool selected();
bool selected() Q_DECL_OVERRIDE;
private:
/**
......
......@@ -60,11 +60,11 @@ class DeepStarComponent: public ListComponent
//This function is empty; we need that so that the JiT update
//is the only one beiong used.
void update( KSNumbers * num );
void update( KSNumbers * num ) Q_DECL_OVERRIDE;
bool selected();
bool selected() Q_DECL_OVERRIDE;
void draw( SkyPainter * skyp );
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
bool loadStaticStars();
......@@ -95,7 +95,7 @@ class DeepStarComponent: public ListComponent
/**
*@return Nearest star within maxrad of SkyPoint p, or nullptr if not found
*/
SkyObject * objectNearest(SkyPoint * p, double &maxrad );
SkyObject * objectNearest(SkyPoint * p, double &maxrad ) Q_DECL_OVERRIDE;
inline bool fileOpen() const
{
......
......@@ -38,11 +38,11 @@ class Ecliptic : public LineListIndex
*/
explicit Ecliptic( SkyComposite * parent );
virtual void draw( SkyPainter * skyp );
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
virtual void drawCompassLabels();
virtual bool selected();
bool selected() Q_DECL_OVERRIDE;
virtual LineListLabel * label()
LineListLabel * label() Q_DECL_OVERRIDE
{
return &m_label;
}
......
......@@ -39,16 +39,16 @@ class Equator : public NoPrecessIndex
*/
explicit Equator( SkyComposite * parent );
virtual bool selected();
virtual void draw( SkyPainter * skyp );
bool selected() Q_DECL_OVERRIDE;
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
virtual void drawCompassLabels();
virtual LineListLabel * label()
LineListLabel * label() Q_DECL_OVERRIDE
{
return &m_label;
}
protected:
virtual void preDraw( SkyPainter * skyp );
void preDraw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
private:
LineListLabel m_label;
......
......@@ -38,9 +38,9 @@ class EquatorialCoordinateGrid : public CoordinateGrid
*/
explicit EquatorialCoordinateGrid( SkyComposite * parent );
void preDraw( SkyPainter * skyp );
void preDraw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
bool selected();
bool selected() Q_DECL_OVERRIDE;
};
......
......@@ -51,11 +51,11 @@ class FlagComponent: public QObject, public PointListComponent
/** @short Destructor. */
virtual ~FlagComponent();
virtual void draw( SkyPainter * skyp );
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
virtual bool selected();
bool selected() Q_DECL_OVERRIDE;
virtual void update( KSNumbers * num=0 );
void update( KSNumbers * num=0 ) Q_DECL_OVERRIDE;
/** @short Add a flag.
* @param SkyPoint Sky point in epoch coordinates
......
......@@ -51,11 +51,11 @@ class HorizonComponent: public PointListComponent
*@p map Pointer to the SkyMap object
*@p psky Reference to the QPainter on which to paint
*/
virtual void draw( SkyPainter * skyp );
void draw( SkyPainter * skyp ) Q_DECL_OVERRIDE;
virtual void update( KSNumbers * );
void update( KSNumbers * ) Q_DECL_OVERRIDE;
bool selected();
bool selected() Q_DECL_OVERRIDE;
private:
void drawCompassLabels();
......