void QQuickMenuItem::unbindFromAction(QObject *o) { if (!o) return; if (o == m_boundAction) m_boundAction = 0; QQuickAction *action = qobject_cast<QQuickAction *>(o); if (!action) return; disconnect(action, SIGNAL(destroyed(QObject*)), this, SLOT(unbindFromAction(QObject*))); disconnect(action, SIGNAL(triggered()), this, SIGNAL(triggered())); disconnect(action, SIGNAL(toggled(bool)), this, SLOT(updateChecked())); disconnect(action, SIGNAL(exclusiveGroupChanged()), this, SIGNAL(exclusiveGroupChanged())); disconnect(action, SIGNAL(enabledChanged()), this, SLOT(updateEnabled())); disconnect(action, SIGNAL(textChanged()), this, SLOT(updateText())); disconnect(action, SIGNAL(shortcutChanged(QVariant)), this, SLOT(updateShortcut())); disconnect(action, SIGNAL(checkableChanged()), this, SIGNAL(checkableChanged())); disconnect(action, SIGNAL(iconNameChanged()), this, SLOT(updateIcon())); disconnect(action, SIGNAL(iconNameChanged()), this, SIGNAL(iconNameChanged())); disconnect(action, SIGNAL(iconSourceChanged()), this, SLOT(updateIcon())); disconnect(action, SIGNAL(iconSourceChanged()), this, SIGNAL(iconSourceChanged())); }
void QQuickMenuItem::bindToAction(QQuickAction *action) { m_boundAction = action; connect(m_boundAction, SIGNAL(destroyed(QObject*)), this, SLOT(unbindFromAction(QObject*))); connect(m_boundAction, SIGNAL(triggered()), this, SIGNAL(triggered())); connect(m_boundAction, SIGNAL(toggled(bool)), this, SLOT(updateChecked())); connect(m_boundAction, SIGNAL(exclusiveGroupChanged()), this, SIGNAL(exclusiveGroupChanged())); connect(m_boundAction, SIGNAL(enabledChanged()), this, SLOT(updateEnabled())); connect(m_boundAction, SIGNAL(textChanged()), this, SLOT(updateText())); connect(m_boundAction, SIGNAL(shortcutChanged(QVariant)), this, SLOT(updateShortcut())); connect(m_boundAction, SIGNAL(checkableChanged()), this, SIGNAL(checkableChanged())); connect(m_boundAction, SIGNAL(iconNameChanged()), this, SLOT(updateIcon())); connect(m_boundAction, SIGNAL(iconNameChanged()), this, SIGNAL(iconNameChanged())); connect(m_boundAction, SIGNAL(iconSourceChanged()), this, SLOT(updateIcon())); connect(m_boundAction, SIGNAL(iconSourceChanged()), this, SIGNAL(iconSourceChanged())); if (m_boundAction->parent() != this) { updateText(); updateShortcut(); updateEnabled(); updateIcon(); if (checkable()) updateChecked(); } }
QQuickMenuText::QQuickMenuText(QObject *parent, QQuickMenuItemType::MenuItemType type) : QQuickMenuBase(parent, type), m_action(new QQuickAction(this)) { connect(m_action, SIGNAL(enabledChanged()), this, SLOT(updateEnabled())); connect(m_action, SIGNAL(textChanged()), this, SLOT(updateText())); connect(m_action, SIGNAL(iconNameChanged()), this, SLOT(updateIcon())); connect(m_action, SIGNAL(iconNameChanged()), this, SIGNAL(iconNameChanged())); connect(m_action, SIGNAL(iconSourceChanged()), this, SLOT(updateIcon())); connect(m_action, SIGNAL(iconSourceChanged()), this, SIGNAL(iconSourceChanged())); }
void QDeclarativeLandmark::setIconSource(const QUrl& iconSource) { if (iconSource == m_landmark.iconUrl()) return; m_landmark.setIconUrl(iconSource); emit iconSourceChanged(); }
void QDeclarativeLandmarkCategory::setIconSource(const QUrl& iconSource) { if (iconSource == m_category.iconUrl()) return; m_category.setIconUrl(iconSource); emit iconSourceChanged(); }
void QchNotification::setIconSource(const QString &i) { if (i != iconSource()) { Q_D(QchNotification); d->iconSource = i; d->updateNotification(); emit iconSourceChanged(); } }
void QQuickAction::setIconSource(const QUrl &iconSource) { if (iconSource == m_iconSource) return; m_iconSource = iconSource; if (m_iconName.isEmpty() || m_icon.isNull()) { QString fileString = QQmlFile::urlToLocalFileOrQrc(iconSource); m_icon = QIcon(fileString); emit iconChanged(); } emit iconSourceChanged(); }
void MacToolButton::setIconSource(const QUrl &arg) { if (m_iconSource != arg) { m_iconSource = arg; emit iconSourceChanged(arg); } }