1 #ifndef QSETTINGSDIALOGENGINE_GLOBAL_H 2 #define QSETTINGSDIALOGENGINE_GLOBAL_H 4 #include <QtCore/qglobal.h> 5 #include <QSharedPointer> 10 #if defined(QSETTINGSDIALOG_LIBRARY) 11 # define QSETTINGSDIALOGSHARED_EXPORT Q_DECL_EXPORT 13 # define QSETTINGSDIALOGSHARED_EXPORT Q_DECL_IMPORT 20 #define safe_cast static_cast 22 template <
typename TTo,
typename TFrom>
23 inline TTo safeCast(TFrom from) {
24 Q_ASSERT_X(dynamic_cast<TTo>(from),
"",
"static cast not possible! Dynamic cast assertion failed!");
25 return static_cast<TTo
>(from);
27 #define safe_cast safeCast 31 #define sharedSafeCast(type, sharedPointer) sharedPointer.staticCast<type>() 33 template <
typename TTo,
typename TFrom>
35 Q_ASSERT_X(from.template dynamicCast<TTo>(),
"",
"static cast not possible! Dynamic cast assertion failed!");
36 return from.template staticCast<TTo>();
38 #define sharedSafeCast(type, sharedPointer) safeCast_sharedPointer<type>(sharedPointer) 44 #endif // QSETTINGSDIALOGENGINE_GLOBAL_H
QHash< QString, QVariant > UiPropertyMap
a Hash for strings to variant, to provide properties for edit widgets
Definition: qsettingsdialog_global.h:42