public: Q_DECL_CONSTEXPR inline QMetaClassInfo() : mobj(nullptr), handle(0) {} const char *name() const; const char *value() const; inline const QMetaObject *enclosingMetaObject() const { return mobj; } private: const QMetaObject *mobj; uint handle; friend struct QMetaObject; }; ...
int msecsTo(const QTime &) const; Q_DECL_CONSTEXPR bool operator==(const QTime &other) const { return mds == other.mds; } Q_DECL_CONSTEXPR bool operator!=(const QTime &other) const { return mds != other.mds; } Q_DECL_CONSTEXPR bool operator< (const QTime &other) const { re...
4.1 简单查看QLatin1String的源码 class QLatin1String{public:Q_DECL_CONSTEXPR inline QLatin1String() noexcept : m_size(0), m_data(nullptr) {}Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s) noexcept : m_size(s ? int(strlen(s)) : 0), m_data(s) {}Q_DECL_CONSTEXPR ...
Q_DECL_CONSTEXPRbool operator<=(const QTime &other) const { return mds <=other.mds; }Q_DECL_CONSTEXPRbooloperator> (constQTime &other)const{returnmds >other.mds; } Q_DECL_CONSTEXPRbooloperator>=(constQTime &other)const{returnmds >=other.mds; }staticQ_DECL_CONSTEXPR inline QTime from...
}template<typenameT>structQMetaTypeId2{enum{ Defined = QMetaTypeId<T>::Defined, IsBuiltIn=false};staticinlineQ_DECL_CONSTEXPRintqt_metatype_id(){returnQMetaTypeId<T>::qt_metatype_id(); } }; qRegisterMetaType()方法与QMetaType::type() ...
Q_DECL_CONSTEXPR inlineintds()const{returnmds == -1?0: mds; }int mds;#ifdefined(Q_OS_WINCE)intstartTick;#endiffriendclassQDateTime; friendclassQDateTimePrivate; #ifndef QT_NO_DATASTREAM friend Q_CORE_EXPORT QDataStream&operator<<(QDataStream &,constQTime &); ...
class QLatin1String{public:Q_DECL_CONSTEXPR inline QLatin1String() noexcept : m_size(0), m_data(nullptr) {}Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s) noexcept : m_size(s ? int(strlen(s)) : 0), m_data(s) {}Q_DECL_CONSTEXPR explicit QLatin1String(const char...
(ColorVertex_t, x); } static Q_DECL_CONSTEXPR inline int colorOffset() { return offsetof(ColorVertex_t, r); } static Q_DECL_CONSTEXPR inline int stride() { return sizeof(ColorVertex_t); } }; class OpenGLLinePlotWidget : public QOpenGLWidget, protected QOpenGLFunctions {...
#include <QApplication> #include <QDebug> Q_DECL_CONSTEXPR int x = 3; int main() { static_assert(x == 3); return 0; } (I've tested with out using constexpr, and it doesn't work, which is as expected). My compiler is Mingw-64, with QT version 5.10.1. c++ qt qt5 ...
(const Null &): d(Data::sharedNull()) {} ^ /Users/eric/Qt5.9.7/5.9.7/clang_64/lib/QtCore.framework/Headers/qstring.h:787:29: note: candidate constructor not viable: no known conversion from 'int' to 'QStringDataPtr' for 1st argument Q_DECL_CONSTEXPR inline QString(QStringData...