diff options
Diffstat (limited to 'src/corelib/kernel/qsystemerror_p.h')
-rw-r--r-- | src/corelib/kernel/qsystemerror_p.h | 52 |
1 files changed, 14 insertions, 38 deletions
diff --git a/src/corelib/kernel/qsystemerror_p.h b/src/corelib/kernel/qsystemerror_p.h index 1d8c253f53..abc2f1efc1 100644 --- a/src/corelib/kernel/qsystemerror_p.h +++ b/src/corelib/kernel/qsystemerror_p.h @@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE -class Q_CORE_EXPORT QSystemError +class QSystemError { public: enum ErrorScope @@ -66,51 +66,27 @@ public: NativeError }; - inline QSystemError(int error, ErrorScope scope); - inline QSystemError(); + Q_DECL_CONSTEXPR explicit QSystemError(int error, ErrorScope scope) + : errorCode(error), errorScope(scope) + { + } + Q_DECL_CONSTEXPR QSystemError() = default; - inline QString toString() const; - inline ErrorScope scope() const; - inline int error() const; + QString toString() const { return string(errorScope, errorCode); } + Q_DECL_CONSTEXPR ErrorScope scope() const { return errorScope; } + Q_DECL_CONSTEXPR int error() const { return errorCode; } - static QString string(ErrorScope errorScope, int errorCode); - static QString stdString(int errorCode = -1); + static Q_CORE_EXPORT QString string(ErrorScope errorScope, int errorCode); + static Q_CORE_EXPORT QString stdString(int errorCode = -1); #ifdef Q_OS_WIN - static QString windowsString(int errorCode = -1); + static Q_CORE_EXPORT QString windowsString(int errorCode = -1); #endif //data members - int errorCode; - ErrorScope errorScope; + int errorCode = 0; + ErrorScope errorScope = NoError; }; -QSystemError::QSystemError(int error, QSystemError::ErrorScope scope) -: errorCode(error), errorScope(scope) -{ - -} - -QSystemError::QSystemError() -: errorCode(0), errorScope(NoError) -{ - -} - -QString QSystemError::toString() const -{ - return string(errorScope, errorCode); -} - -QSystemError::ErrorScope QSystemError::scope() const -{ - return errorScope; -} - -int QSystemError::error() const -{ - return errorCode; -} - QT_END_NAMESPACE #endif // QSYSTEMERROR_P_H |