/*!
    \qmlproperty string Category::categoryId

    This property holds the identifier of the category.  The categoryId is a string which uniquely
    identifies this category within the categories \l plugin.
*/
void QDeclarativeCategory::setCategoryId(const QString &id)
{
    if (m_category.categoryId() != id) {
        m_category.setCategoryId(id);
        emit categoryIdChanged();
    }
}
Exemple #2
0
void TaskObject::setCategoryId(unsigned long categoryId)
{
	if (m_categoryId != categoryId) {
		m_categoryId = categoryId;
		emit categoryIdChanged();
	}
}
/*!
    \qmlproperty QPlaceCategory Category::category
    \target Category::category

    For details on how to use this property to interface between C++ and QML see
    "\l {location-cpp-qml.html#category} {Interfaces between C++ and QML Code}".
*/
void QDeclarativeCategory::setCategory(const QPlaceCategory &category)
{
    QPlaceCategory previous = m_category;
    m_category = category;

    if (category.name() != previous.name())
        emit nameChanged();

    if (category.categoryId() != previous.categoryId())
        emit categoryIdChanged();

    if (m_icon && m_icon->parent() == this) {
        m_icon->setPlugin(m_plugin);
        m_icon->setIcon(m_category.icon());
    } else if (!m_icon || m_icon->parent() != this) {
        m_icon = new QDeclarativePlaceIcon(m_category.icon(), m_plugin, this);
        emit iconChanged();
    }
}