Skip to content

Commit

Permalink
Oculars code cleanup
Browse files Browse the repository at this point in the history
Added guard blocks for minimum Qt version for the Q_DISABLE_COPY_MOVE macro.
  • Loading branch information
treaves committed May 3, 2021
1 parent 8e6a2ea commit 1bb364a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 1 deletion.
4 changes: 4 additions & 0 deletions plugins/Oculars/src/CCD.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
#pragma once

#include "OcularsConfig.hpp"

#include <QExplicitlySharedDataPointer>
#include <QObject>
#include <QSettings>
#include <QString>
#include <QtGlobal>

class Lens;
class Telescope;
Expand All @@ -31,7 +33,9 @@ class Telescope;
class CCD : public QObject
{
Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
Q_DISABLE_COPY_MOVE(CCD)
#endif
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(int resolutionX READ resolutionX WRITE setResolutionX)
Q_PROPERTY(int resolutionY READ resolutionY WRITE setResolutionY)
Expand Down
3 changes: 3 additions & 0 deletions plugins/Oculars/src/Lens.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@
#include <QMap>
#include <QObject>
#include <QString>
#include <QtGlobal>

class QSettings;

//! @ingroup oculars
class Lens : public QObject
{
Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
Q_DISABLE_COPY_MOVE(Lens)
#endif
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(double multiplier READ multiplier WRITE setMultiplier)

Expand Down
3 changes: 3 additions & 0 deletions plugins/Oculars/src/Ocular.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <QObject>
#include <QSettings>
#include <QString>
#include <QtGlobal>

#include "OcularsConfig.hpp"

Expand All @@ -33,7 +34,9 @@ class Lens;
class Ocular : public QObject
{
Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
Q_DISABLE_COPY_MOVE(Ocular)
#endif
Q_PROPERTY(bool binoculars READ isBinoculars WRITE setBinoculars)
Q_PROPERTY(bool permanentCrosshair READ hasPermanentCrosshair WRITE setPermanentCrosshair)
Q_PROPERTY(double apparentFOV READ apparentFOV WRITE setApparentFOV)
Expand Down
3 changes: 3 additions & 0 deletions plugins/Oculars/src/Oculars.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <QFont>
#include <QSettings>
#include <QtGlobal>

class StelButton;
class StelAction;
Expand Down Expand Up @@ -64,7 +65,9 @@ a good way to supplement your visual astronomy interests.
class Oculars : public StelModule
{
Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
Q_DISABLE_COPY_MOVE(Oculars)
#endif

Q_PROPERTY(bool enableOcular READ getEnableOcular WRITE enableOcular NOTIFY enableOcularChanged)
Q_PROPERTY(bool enableCrosshairs READ getEnableCrosshairs WRITE toggleCrosshairs NOTIFY enableCrosshairsChanged)
Expand Down
3 changes: 3 additions & 0 deletions plugins/Oculars/src/Telescope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <QObject>
#include <QSettings>
#include <QString>
#include <QtGlobal>

#include "OcularsConfig.hpp"

Expand All @@ -30,7 +31,9 @@ class TelescopeData;
class Telescope : public QObject
{
Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
Q_DISABLE_COPY_MOVE(Telescope)
#endif
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(double diameter READ diameter WRITE setDiameter)
Q_PROPERTY(double focalLength READ focalLength WRITE setFocalLength)
Expand Down
4 changes: 4 additions & 0 deletions plugins/Oculars/src/gui/OcularDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
#include "StelStyle.hpp"
#include "Telescope.hpp"
#include "VecMath.hpp"

#include <QDataWidgetMapper>
#include <QObject>
#include <QtGlobal>

class Ui_ocularDialogForm;

Expand All @@ -39,7 +41,9 @@ class Oculars;
class OcularDialog : public StelDialog
{
Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
Q_DISABLE_COPY_MOVE(OcularDialog)
#endif

public:
OcularDialog(Oculars * plugin,
Expand Down
5 changes: 4 additions & 1 deletion plugins/Oculars/src/gui/OcularsGuiPanel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
#pragma once

#include <QGraphicsWidget>
#include <QtGlobal>

class Oculars;
class StelButton;
Expand All @@ -34,7 +35,9 @@ class QWidget;
class OcularsGuiPanel : public QGraphicsWidget
{
Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
Q_DISABLE_COPY_MOVE(OcularsGuiPanel)
#endif

public:
OcularsGuiPanel(Oculars * ocularsPlugin, QGraphicsWidget * parent = Q_NULLPTR);
Expand Down Expand Up @@ -147,7 +150,7 @@ private slots:
void setControlsColor(const QColor & color);
void setControlsFont(const QFont & font);

static auto createPixmapFromText(const QString & text,
static auto createPixmapFromText(const QString & text,
int width,
int height,
const QFont & font,
Expand Down
4 changes: 4 additions & 0 deletions plugins/Oculars/src/gui/PropertyBasedTableModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#pragma once

#include <QAbstractTableModel>
#include <QtGlobal>

//! This class provides a table model for just about any QObject. It it nice, as a table model implementation per
//! class is not required. It does this by using the Qt meta object system.
Expand All @@ -35,6 +36,9 @@
class PropertyBasedTableModel : public QAbstractTableModel
{
Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
Q_DISABLE_COPY_MOVE(PropertyBasedTableModel)
#endif
public:
explicit PropertyBasedTableModel(QObject * parent = Q_NULLPTR);
~PropertyBasedTableModel() override;
Expand Down

0 comments on commit 1bb364a

Please sign in to comment.