コード例 #1
0
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());
}
コード例 #2
0
ファイル: wfv_classes.hpp プロジェクト: ucf-cs/Tervel
 bool tryFree(){
     if (isWatched()){
         return false;
     }
     else{
         this->unsafeFree();
         return true;
     }
 };
コード例 #3
0
ファイル: wfv_classes.hpp プロジェクト: ucf-cs/Tervel
    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;
    };