summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Zotti <Georg.Zotti@univie.ac.at>2022-03-17 04:44:38 +0100
committerGitHub <noreply@github.com>2022-03-17 10:44:38 +0700
commit966f54b393b619a7e9d6886289d31fdb94c1835a (patch)
tree925bf7fe30199718babced1845760d0063596368
parenta15858d1c126c2da0110e17e8354bbdab6a328b3 (diff)
Refactor qflags (#2351)
* Docfixes * Replace deprecated Q_FLAGS by Q_FLAG
-rw-r--r--plugins/RemoteSync/src/SyncClient.hpp2
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/core/StelObject.hpp10
-rw-r--r--src/core/StelRegionObject.hpp4
-rw-r--r--src/core/modules/Nebula.hpp12
5 files changed, 16 insertions, 14 deletions
diff --git a/plugins/RemoteSync/src/SyncClient.hpp b/plugins/RemoteSync/src/SyncClient.hpp
index 242c52b726..46d6881961 100644
--- a/plugins/RemoteSync/src/SyncClient.hpp
+++ b/plugins/RemoteSync/src/SyncClient.hpp
@@ -33,7 +33,6 @@ class SyncRemotePeer;
class SyncClient : public QObject
{
Q_OBJECT
- Q_FLAGS(SyncOptions)
public:
//! Bitflag-enum which determines the message types the client instance reacts to,
//! and other boolean options
@@ -50,6 +49,7 @@ public:
ALL = 0xFFFF
};
Q_DECLARE_FLAGS(SyncOptions, SyncOption)
+ Q_FLAG(SyncOptions)
SyncClient(SyncOptions options, const QStringList& excludeProperties, QObject* parent = Q_NULLPTR);
virtual ~SyncClient() Q_DECL_OVERRIDE;
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6f75d190bc..bf8a21906a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -257,7 +257,7 @@ SET(stellarium_lib_SRCS
### CMake < 3.0 does not AUTOMOC Q_GADGET which some files use, so we have to manually add it
### Wrap it in an IF to prevent some linker warnings about symbols defined twice (on MSVC13 at least)
### Q_GADGET is required force the Qt MOC to run on some specific files,
-### because they do not contain QObjects, but require a MOC for Q_FLAGS or similar
+### because they do not contain QObjects, but require a MOC for Q_FLAG or similar
IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 3.0)
QT5_WRAP_CPP(stellarium_lib_moc_SRCS
core/StelObject.hpp
diff --git a/src/core/StelObject.hpp b/src/core/StelObject.hpp
index b3c48d4721..79c67da45f 100644
--- a/src/core/StelObject.hpp
+++ b/src/core/StelObject.hpp
@@ -35,9 +35,8 @@ class StelCore;
//! @sa StelObjectP
class StelObject : public StelRegionObject
{
- //Required for Q_FLAGS macro, this requires this header to be MOC'ed
+ //Required for Q_FLAG macro, this requires this header to be MOC'ed
Q_GADGET
- Q_FLAGS(InfoStringGroupFlags InfoStringGroup)
public:
//! Used as named bitfield flags as specifiers to
//! filter results of getInfoString. The precise definition of these should
@@ -77,18 +76,19 @@ public:
PlainText = 0x08000000 //!< Strip HTML tags from output
};
Q_DECLARE_FLAGS(InfoStringGroup, InfoStringGroupFlags)
+ Q_FLAG(InfoStringGroup)
//! A pre-defined "all available" set of specifiers for the getInfoString flags argument to getInfoString
- static const InfoStringGroupFlags AllInfo = static_cast<InfoStringGroupFlags>(Name|CatalogNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|
+ static constexpr InfoStringGroup AllInfo = static_cast<InfoStringGroup>(Name|CatalogNumber|Magnitude|RaDecJ2000|RaDecOfDate|AltAzi|
Distance|Elongation|Size|Velocity|ProperMotion|Extra|HourAngle|AbsoluteMagnitude|
GalacticCoord|SupergalacticCoord|OtherCoord|ObjectType|EclipticCoordJ2000|
EclipticCoordOfDate|IAUConstellation|SiderealTime|RTSTime|SolarLunarPosition);
//! A pre-defined "default" set of specifiers for the getInfoString flags argument to getInfoString
//! It appears useful to propose this set as post-install settings and let users configure more on demand.
- static const InfoStringGroupFlags DefaultInfo = static_cast<InfoStringGroupFlags>(Name|CatalogNumber|Magnitude|RaDecOfDate|HourAngle|AltAzi|OtherCoord|
+ static constexpr InfoStringGroup DefaultInfo = static_cast<InfoStringGroup>(Name|CatalogNumber|Magnitude|RaDecOfDate|HourAngle|AltAzi|OtherCoord|
Distance|Elongation|Size|Velocity|Extra|IAUConstellation|SiderealTime|RTSTime);
//! A pre-defined "shortest useful" set of specifiers for the getInfoString flags argument to getInfoString
- static const InfoStringGroupFlags ShortInfo = static_cast<InfoStringGroupFlags>(Name|CatalogNumber|Magnitude|RaDecJ2000);
+ static constexpr InfoStringGroup ShortInfo = static_cast<InfoStringGroup>(Name|CatalogNumber|Magnitude|RaDecJ2000);
virtual ~StelObject() Q_DECL_OVERRIDE {}
diff --git a/src/core/StelRegionObject.hpp b/src/core/StelRegionObject.hpp
index 841ab77edd..08823ad188 100644
--- a/src/core/StelRegionObject.hpp
+++ b/src/core/StelRegionObject.hpp
@@ -27,10 +27,10 @@
//! to be stored in a StelSphericalIndex.
class StelRegionObject
{
- //required for Q_FLAGS macro in some derived classes
+ //required for Q_FLAG macro in some derived classes
Q_GADGET
public:
- virtual ~StelRegionObject(void) {;}
+ virtual ~StelRegionObject(void) {}
//! Return the spatial region of the object.
virtual SphericalRegionP getRegion() const=0;
diff --git a/src/core/modules/Nebula.hpp b/src/core/modules/Nebula.hpp
index 006a21de1d..4fe0982c0c 100644
--- a/src/core/modules/Nebula.hpp
+++ b/src/core/modules/Nebula.hpp
@@ -36,15 +36,14 @@ class Nebula : public StelObject
{
friend class NebulaMgr;
- //Required for the correct working of the Q_FLAGS macro (which requires a MOC pass)
+ //Required for the correct working of the Q_FLAG macro (which requires a MOC pass)
Q_GADGET
- Q_FLAGS(CatalogGroup)
- Q_FLAGS(TypeGroup)
public:
static const QString NEBULA_TYPE;
enum CatalogGroupFlags
{
+ CatNone = 0x00000000, //!< Nothing selected
CatNGC = 0x00000001, //!< New General Catalogue (NGC)
CatIC = 0x00000002, //!< Index Catalogue (IC)
CatM = 0x00000004, //!< Messier Catalog (M)
@@ -77,9 +76,11 @@ public:
CatOther = 0x20000000 //!< without ID
};
Q_DECLARE_FLAGS(CatalogGroup, CatalogGroupFlags)
+ Q_FLAG(CatalogGroup)
enum TypeGroupFlags
{
+ TypeNone = 0x00000000, //!< Nothing selected
TypeGalaxies = 0x00000001, //!< Galaxies
TypeActiveGalaxies = 0x00000002, //!< Different Active Galaxies
TypeInteractingGalaxies = 0x00000004, //!< Interacting Galaxies
@@ -94,10 +95,11 @@ public:
TypeOther = 0x00000800 //!< Other objects
};
Q_DECLARE_FLAGS(TypeGroup, TypeGroupFlags)
+ Q_FLAG(TypeGroup)
//! A pre-defined set of specifiers for the catalogs filter
- static const CatalogGroupFlags AllCatalogs = static_cast<CatalogGroupFlags>(CatNGC|CatIC|CatM|CatC|CatB|CatSh2|CatLBN|CatLDN|CatRCW|CatVdB|CatCr|CatMel|CatPGC|CatUGC|CatCed|CatArp|CatVV|CatPK|CatPNG|CatSNRG|CatACO|CatHCG|CatESO|CatVdBH|CatDWB|CatTr|CatSt|CatRu|CatOther);
- static const TypeGroupFlags AllTypes = static_cast<TypeGroupFlags>(TypeGalaxies|TypeActiveGalaxies|TypeInteractingGalaxies|TypeOpenStarClusters|TypeGlobularStarClusters|TypeHydrogenRegions|TypeBrightNebulae|TypeDarkNebulae|TypePlanetaryNebulae|TypeSupernovaRemnants|TypeGalaxyClusters|TypeOther);
+ static constexpr CatalogGroup AllCatalogs = static_cast<CatalogGroup>(CatNGC|CatIC|CatM|CatC|CatB|CatSh2|CatLBN|CatLDN|CatRCW|CatVdB|CatCr|CatMel|CatPGC|CatUGC|CatCed|CatArp|CatVV|CatPK|CatPNG|CatSNRG|CatACO|CatHCG|CatESO|CatVdBH|CatDWB|CatTr|CatSt|CatRu|CatOther);
+ static constexpr TypeGroup AllTypes = static_cast<TypeGroup>(TypeGalaxies|TypeActiveGalaxies|TypeInteractingGalaxies|TypeOpenStarClusters|TypeGlobularStarClusters|TypeHydrogenRegions|TypeBrightNebulae|TypeDarkNebulae|TypePlanetaryNebulae|TypeSupernovaRemnants|TypeGalaxyClusters|TypeOther);
//! @enum NebulaType Nebula types
enum NebulaType