Logo Search packages:      
Sourcecode: palapeli version File versions  Download package

QVariant Palapeli::PatternConfiguration::property ( const QByteArray &  key  )  const [inherited]

Reads a property.

Parameters:
key the key of the property
Returns:
the value of this property (or an empty QVariant if this property does not exist)

Definition at line 83 of file pattern-configuration.cpp.

References Palapeli::PatternConfiguration::Boolean, Palapeli::PatternConfiguration::Integer, Palapeli::PatternConfiguration::String, and Palapeli::PatternConfiguration::Variant.

Referenced by Palapeli::PatternTrader::configurationFromName(), createPattern(), Palapeli::JigsawPatternConfiguration::createPattern(), Palapeli::HexagonalPatternConfiguration::createPattern(), and Palapeli::PatternConfiguration::writeArguments().

{
      QVariant value = p->m_configurationValues.value(key, QVariant());
      switch (p->m_configurationDataTypes.value(key, Variant))
      {
            case String: value.convert(QVariant::String); return value;
            case Integer: value.convert(QVariant::Int); return value;
            case Boolean: value.convert(QVariant::Bool); return value;
            case Variant: default: return value;
      }
}


Generated by  Doxygen 1.6.0   Back to index