HAL  v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
wave_tree_view.cpp
Go to the documentation of this file.
8 #include <QScrollBar>
9 #include <QDragMoveEvent>
10 #include <QDebug>
11 #include <QMenu>
12 #include <QAction>
13 #include <QLineEdit>
14 #include <QInputDialog>
15 #include <QMimeData>
16 #include <QPainter>
17 #include "gui/gui_globals.h"
18 
19 namespace hal {
21  : QTreeView(parent), mWaveDataList(wdList), mWaveItemHash(wHash)
22  {
30  setDragEnabled(true);
32  viewport()->setAcceptDrops(true);
33  setMouseTracking(true);
34  setAcceptDrops(true);
37  connect(this,&QTreeView::expanded,this,&WaveTreeView::handleExpand);
38  connect(this,&QTreeView::collapsed,this,&WaveTreeView::handleCollapse);
39  connect(this,&QTreeView::customContextMenuRequested,this,&WaveTreeView::handleContextMenuRequested);
40  }
41 
43  {
44  QModelIndex inx = indexAt(event->pos());
45  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
46  if (inx.isValid())
47  {
48  WaveData* wd = nullptr;
49  int iwave = wtm->waveIndex(inx);
50  if (iwave >= 0)
51  {
52  wd = mWaveDataList->at(iwave);
53  }
54  else
55  {
56  int grpId = wtm->groupId(inx);
57  if (grpId >= 0)
58  wd = mWaveDataList->mDataGroups.value(grpId);
59  }
60  if (wd)
61  {
62  editWaveData(wd);
63  return;
64  }
65  }
67  }
68 
69  void WaveTreeView::editWaveData(WaveData *wd)
70  {
71  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
72  WaveEditDialog wed(wd, wtm->cursorTime(), this);
73  if (wed.exec() == QDialog::Accepted)
74  {
75  wd->setData(wed.dataMap());
76  mWaveDataList->updateWaveData(mWaveDataList->waveIndexByNetId(wd->id()));
77  }
78  }
79 
80  void WaveTreeView::scrollContentsBy(int dx, int dy)
81  {
83  if (dy)
84  {
85  WaveWidget* ww = static_cast<WaveWidget*>(parent());
87  }
88  }
89 
91  {
92  if (evt->type() == QEvent::Resize)
93  {
96  return true;
97  }
99  }
100 
102  {
104  if (verticalScrollBar()->isVisible())
105  Q_EMIT sizeChanged(viewport()->height(), verticalScrollBar()->maximum(), verticalScrollBar()->value());
106  else
107  Q_EMIT sizeChanged(viewport()->height(), -1, -1);
108  }
109 
110  void WaveTreeView::handleContextMenuRequested(const QPoint& pos)
111  {
112  mContextIndexList = sortedSelection();
113  if (mContextIndexList.isEmpty())
114  {
115  QModelIndex inx = indexAt(pos);
116  if (!inx.isValid()) return;
117  mContextIndexList.append(inx);
118  }
119  bool singleSelection = mContextIndexList.size() == 1;
120 
121  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
122  bool onlyRootSel = wtm->onlyRootItemsSelected(mContextIndexList);
123  QMenu* menu = new QMenu(this);
124  QAction* act;
125 
126  if (singleSelection)
127  {
128  QString selName = wtm->netName(mContextIndexList.at(0));
129  selName.replace(QChar('&'),"&&");
130  act = menu->addAction("Insert new group");
131  connect(act,&QAction::triggered,this,&WaveTreeView::handleInsertGroup);
132 
133  act = menu->addAction("Insert new boolean expression");
134  connect(act,&QAction::triggered,this,&WaveTreeView::handleInsertBoolean);
135 
136  act = menu->addAction("Insert new trigger based on selection");
137  connect(act,&QAction::triggered,this,&WaveTreeView::handleInsertTrigger);
138 
139  act = menu->addAction("Rename '" + selName + "'");
140  connect(act,&QAction::triggered,this,&WaveTreeView::handleRenameItem);
141 
142  if (wtm->isLeaveItem(mContextIndexList.at(0)))
143  {
144  act = menu->addAction("Edit net wave " + selName);
145  connect(act,&QAction::triggered,this,&WaveTreeView::handleEditOrBrowseItem);
146 
147  act = menu->addAction("Remove net wave " + selName);
148  connect(act,&QAction::triggered,this,&WaveTreeView::handleRemoveItem);
149  }
150  else
151  {
152  act = menu->addAction("View group data " + selName);
153  connect(act,&QAction::triggered,this,&WaveTreeView::handleEditOrBrowseItem);
154 
155  act = menu->addAction("Remove group " + selName);
156  connect(act,&QAction::triggered,this,&WaveTreeView::handleRemoveGroup);
157 
158  QMenu* menuBase = menu->addMenu("Value format for " + selName);
159  act = menuBase->addAction("Binary");
160  act->setData(2);
161  connect(act,&QAction::triggered,this,&WaveTreeView::handleSetValueFormat);
162  act = menuBase->addAction("Decimal (signed)");
163  act->setData(-10);
164  connect(act,&QAction::triggered,this,&WaveTreeView::handleSetValueFormat);
165  act = menuBase->addAction("Decimal (unsigned)");
166  act->setData(10);
167  connect(act,&QAction::triggered,this,&WaveTreeView::handleSetValueFormat);
168  act = menuBase->addAction("Hexdec");
169  act->setData(16);
170  connect(act,&QAction::triggered,this,&WaveTreeView::handleSetValueFormat);
171  }
172  }
173  else
174  {
175  if (onlyRootSel)
176  {
177  act = menu->addAction(QString("Boolean expression based on %1 selected items").arg(mContextIndexList.size()));
178  connect(act,&QAction::triggered,this,&WaveTreeView::handleInsertBoolean);
179  act = menu->addAction(QString("Trigger time set based on %1 selected items").arg(mContextIndexList.size()));
180  connect(act,&QAction::triggered,this,&WaveTreeView::handleInsertTrigger);
181  }
182  act = menu->addAction(QString("Remove %1 selected items").arg(mContextIndexList.size()));
183  connect(act,&QAction::triggered,this,&WaveTreeView::handleRemoveMulti);
184  }
185  if (!mWaveDataList->mDataGroups.isEmpty())
186  {
187  menu->addSeparator();
188  act = menu->addAction("Collapse all groups");
190  act = menu->addAction("Expand all groups");
192  }
193  menu->popup(viewport()->mapToGlobal(pos));
194  }
195 
196  void WaveTreeView::handleSetValueFormat()
197  {
198  if (mContextIndexList.size() != 1) return;
199  QModelIndex inx = mContextIndexList.at(0);
200  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
201  int grpId = wtm->groupId(inx);
202  if (grpId<0) return;
203  WaveDataGroup* grp = mWaveDataList->mDataGroups.value(grpId);
204  if (!grp) return;
205 
206  QAction* act = static_cast<QAction*>(sender());
207  grp->setValueBase(act->data().toInt());
208  wtm->handleUpdateValueColumn();
209 
210  if (grpId)
211  {
212  WaveItem* wi = mWaveItemHash->value(WaveItemIndex(grpId,WaveItemIndex::Group,0));
213  if (wi) wi->setRequest(WaveItem::DataChanged);
214  }
215  }
216 
217  void WaveTreeView::handleRenameItem()
218  {
219  if (mContextIndexList.size() != 1) return;
220  QModelIndex inx = mContextIndexList.at(0);
221  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
222  WaveData* wd = wtm->item(inx);
223  if (!wd) return;
224  bool confirm;
225  QString newName =
226  QInputDialog::getText(this, "Change name in waveform list", "New name:", QLineEdit::Normal,
227  wd->name(), &confirm);
228  if (confirm && !newName.isEmpty())
229  {
230  if (wd->rename(newName))
231  {
232  SaleaeDirectoryStoreRequest save(&mWaveDataList->saleaeDirectory());
233  SaleaeDirectoryNetEntry::Type tp = wd->composedType();
234 
236  {
237  SaleaeDirectoryComposedEntry sdce = mWaveDataList->saleaeDirectory().get_composed(wd->id(),tp);
238  if (!sdce.isNull())
239  {
240  sdce.rename(newName.toStdString());
241  mWaveDataList->saleaeDirectory().add_or_replace_composed(sdce);
242  }
243  }
244  else
245  mWaveDataList->saleaeDirectory().rename_net(wd->id(),newName.toStdString());
246  }
247  }
248  }
249 
250  void WaveTreeView::handleEditOrBrowseItem()
251  {
252  if (mContextIndexList.size()!=1) return;
253  QModelIndex inx = mContextIndexList.at(0);
254  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
255  WaveData* wd = wtm->item(inx);
256  if (!wd) return;
257  editWaveData(wd);
258  }
259 
260  void WaveTreeView::handleRemoveItem()
261  {
262  if (mContextIndexList.size()!=1) return;
263  QModelIndex inx = mContextIndexList.at(0);
264  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
265  WaveTreeModel::ReorderRequest req(wtm);
266  mWaveItemHash->dispose(wtm->removeItemFromHash(inx.row(),inx.parent()));
267  }
268 
269  void WaveTreeView::handleRemoveGroup()
270  {
271  if (mContextIndexList.size()!=1) return;
272  QModelIndex inx = mContextIndexList.at(0);
273  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
274  WaveTreeModel::ReorderRequest req(wtm);
275  wtm->removeGroup(inx);
276 // expandAll();
277  }
278 
279  void WaveTreeView::handleRemoveMulti()
280  {
281  if (mContextIndexList.isEmpty()) return;
282  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
283  WaveTreeModel::ReorderRequest req(wtm);
284  SaleaeDirectoryStoreRequest save(&mWaveDataList->saleaeDirectory());
285  for (const QModelIndex& inx : mContextIndexList)
286  {
287  if (wtm->isLeaveItem(inx))
288  {
289  mWaveItemHash->dispose(wtm->removeItemFromHash(inx.row(),inx.parent()));
290  }
291  else
292  {
293  wtm->removeGroup(inx);
294  }
295  }
296 // expandAll();
297  }
298 
299  void WaveTreeView::handleInsertGroup()
300  {
301  if (mContextIndexList.size() != 1) return;
302  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
303  wtm->insertGroup(mContextIndexList.at(0));
304  }
305 
306  void WaveTreeView::handleInsertBoolean()
307  {
308  if (mContextIndexList.empty()) return;
309  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
310  QList<WaveData*> selectedWaves;
311  for (const QModelIndex& inx : mContextIndexList)
312  {
313  WaveData* wd = wtm->item(inx);
314  if (wd) selectedWaves.append(wd);
315  }
316  BooleanDialog bd(selectedWaves,this);
317  if (bd.exec() == QDialog::Accepted)
318  {
319  if (bd.hasExpression())
320  {
321  QString boolExpr = bd.expression();
322  if (!boolExpr.isEmpty())
323  {
324  wtm->insertBoolean(mContextIndexList.last(),boolExpr);
326  }
327  }
328  else
329  {
330  wtm->insertBoolean(mContextIndexList.last(),selectedWaves,bd.tableValues());
332  }
333  }
334  }
335 
336  void WaveTreeView::handleInsertTrigger()
337  {
338  if (mContextIndexList.empty()) return;
339  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
340  QList<WaveData*> trigList;
341  for (const QModelIndex& inx : mContextIndexList)
342  {
343  WaveData* wd = wtm->item(inx);
344  if (wd) trigList.append(wd);
345  }
346  QModelIndex insertInx = wtm->index(mContextIndexList.first().row()+1,0);
347  QList<WaveData*> filterList;
348  for (WaveDataBoolean* wdb : mWaveDataList->mDataBooleans.values())
349  filterList.append(wdb);
350  QSet<int> iwaveAdded;
351  for (auto it = mWaveItemHash->constBegin(); it != mWaveItemHash->constEnd(); ++it)
352  {
353  if (it.key().intType()!=WaveItemIndex::Wire) continue;
354  int iwave = it.key().index();
355  if (iwave < 0 || iwaveAdded.contains(iwave)) continue;
356  filterList.append(mWaveDataList->at(iwave));
357  iwaveAdded.insert(iwave);
358  }
359  TriggerDialog td(trigList,filterList,this);
360  if (td.exec() == QDialog::Accepted)
361  {
362  wtm->insertTrigger(insertInx,trigList,td.transitionToValue(),td.filterWave());
363  }
364  }
365 
366  QModelIndexList WaveTreeView::sortedSelection() const
367  {
368  QMap<int,QModelIndex> sortInx;
369  for (const QModelIndex& inx : selectedIndexes())
370  {
371  if (inx.column()) continue;
372  int sortCode = 2000000000;
373  QModelIndex p = inx.parent();
374  // subtract group unless root
375  if (p.isValid() && p.internalPointer())
376  sortCode -= (p.row()+1) * 200000;
377  sortCode -= (inx.row()+1);
378  sortInx.insert(sortCode,inx);
379  }
380  return sortInx.values();
381  }
382 
384  {
385  QModelIndexList sel = sortedSelection();
386  if (sel.isEmpty()) return;
387  static_cast<WaveTreeModel*>(model())->setDragIndexes(sel);
388  QAbstractItemView::startDrag(supportedActions);
389  }
390 
391  void WaveTreeView::handleExpand(const QModelIndex& index)
392  {
393  const WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
394  int grpId = wtm->groupId(index);
395  if (grpId >= 0) mExpandedGroups.insert(grpId);
396 
397  reorder();
398  }
399 
400  void WaveTreeView::handleCollapse(const QModelIndex& index)
401  {
402  const WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
403  int grpId = wtm->groupId(index);
404  if (grpId >= 0) mExpandedGroups.remove(grpId);
405 
406  reorder();
407  }
408 
410  {
415  reorder();
416  }
417 
418 
420  {
421  mItemOrder.clear();
422  mWaveDataList->emptyTrash();
423  orderRecursion(QModelIndex());
424 
425  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
426  WaveItemHash notPlaced = *mWaveItemHash;
427  int nVisible = mItemOrder.size();
428  if (nVisible != mWaveItemHash->visibleEntries())
429  {
430  mWaveItemHash->setVisibleEntries(nVisible);
431 
432  /* // signal not connected
433  if (verticalScrollBar()->isVisible())
434  Q_EMIT numberVisibleChanged(nVisible, verticalScrollBar()->maximum(), verticalScrollBar()->value());
435  else
436  Q_EMIT numberVisibleChanged(nVisible, -1, -1);
437  */
438  }
439  for (int i=0; i<nVisible; i++)
440  {
441  QModelIndex currentIndex = mItemOrder.at(i);
442  int iwave = wtm->waveIndex(currentIndex);
443  if (iwave < 0)
444  {
445  int id = 0;
447  if (iwave == -1)
448  {
449  id = wtm->groupId(currentIndex);
451  }
452  else if (iwave == -2)
453  {
454  id = wtm->booleanId(currentIndex);
455  tp = WaveItemIndex::Bool;
456  }
457  else if (iwave == -3)
458  {
459  id = wtm->triggerId(currentIndex);
460  tp = WaveItemIndex::Trig;
461  }
462  if (id > 0 && tp != WaveItemIndex::Invalid)
463  {
464  WaveItemIndex wii(id, tp, 0);
465  WaveItem* wi = mWaveItemHash->value(wii);
466  if (!wi)
467  {
468  mWaveItemHash->dump("Crash");
469  qDebug() << "group/boolean wii not found" << id << tp;
470  }
471  Q_ASSERT(wi);
472  wi->setYposition(i);
473  wi->setWaveVisible(true);
474  auto it = notPlaced.find(wii);
475  if (it != notPlaced.end()) notPlaced.erase(it);
476  }
477  }
478  else
479  {
480  int groupId = wtm->groupId(currentIndex.parent());
481  if (groupId < 0) groupId = 0;
482  WaveItemIndex wii(iwave, WaveItemIndex::Wire, groupId);
483  WaveItem* wi = mWaveItemHash->value(wii);
484  if (!wi)
485  {
486  mWaveItemHash->dump("Crash");
487  qDebug() << "wire wii not found" << iwave << groupId;
488  }
489  Q_ASSERT(wi);
490  wi->setYposition(i);
491  wi->setWaveVisible(true);
492  auto it = notPlaced.find(wii);
493  if (it != notPlaced.end()) notPlaced.erase(it);
494  }
495 
496  // restore expanded or collapsed group state
497  int grpId = wtm->groupId(currentIndex);
498  if (grpId >= 0)
499  {
500  if (mExpandedGroups.contains(grpId))
502  else
504  }
505  }
506 
507  for (WaveItem* wi : notPlaced.values())
508  wi->setWaveVisible(false);
509 
510  wtm->persist();
512  }
513 
514  void WaveTreeView::selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
515  {
516  QTreeView::selectionChanged(selected,deselected);
517  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
518  mWaveItemHash->setSelected();
519  for (WaveItem* wi : mWaveItemHash->values())
520  wi->setWaveSelected(false);
521 
522  std::vector<u32> netIds;
523  for (const QModelIndex& inx : sortedSelection())
524  {
525  WaveItemIndex wii = wtm->hashIndex(inx);
526  WaveItem* wi = mWaveItemHash->value(wii);
527  if (wi)
528  {
529  wi->setWaveSelected(true);
530  if (!mWaveItemHash->firstSelected())
531  mWaveItemHash->setSelected(wi);
532  }
533  const WaveData* wd = wi->wavedata();
534  if (wd)
535  {
536  netIds.push_back(wd->id());
537  }
538  }
539  if (!netIds.empty()) gGuiApi->selectNet(netIds,true,false);
540  }
541 
542  void WaveTreeView::orderRecursion(const QModelIndex &parent)
543  {
544  int n = model()->rowCount(parent);
545  for (int i=0; i<n; i++)
546  {
547  QModelIndex inx = model()->index(i,0,parent);
548  if (!inx.isValid()) continue;
549  mItemOrder.append(inx);
550  if (isExpanded(inx)) orderRecursion(inx);
551  }
552  }
553 
554  void WaveTreeView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
555  {
556  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
557  if (previous.isValid())
558  {
559  WaveItem* wi = mWaveItemHash->value(wtm->hashIndex(previous));
560  if (wi)
561  {
562  wi->setWaveSelected(false);
564  }
565  }
566  if (current.isValid())
567  {
568  WaveItem* wi = mWaveItemHash->value(wtm->hashIndex(current));
569  if (wi)
570  {
571  if (wi) wi->setWaveSelected(true);
573  }
574  }
575  }
576 
578  {
579  WaveTreeModel* wtm = static_cast<WaveTreeModel*>(model());
580  selectionModel()->clear();
581  bool first = true;
582  for (QModelIndex inx : wtm->indexes(netIds))
583  {
585  if (first)
586  {
587  first = false;
588  setCurrentIndex(inx);
589  scrollTo(inx, EnsureVisible);
590  }
591  }
592  }
593 
595  const QModelIndex &index) const
596  {
597  QPen textPen = QPen(option.palette.text(),0);
598  if (option.state & QStyle::State_Selected)
599  {
600  painter->fillRect(option.rect, option.palette.highlight());
601  textPen = QPen(option.palette.highlightedText(),0);
602  }
603  QString txt = index.data(Qt::DisplayRole).toString();
604  QRect rectTxt = option.rect;
605  int w = rectTxt.width()-22;
606  if (w > 30)
607  {
608  rectTxt.setWidth(w);
609  QColor col = index.data(Qt::BackgroundRole).value<QColor>();
610  QRect rectCol(rectTxt.left()+w+3,rectTxt.top()+3,16,16);
611  painter->setBrush(QBrush(col));
612  painter->drawEllipse(rectCol);
613  }
614  painter->setPen(textPen);
615  QFont font = painter->font();
616  font.setPixelSize(12);
617  font.setBold(true);
618  painter->setFont(font);
619  painter->drawText(rectTxt,Qt::AlignRight|Qt::AlignTop,txt);
620  }
621 }
void selectNet(u32 netId, bool clear_current_selection=true, bool navigate_to_selection=true)
Definition: gui_api.cpp:149
void rename_net(uint32_t id, const std::string &nam)
Change waveform name entry for net identified by id.
void add_or_replace_composed(SaleaeDirectoryComposedEntry sdce)
Add composed waveform entry (Group, Boolean, Trigger)
SaleaeDirectoryComposedEntry get_composed(uint32_t id, SaleaeDirectoryNetEntry::Type tp) const
Getter for pointer to composed waveform entry allowing modifications.
void rename(const std::string nam)
Rename waveform.
Type
@ None
void setData(const QMap< u64, int > &dat)
Definition: wave_data.cpp:119
u32 id() const
Definition: wave_data.h:103
QMap< u32, WaveDataGroup * > mDataGroups
Definition: wave_data.h:203
QMap< u32, WaveDataBoolean * > mDataBooleans
Definition: wave_data.h:204
int waveIndexByNetId(u32 id) const
Definition: wave_data.h:227
SaleaeDirectory & saleaeDirectory()
Definition: wave_data.h:242
void updateWaveData(int inx)
Definition: wave_data.cpp:1408
void setSelected(WaveItem *wi=nullptr)
Definition: wave_item.h:167
int visibleEntries() const
Definition: wave_item.h:160
void setVisibleEntries(int ve)
Definition: wave_item.h:162
void dump(const char *stub)
Definition: wave_item.cpp:353
WaveItem * firstSelected() const
Definition: wave_item.h:166
void dispose(WaveItem *wi)
Definition: wave_item.cpp:320
const WaveData * wavedata() const
Definition: wave_item.h:129
void setWaveVisible(bool vis)
Definition: wave_item.cpp:46
void setYposition(int pos)
Definition: wave_item.cpp:33
void setWaveSelected(bool sel)
Definition: wave_item.cpp:53
int triggerId(const QModelIndex &trigIndex) const
QModelIndexList indexes(const WaveData *wd) const
u64 cursorTime() const
int waveIndex(const QModelIndex &index) const
bool onlyRootItemsSelected(const QModelIndexList &selectList) const
int groupId(const QModelIndex &grpIndex) const
int booleanId(const QModelIndex &boolIndex) const
WaveItemIndex hashIndex(const QModelIndex &index) const
void viewportHeightChanged(int height)
void mouseDoubleClickEvent(QMouseEvent *event) override
void handleInserted(const QModelIndex &index)
void sizeChanged(int viewportHeight, int scrollbarMax, int scrollbarPos)
WaveTreeView(WaveDataList *wdList, WaveItemHash *wHash, QWidget *parent=nullptr)
bool viewportEvent(QEvent *event) override
void scrollContentsBy(int dx, int dy) override
void setWaveSelection(const QSet< u32 > &netIds)
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override
void resizeEvent(QResizeEvent *event) override
void triggerUpdateWaveItems()
void currentChanged(const QModelIndex &current, const QModelIndex &previous) override
void startDrag(Qt::DropActions supportedActions) override
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
void scrollToYpos(int ypos)
bool save(std::filesystem::path file_path, GateLibrary *gate_lib, bool overwrite=false)
Definition: defines.h:45
GuiApi * gGuiApi
Definition: plugin_gui.cpp:86
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const=0
virtual int rowCount(const QModelIndex &parent) const const=0
QModelIndex currentIndex() const const
void setDragDropMode(QAbstractItemView::DragDropMode behavior)
void setDragEnabled(bool enable)
virtual bool event(QEvent *event) override
QAbstractItemModel * model() const const
virtual void mouseDoubleClickEvent(QMouseEvent *event) override
virtual void resizeEvent(QResizeEvent *event) override
void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior)
void setSelectionMode(QAbstractItemView::SelectionMode mode)
QItemSelectionModel * selectionModel() const const
void setCurrentIndex(const QModelIndex &index)
void setItemDelegateForColumn(int column, QAbstractItemDelegate *delegate)
void setDropIndicatorShown(bool enable)
virtual void startDrag(Qt::DropActions supportedActions)
void setVerticalScrollMode(QAbstractItemView::ScrollMode mode)
virtual bool viewportEvent(QEvent *event) override
void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy)
QScrollBar * verticalScrollBar() const const
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)
QWidget * viewport() const const
QVariant data() const const
void setData(const QVariant &userData)
void triggered(bool checked)
QEvent::Type type() const const
void setBold(bool enable)
void setPixelSize(int pixelSize)
QHash::const_iterator constBegin() const const
QHash::const_iterator constEnd() const const
QHash::iterator end()
QHash::iterator erase(QHash::iterator pos)
QHash::iterator find(const Key &key)
const T value(const Key &key) const const
QList< T > values() const const
QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode, const QString &text, bool *ok, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
virtual void clear()
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
virtual void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
void append(const T &value)
const T & at(int i) const const
void clear()
int size() const const
QMap::iterator insert(const Key &key, const T &value)
QList< T > values() const const
QAction * addAction(const QString &text)
QAction * addMenu(QMenu *menu)
QAction * addSeparator()
void popup(const QPoint &p, QAction *atAction)
int column() const const
void * internalPointer() const const
bool isValid() const const
QModelIndex parent() const const
int row() const const
Q_EMITQ_EMIT
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const const
QObject * sender() const const
void drawEllipse(const QRectF &rectangle)
void drawText(const QPointF &position, const QString &text)
void fillRect(const QRectF &rectangle, const QBrush &brush)
const QFont & font() const const
void setBrush(const QBrush &brush)
void setFont(const QFont &font)
void setPen(const QColor &color)
int left() const const
void setWidth(int width)
int top() const const
int width() const const
bool contains(const T &value) const const
QSet::iterator insert(const T &value)
bool remove(const T &value)
bool isEmpty() const const
QString & replace(int position, int n, QChar after)
std::string toStdString() const const
AlignRight
CustomContextMenu
typedef DropActions
DisplayRole
ScrollBarAsNeeded
void collapse(const QModelIndex &index)
void collapseAll()
void collapsed(const QModelIndex &index)
void expand(const QModelIndex &index)
void expandAll()
void expanded(const QModelIndex &index)
virtual QModelIndex indexAt(const QPoint &point) const const override
bool isExpanded(const QModelIndex &index) const const
virtual void scrollContentsBy(int dx, int dy) override
virtual void scrollTo(const QModelIndex &index, QAbstractItemView::ScrollHint hint) override
virtual QModelIndexList selectedIndexes() const const override
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override
void setUniformRowHeights(bool uniform)
int toInt(bool *ok) const const
void setAcceptDrops(bool on)
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
void customContextMenuRequested(const QPoint &pos)
QPoint mapToGlobal(const QPoint &pos) const const
void setMouseTracking(bool enable)
bool isVisible() const const