Changeset View
Changeset View
Standalone View
Standalone View
src/KPropertyUnit_p.h
Show First 20 Lines • Show All 234 Lines • ▼ Show 20 Line(s) | 69 | public: | |||
---|---|---|---|---|---|
235 | 235 | | |||
236 | /// parse an angle to its value in degrees | 236 | /// parse an angle to its value in degrees | ||
237 | static qreal parseAngle(const QString &value, qreal defaultVal = 0.0); | 237 | static qreal parseAngle(const QString &value, qreal defaultVal = 0.0); | ||
238 | 238 | | |||
239 | QString toString() { | 239 | QString toString() { | ||
240 | return symbol(); | 240 | return symbol(); | ||
241 | } | 241 | } | ||
242 | 242 | | |||
243 | #ifdef KPROPERTY_WIDGET | ||||
244 | | ||||
243 | /** | 245 | /** | ||
244 | * Get an approximate scale of a unit vector that was converted by | 246 | * Get an approximate scale of a unit vector that was converted by | ||
245 | * the transfomation. | 247 | * the transfomation. | ||
246 | * | 248 | * | ||
247 | * Please note that exact values are guaranteed only for | 249 | * Please note that exact values are guaranteed only for | ||
248 | * combinations of Translate, Rotation and Unifor Scale | 250 | * combinations of Translate, Rotation and Unifor Scale | ||
249 | * matrices. For combinations having shears and perspective the | 251 | * matrices. For combinations having shears and perspective the | ||
250 | * value will be average for the point near CS origin. | 252 | * value will be average for the point near CS origin. | ||
251 | */ | 253 | */ | ||
252 | static qreal approxTransformScale(const QTransform &t); | 254 | static qreal approxTransformScale(const QTransform &t); | ||
253 | 255 | | |||
254 | /** | 256 | /** | ||
255 | * Adjust the unit by pixel transformation applied to the | 257 | * Adjust the unit by pixel transformation applied to the | ||
256 | * describing object. It multiplies the pixel coefficient by the | 258 | * describing object. It multiplies the pixel coefficient by the | ||
257 | * average scale of the matrix. | 259 | * average scale of the matrix. | ||
258 | */ | 260 | */ | ||
259 | void adjustByPixelTransform(const QTransform &t); | 261 | void adjustByPixelTransform(const QTransform &t); | ||
262 | #endif | ||||
260 | 263 | | |||
261 | private: | 264 | private: | ||
262 | Type m_type; | 265 | Type m_type; | ||
263 | qreal m_pixelConversion; | 266 | qreal m_pixelConversion; | ||
264 | }; | 267 | }; | ||
265 | 268 | | |||
266 | #ifndef QT_NO_DEBUG_STREAM | 269 | #ifndef QT_NO_DEBUG_STREAM | ||
267 | KPROPERTY_EXPORT QDebug operator<<(QDebug, const KPropertyUnit &); | 270 | KPROPERTY_EXPORT QDebug operator<<(QDebug, const KPropertyUnit &); | ||
268 | #endif | 271 | #endif | ||
269 | 272 | | |||
270 | Q_DECLARE_METATYPE(KPropertyUnit) | 273 | Q_DECLARE_METATYPE(KPropertyUnit) | ||
271 | Q_DECLARE_OPERATORS_FOR_FLAGS(KPropertyUnit::ListOptions) | 274 | Q_DECLARE_OPERATORS_FOR_FLAGS(KPropertyUnit::ListOptions) | ||
272 | 275 | | |||
273 | #endif | 276 | #endif |