Exemple #1
0
AbstractProperty * PropertyGroup::addProperty(AbstractProperty * property)
{
    // Reject properties that have no name or whose name already exists
    if (!property || !property->hasName() || this->propertyExists(property->name()))
    {
        return nullptr;
    }

    // Invoke callback
    beforeAdd(count(), property);

    // Add property
    m_properties.push_back(property);
    m_propertiesMap.insert(std::make_pair(property->name(), property));

    // Invoke callback
    afterAdd(count(), property);

    // Return property
    return property;
}
void NotifyListNotifier::notifyBeforeAdd(const int firstIndex, const int lastIndex)
{
	emit beforeAdd(firstIndex, lastIndex);
}