void ObjectPropertiesView::contextMenuEvent(QContextMenuEvent *event) { m_clickedItem = m_tree->itemAt(QPoint(event->pos().x(), event->pos().y() - m_tree->header()->height())); if (!m_clickedItem) return; PropertiesViewItem *propItem = static_cast<PropertiesViewItem *>(m_clickedItem); QMenu menu; if (!isWatched(m_clickedItem)) { m_addWatchAction->setText(tr("Watch expression '%1'").arg(propItem->property.name())); menu.addAction(m_addWatchAction); } else { menu.addAction(m_removeWatchAction); } menu.addSeparator(); if (m_showUnwatchableProperties) m_toggleUnwatchablePropertiesAction->setText(tr("Hide unwatchable properties")); else m_toggleUnwatchablePropertiesAction->setText(tr("Show unwatchable properties")); menu.addAction(m_toggleGroupByItemTypeAction); menu.addAction(m_toggleUnwatchablePropertiesAction); menu.exec(event->globalPos()); }
bool tryFree(){ if (isWatched()){ return false; } else{ this->unsafeFree(); return true; } };
bool tryFree(){ if (isWatched()){ return false; } void *t=assoc.load(); if (Helper::isHelper(t)) { Helper *tHelper=Helper::unmark(t); if (tHelper->isWatched()) { return false; } else{ tHelper->unsafeFree(); } } this->unsafeFree(); return true; };