equal
deleted
inserted
replaced
898 |
898 |
899 \sa setProperty() boolProperty() doubleProperty() stringProperty() colorProperty() lengthProperty() lengthVectorProperty() Property |
899 \sa setProperty() boolProperty() doubleProperty() stringProperty() colorProperty() lengthProperty() lengthVectorProperty() Property |
900 */ |
900 */ |
901 int QTextFormat::intProperty(int propertyId) const |
901 int QTextFormat::intProperty(int propertyId) const |
902 { |
902 { |
|
903 // required, since the default layout direction has to be LayoutDirectionAuto, which is not integer 0 |
|
904 int def = (propertyId == QTextFormat::LayoutDirection) ? int(Qt::LayoutDirectionAuto) : 0; |
|
905 |
903 if (!d) |
906 if (!d) |
904 return 0; |
907 return def; |
905 const QVariant prop = d->property(propertyId); |
908 const QVariant prop = d->property(propertyId); |
906 if (prop.userType() != QVariant::Int) |
909 if (prop.userType() != QVariant::Int) |
907 return 0; |
910 return def; |
908 return prop.toInt(); |
911 return prop.toInt(); |
909 } |
912 } |
910 |
913 |
911 /*! |
914 /*! |
912 Returns the value of the property specified by \a propertyId. If the |
915 Returns the value of the property specified by \a propertyId. If the |