| 138 | } |
| 139 | |
| 140 | void VariableWidget::slotAddWatch(const QString &expression) |
| 141 | { |
| 142 | if (!expression.isEmpty()) |
| 143 | { |
| 144 | m_watchVarEditor->addToHistory(expression); |
| 145 | qCDebug(DEBUGGER) << "Trying to add watch"; |
| 146 | Variable* v = m_variablesRoot->watches()->add(expression); |
| 147 | if (v) { |
| 148 | /* For watches on structures, we really do want them to be shown |
| 149 | expanded. Except maybe for structure with custom pretty printing, |
| 150 | but will handle that later. |
| 151 | FIXME: it does not actually works now. |
| 152 | */ |
| 153 | //QModelIndex index = variableCollection()->indexForItem(v, 0); |
| 154 | //varTree_->setExpanded(index, true); |
| 155 | } |
| 156 | m_watchVarEditor->clearEditText(); |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | void VariableWidget::hideEvent(QHideEvent* e) |
| 161 | { |