Q<Concrete>Permission: unexport classes
Non-polymorphic classes should not be exported wholesale, because MSVC exports inline API in such classes, too, which has caused numerous problems over the years. Only export individual functions. Change-Id: I8be55c1fcdb21d143a02bb62498caeea6ebca068 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit ceb4140b59428a805d11c036ef223f46d83653ef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f83d2f913b
commit
9e4a8fa163
@ -83,62 +83,62 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define QT_PERMISSION(ClassName) \
|
#define QT_PERMISSION(ClassName) \
|
||||||
Q_GADGET \
|
Q_GADGET_EXPORT(Q_CORE_EXPORT) \
|
||||||
using QtPermissionHelper = void; \
|
using QtPermissionHelper = void; \
|
||||||
friend class QPermission; \
|
friend class QPermission; \
|
||||||
public: \
|
public: \
|
||||||
ClassName(); \
|
Q_CORE_EXPORT ClassName(); \
|
||||||
ClassName(const ClassName &other) noexcept; \
|
Q_CORE_EXPORT ClassName(const ClassName &other) noexcept; \
|
||||||
ClassName(ClassName &&other) noexcept; \
|
Q_CORE_EXPORT ClassName(ClassName &&other) noexcept; \
|
||||||
~ClassName() noexcept; \
|
Q_CORE_EXPORT ~ClassName() noexcept; \
|
||||||
ClassName &operator=(const ClassName &other) noexcept; \
|
Q_CORE_EXPORT ClassName &operator=(const ClassName &other) noexcept; \
|
||||||
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(ClassName) \
|
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(ClassName) \
|
||||||
void swap(ClassName &other) noexcept { d.swap(other.d); } \
|
void swap(ClassName &other) noexcept { d.swap(other.d); } \
|
||||||
private: \
|
private: \
|
||||||
QtPrivate::QExplicitlySharedDataPointerV2<ClassName##Private> d;
|
QtPrivate::QExplicitlySharedDataPointerV2<ClassName##Private> d;
|
||||||
|
|
||||||
class QLocationPermissionPrivate;
|
class QLocationPermissionPrivate;
|
||||||
class Q_CORE_EXPORT QLocationPermission
|
class QLocationPermission
|
||||||
{
|
{
|
||||||
QT_PERMISSION(QLocationPermission)
|
QT_PERMISSION(QLocationPermission)
|
||||||
public:
|
public:
|
||||||
enum Accuracy { Approximate, Precise };
|
enum Accuracy { Approximate, Precise };
|
||||||
Q_ENUM(Accuracy)
|
Q_ENUM(Accuracy)
|
||||||
|
|
||||||
void setAccuracy(Accuracy accuracy);
|
Q_CORE_EXPORT void setAccuracy(Accuracy accuracy);
|
||||||
Accuracy accuracy() const;
|
Q_CORE_EXPORT Accuracy accuracy() const;
|
||||||
|
|
||||||
enum Availability { WhenInUse, Always };
|
enum Availability { WhenInUse, Always };
|
||||||
Q_ENUM(Availability)
|
Q_ENUM(Availability)
|
||||||
|
|
||||||
void setAvailability(Availability availability);
|
Q_CORE_EXPORT void setAvailability(Availability availability);
|
||||||
Availability availability() const;
|
Q_CORE_EXPORT Availability availability() const;
|
||||||
};
|
};
|
||||||
Q_DECLARE_SHARED(QLocationPermission)
|
Q_DECLARE_SHARED(QLocationPermission)
|
||||||
|
|
||||||
class QCalendarPermissionPrivate;
|
class QCalendarPermissionPrivate;
|
||||||
class Q_CORE_EXPORT QCalendarPermission
|
class QCalendarPermission
|
||||||
{
|
{
|
||||||
QT_PERMISSION(QCalendarPermission)
|
QT_PERMISSION(QCalendarPermission)
|
||||||
public:
|
public:
|
||||||
void setReadOnly(bool enable);
|
Q_CORE_EXPORT void setReadOnly(bool enable);
|
||||||
bool isReadOnly() const;
|
Q_CORE_EXPORT bool isReadOnly() const;
|
||||||
};
|
};
|
||||||
Q_DECLARE_SHARED(QCalendarPermission)
|
Q_DECLARE_SHARED(QCalendarPermission)
|
||||||
|
|
||||||
class QContactsPermissionPrivate;
|
class QContactsPermissionPrivate;
|
||||||
class Q_CORE_EXPORT QContactsPermission
|
class QContactsPermission
|
||||||
{
|
{
|
||||||
QT_PERMISSION(QContactsPermission)
|
QT_PERMISSION(QContactsPermission)
|
||||||
public:
|
public:
|
||||||
void setReadOnly(bool enable);
|
Q_CORE_EXPORT void setReadOnly(bool enable);
|
||||||
bool isReadOnly() const;
|
Q_CORE_EXPORT bool isReadOnly() const;
|
||||||
};
|
};
|
||||||
Q_DECLARE_SHARED(QContactsPermission)
|
Q_DECLARE_SHARED(QContactsPermission)
|
||||||
|
|
||||||
#define Q_DECLARE_MINIMAL_PERMISSION(ClassName) \
|
#define Q_DECLARE_MINIMAL_PERMISSION(ClassName) \
|
||||||
class ClassName##Private; \
|
class ClassName##Private; \
|
||||||
class Q_CORE_EXPORT ClassName \
|
class ClassName \
|
||||||
{ \
|
{ \
|
||||||
QT_PERMISSION(ClassName) \
|
QT_PERMISSION(ClassName) \
|
||||||
}; \
|
}; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user