HAL  v4.5.0-232-g8053ac4b3
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
context_manager_widget.cpp
Go to the documentation of this file.
2 
3 #include "gui/gui_globals.h"
4 
7 //#include "gui/graph_widget/graph_widget.h"
8 
12 
13 //#include "hal_core/utilities/log.h"
14 #include "gui/gui_utils/graphics.h"
15 //#include "hal_core/netlist/gate.h"
16 //#include "hal_core/netlist/module.h"
17 //#include "hal_core/netlist/netlist.h"
18 #include "gui/toolbar/toolbar.h"
19 #include <QAction>
20 #include <QDebug>
21 //#include <QListWidgetItem>
22 #include <QMenu>
23 #include <QResizeEvent>
24 #include <QSize>
25 //#include <QStringList>
26 //#include <QStringListModel>
27 #include <QVBoxLayout>
28 #include <QHeaderView>
35 #include <QShortcut>
36 #include <QApplication>
37 #include <QInputDialog>
38 
39 namespace hal
40 {
42  : ContentWidget("Views", parent), mSearchbar(new Searchbar(this)), mNewDirectoryAction(new QAction(this)), mNewViewAction(new QAction(this)), mRenameAction(new QAction(this)), mDuplicateAction(new QAction(this)),
43  mDeleteAction(new QAction(this)), mOpenAction(new QAction(this))
44  {
45  //needed to load the properties
47  mTabView = tab_view;
48 
49  mOpenAction->setIcon(gui_utility::getStyledSvgIcon(mOpenIconStyle, mOpenIconPath));
50  mNewViewAction->setIcon(gui_utility::getStyledSvgIcon(mNewViewIconStyle, mNewViewIconPath));
51  mNewDirectoryAction->setIcon(gui_utility::getStyledSvgIcon(mNewViewIconStyle, mNewDirIconPath));
52  mRenameAction->setIcon(gui_utility::getStyledSvgIcon(mRenameIconStyle, mRenameIconPath));
53  mDuplicateAction->setIcon(gui_utility::getStyledSvgIcon(mDuplicateIconStyle, mDuplicateIconPath));
54  mDeleteAction->setIcon(gui_utility::getStyledSvgIcon(mDeleteIconStyle, mDeleteIconPath));
55  mSearchAction->setIcon(gui_utility::getStyledSvgIcon(mSearchIconStyle, mSearchIconPath));
56 
57  mOpenAction->setToolTip("Open");
58  mNewViewAction->setToolTip("New view");
59  mNewDirectoryAction->setToolTip("New directory");
60  mRenameAction->setToolTip("Rename");
61  mDuplicateAction->setToolTip("Duplicate");
62  mDeleteAction->setToolTip("Delete");
63  mSearchAction->setToolTip("Search");
64 
65  mOpenAction->setText("Open view");
66  mNewViewAction->setText("Create new view");
67  mNewDirectoryAction->setText("Create new directory");
68  mRenameAction->setText("Rename item");
69  mDuplicateAction->setText("Duplicate view");
70  mDeleteAction->setText("Delete item");
71  mSearchAction->setText("Search");
72 
73  //mOpenAction->setEnabled(false);
74  //mRenameAction->setEnabled(false);
75  //mDuplicateAction->setEnabled(false);
76  //mDeleteAction->setEnabled(false);
77 
78  mContextTreeModel = gGraphContextManager->getContextTreeModel();
79 
80  mContextTreeProxyModel = new ContextProxyModel(this);
81  mContextTreeProxyModel->setSourceModel(mContextTreeModel);
82  mContextTreeProxyModel->setSortRole(Qt::UserRole);
83 
84  mContextTreeView = new QTreeView(this);
85  mContextTreeView->setModel(mContextTreeProxyModel);
86  mContextTreeView->setSortingEnabled(true);
88  mContextTreeView->setSelectionMode(QAbstractItemView::SingleSelection); // ERROR ???
89  mContextTreeView->setContextMenuPolicy(Qt::ContextMenuPolicy::CustomContextMenu);
91 
92  mContextTreeView->setDragEnabled(true);
93  mContextTreeView->setAcceptDrops(true);
94  mContextTreeView->setDropIndicatorShown(true);
95 
96  mContextTreeView->header()->setSortIndicator(-1, Qt::AscendingOrder);
97  mContextTreeView->header()->setSortIndicatorShown(false);
98 
99  mContentLayout->addWidget(mContextTreeView);
100  mContentLayout->addWidget(mSearchbar);
101 
102  mSearchbar->hide();
103  mSearchbar->setColumnNames(mContextTreeProxyModel->getColumnNames());
104  enableSearchbar(mContextTreeProxyModel->rowCount() > 0);
105 
107  connect(mNewViewAction, &QAction::triggered, this, &ContextManagerWidget::handleCreateContextClicked);
108  connect(mNewDirectoryAction, &QAction::triggered, this, &ContextManagerWidget::handleCreateDirectoryClicked);
109  connect(mRenameAction, &QAction::triggered, this, &ContextManagerWidget::handleRenameClicked);
110  connect(mDuplicateAction, &QAction::triggered, this, &ContextManagerWidget::handleDuplicateContextClicked);
111  connect(mDeleteAction, &QAction::triggered, this, &ContextManagerWidget::handleDeleteClicked);
112  connect(mSearchAction, &QAction::triggered, this, &ContextManagerWidget::toggleSearchbar);
113 
114  connect(mContextTreeView, &QTreeView::customContextMenuRequested, this, &ContextManagerWidget::handleContextMenuRequest);
117  connect(mContextTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &ContextManagerWidget::handleSelectionChanged);
118  connect(mContextTreeView->header(), &QHeaderView::sectionClicked, this, &ContextManagerWidget::handleHeaderSectionClicked);
121 
123  connect(mSearchbar, &Searchbar::triggerNewSearch, mContextTreeProxyModel, &ContextProxyModel::startSearch);
124 
125  mShortCutDeleteItem = new QShortcut(ContentManager::sSettingDeleteItem->value().toString(), this);
126  mShortCutDeleteItem->setEnabled(false);
127 
129  connect(mShortCutDeleteItem, &QShortcut::activated, this, &ContextManagerWidget::handleDeleteClicked);
130 
131  connect(qApp, &QApplication::focusChanged, this, &ContextManagerWidget::handleFocusChanged);
132 
135  }
136 
137  void ContextManagerWidget::handleHeaderSectionClicked(int column)
138  {
139  mContextTreeView->header()->setSortIndicatorShown(true);
140  }
141 
142  void ContextManagerWidget::handleCreateContextClicked()
143  {
144  UserActionCompound* act = new UserActionCompound;
145  act->setUseCreatedObject();
146  act->addAction(new ActionCreateObject(UserActionObjectType::ContextView,
148  act->addAction(new ActionAddItemsToObject({gNetlist->get_top_module()->get_id()}, {}));
149  act->exec();
150  }
151 
152  void ContextManagerWidget::handleRowsInserted(const QModelIndex &parent, int first, int last)
153  {
154  mContextTreeView->expand(mContextTreeProxyModel->mapFromSource(parent));
155  for (int irow = first; irow <= last; irow++)
156  {
157  mContextTreeView->expand(mContextTreeProxyModel->mapFromSource(mContextTreeModel->index(irow,0,parent)));
158  }
159  }
160 
161  void ContextManagerWidget::handleCreateDirectoryClicked()
162  {
163  bool confirm;
164  QString newName = QInputDialog::getText(this, "Directory name", "name:", QLineEdit::Normal, "", &confirm);
165 
166  if (confirm && !newName.isEmpty())
167  {
169  act->setUseCreatedObject();
171  act->addAction(new ActionAddItemsToObject({gNetlist->get_top_module()->get_id()}, {}));
172  act->exec(); }
173  }
174 
176  {
177  GraphContext* defaultContext = getCurrentContext();
178  if (!defaultContext) return;
179  mTabView->showContext(defaultContext);
180  }
181 
183  {
184  QModelIndex sourceIndex = mContextTreeProxyModel->mapToSource(proxyIndex);
185  ContextTreeItem* item = static_cast<ContextTreeItem*>(mContextTreeModel->getItemFromIndex(sourceIndex));
186 
187  mContextTreeModel->setCurrentDirectory(item);
188 
189  if (item->isContext()) {
190 
191  GraphContext* clickedContext = item->context();
192 
193  if (!clickedContext) return;
194 
195  mTabView->showContext(clickedContext);
196  }
197  }
198 
200  {
201  QModelIndex sourceIndex = mContextTreeProxyModel->mapToSource(proxyIndex);
202  ContextTreeItem* item = static_cast<ContextTreeItem*>(mContextTreeModel->getItemFromIndex(sourceIndex));
203 
204  mContextTreeModel->setCurrentDirectory(item);
205 
206  }
207 
208  void ContextManagerWidget::handleRenameClicked()
209  {
210  ContextTreeItem* clicked_item = getCurrentItem();
211 
212  if (clicked_item->isContext()) {
213  GraphContext* clicked_context = clicked_item->context();
214 
215  if (!clicked_context) return;
216 
217  QStringList used_context_names;
218  for (const auto& context : gGraphContextManager->getContexts())
219  used_context_names.append(context->name());
220 
221  UniqueStringValidator unique_validator(used_context_names);
222  EmptyStringValidator empty_validator;
223 
224  InputDialog ipd;
225  ipd.setWindowTitle("Rename View");
226  ipd.setInfoText("Please select a new unique name for the view.");
227  ipd.setInputText(clicked_context->name());
228  ipd.addValidator(&unique_validator);
229  ipd.addValidator(&empty_validator);
230 
231  if (ipd.exec() == QDialog::Accepted)
232  {
235  act->exec();
236  clicked_context->setExclusiveModuleId(0, false);
237  }
238  }
239  else if (clicked_item->isDirectory()){
240  ContextDirectory* clicked_directory = clicked_item->directory();
241 
242  if (!clicked_directory) return;
243 
244  InputDialog ipd;
245  ipd.setWindowTitle("Rename directory");
246  ipd.setInfoText("Please select a new name for the directory.");
247  ipd.setInputText(clicked_directory->name());
248 
249  if (ipd.exec() == QDialog::Accepted)
250  {
251  ActionRenameObject* act = new ActionRenameObject(ipd.textValue());
252  act->setObject(UserActionObject(clicked_directory->id(),UserActionObjectType::ContextDir));
253  act->exec();
254  }
255  }
256  }
257 
258  void ContextManagerWidget::handleDuplicateContextClicked()
259  {
260  GraphContext* clicked_context = getCurrentContext();
261 
262  if (!clicked_context) return;
263 
264  UserActionCompound* act = new UserActionCompound;
265  act->setUseCreatedObject();
266 
267  // TODO: check whether name + " (Copy)" is already in use
268  act->addAction(new ActionCreateObject(UserActionObjectType::ContextView,clicked_context->name() + " (Copy)"));
269 
270  ActionAddItemsToObject* actAddItems = new ActionAddItemsToObject(clicked_context->modules(),clicked_context->gates());
271  GridPlacement plc;
272  QMap<Node, QPoint> contextNodeMap = clicked_context->getLayouter()->nodeToPositionMap();
273  for (auto it = contextNodeMap.begin(); it != contextNodeMap.end(); it++)
274  plc.insert(it.key(), it.value());
275  actAddItems->setPlacementHint(plc);
276  act->addAction(actAddItems);
277 
278  act->exec();
279  }
280 
281  void ContextManagerWidget::handleDeleteClicked()
282  {
283  QModelIndex currentIndex = mContextTreeView->currentIndex();
284  if (!currentIndex.isValid()) return;
285 
286  ContextTreeItem* currentItem = getCurrentItem();
287 
288  if (currentItem->isContext()) {
289  GraphContext* clicked_context = currentItem->context();
290 
291  if (!clicked_context) return;
292 
293  ActionDeleteObject* act = new ActionDeleteObject;
294  act->setObject(UserActionObject(clicked_context->id(),UserActionObjectType::ContextView));
295  act->exec();
296  }
297  else if (currentItem->isDirectory()) {
298  if (currentItem->getChildCount())
299  {
300  if (QMessageBox::Ok !=
301  QMessageBox::information(this, "Directory not empty", "You are about to delete a directory which is not empty.\nThis action cannot be undone",
303  return;
304  }
305 
306  ContextDirectory* clicked_directory = currentItem->directory();
307 
308  if (!clicked_directory) return;
309 
310  ActionDeleteObject* act = new ActionDeleteObject;
311  act->setObject(UserActionObject(clicked_directory->id(),UserActionObjectType::ContextDir));
312  act->exec();
313  }
314 
315 
316  }
317 
318  void ContextManagerWidget::handleSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
319  {
320  Q_UNUSED(selected);
321  Q_UNUSED(deselected);
322 
323  setToolbarButtonsEnabled(mContextTreeView->selectionModel()->hasSelection());
324  }
325 
326  void ContextManagerWidget::handleContextMenuRequest(const QPoint& point)
327  {
328  const QModelIndex clicked_index = mContextTreeView->indexAt(point);
329 
330  QModelIndex sourceIndex = mContextTreeProxyModel->mapToSource(clicked_index);
331  ContextTreeItem* item = static_cast<ContextTreeItem*>(mContextTreeModel->getItemFromIndex(sourceIndex));
332  if (item)
333  mContextTreeModel->setCurrentDirectory(item);
334 
335  QMenu context_menu;
336 
337  context_menu.addAction(mNewViewAction);
338  context_menu.addAction(mNewDirectoryAction);
339 
340  GraphContext* clicked_context = getCurrentContext();
341  ContextDirectory* clicked_directory = getCurrentItem()->directory();
342 
343  if (!clicked_context && !clicked_directory) {
344  context_menu.exec(mContextTreeView->viewport()->mapToGlobal(point));
345  return;
346  }
347 
348  if (clicked_index.isValid() && clicked_context)
349  {
350  context_menu.addAction(mOpenAction);
351  context_menu.addAction(mDuplicateAction);
352  context_menu.addAction(mRenameAction);
353  context_menu.addAction(mDeleteAction);
354  }
355 
356  if (clicked_index.isValid() && clicked_directory)
357  {
358  context_menu.addAction(mDeleteAction);
359  context_menu.addAction(mRenameAction);
360  }
361 
362  context_menu.exec(mContextTreeView->viewport()->mapToGlobal(point));
363  }
364 
366  {
367  enableSearchbar(mContextTreeProxyModel->rowCount() > 0);
368 
369  // the view may move the selection to a neighbouring row after a removal without
370  // a selectionChanged signal that reflects the final state
371  setToolbarButtonsEnabled(mContextTreeView->selectionModel()->hasSelection());
372  }
373 
375  {
376  if (mSearchbar->filterApplied() && mSearchbar->isVisible())
377  mSearchAction->setIcon(gui_utility::getStyledSvgIcon(mSearchActiveIconStyle, mSearchIconPath));
378  else
379  mSearchAction->setIcon(gui_utility::getStyledSvgIcon(mSearchIconStyle, mSearchIconPath));
380  }
381 
383  {
384  const QModelIndex source_model_index = mContextTreeModel->getIndexFromItem(static_cast<BaseTreeItem*>(item));
385  const QModelIndex proxy_model_index = mContextTreeProxyModel->mapFromSource(source_model_index);
386 
387  if(proxy_model_index.isValid())
388  mContextTreeView->setCurrentIndex(proxy_model_index);
389  else
390  mContextTreeView->clearSelection();
391  }
392 
394  {
395  const QModelIndex source_model_index = mContextTreeModel->getIndexFromContext(context);
396  const QModelIndex proxy_model_index = mContextTreeProxyModel->mapFromSource(source_model_index);
397 
398  if(proxy_model_index.isValid())
399  mContextTreeView->setCurrentIndex(proxy_model_index);
400  else
401  mContextTreeView->clearSelection();
402  }
403 
405  {
406  QModelIndex proxy_model_index = mContextTreeView->currentIndex();
407  QModelIndex source_model_index = mContextTreeProxyModel->mapToSource(proxy_model_index);
408 
409  return mContextTreeModel->getContext(source_model_index);
410  }
411 
413  {
414  QModelIndex proxy_model_index = mContextTreeView->currentIndex();
415  QModelIndex source_model_index = mContextTreeProxyModel->mapToSource(proxy_model_index);
416 
417  BaseTreeItem* currentItem = mContextTreeModel->getItemFromIndex(source_model_index);
418  if (currentItem != mContextTreeModel->getRootItem())
419  return static_cast<ContextTreeItem*>(currentItem);
420 
421  return nullptr;
422  }
423 
425  {
426  toolbar->addAction(mNewDirectoryAction);
427  toolbar->addAction(mNewViewAction);
428  toolbar->addAction(mOpenAction);
429  toolbar->addAction(mDuplicateAction);
430  toolbar->addAction(mRenameAction);
431  toolbar->addAction(mDeleteAction);
432  toolbar->addAction(mSearchAction);
433  }
434 
436  {
437  QString iconStyle = enable ? mSearchIconStyle : mDisabledIconStyle;
439  if (!enable && mSearchbar->isVisible())
440  {
441  mSearchbar->hide();
442  setFocus();
443  }
445  }
446 
447  void ContextManagerWidget::setToolbarButtonsEnabled(bool enabled)
448  {
449  mOpenAction->setEnabled(enabled);
450  mRenameAction->setEnabled(enabled);
451  mDuplicateAction->setEnabled(enabled);
452  mDeleteAction->setEnabled(enabled);
453 
454  if(enabled)
455  {
456  mOpenAction->setIcon(gui_utility::getStyledSvgIcon(mOpenIconStyle, mOpenIconPath));
457  mRenameAction->setIcon(gui_utility::getStyledSvgIcon(mRenameIconStyle, mRenameIconPath));
458  mDuplicateAction->setIcon(gui_utility::getStyledSvgIcon(mDuplicateIconStyle, mDuplicateIconPath));
459  mDeleteAction->setIcon(gui_utility::getStyledSvgIcon(mDeleteIconStyle, mDeleteIconPath));
460  }
461  else
462  {
463  mOpenAction->setIcon(gui_utility::getStyledSvgIcon(mDisabledIconStyle, mOpenIconPath));
464  mRenameAction->setIcon(gui_utility::getStyledSvgIcon(mDisabledIconStyle, mRenameIconPath));
465  mDuplicateAction->setIcon(gui_utility::getStyledSvgIcon(mDisabledIconStyle, mDuplicateIconPath));
466  mDeleteAction->setIcon(gui_utility::getStyledSvgIcon(mDisabledIconStyle, mDeleteIconPath));
467  }
468  }
469 
470  QList<QShortcut*> ContextManagerWidget::createShortcuts()
471  {
474 
475  QList<QShortcut*> list;
476  list.append(mSearchShortcut);
477 
478  return list;
479  }
480 
481  void ContextManagerWidget::toggleSearchbar()
482  {
483  if (!mSearchAction->isEnabled())
484  return;
485 
486  if (mSearchbar->isHidden())
487  {
488  mSearchbar->show();
489  mSearchbar->setFocus();
490  }
491  else
492  {
493  mSearchbar->hide();
494  setFocus();
495  }
496  }
497 
499  {
500  return mDisabledIconStyle;
501  }
502 
504  {
505  return mNewViewIconPath;
506  }
507 
509  {
510  return mNewDirIconPath;
511  }
512 
514  {
515  return mNewViewIconStyle;
516  }
517 
519  {
520  return mRenameIconPath;
521  }
522 
524  {
525  return mRenameIconStyle;
526  }
527 
529  {
530  return mDuplicateIconPath;
531  }
532 
534  {
535  return mDuplicateIconStyle;
536  }
537 
539  {
540  return mDeleteIconPath;
541  }
542 
544  {
545  return mDeleteIconStyle;
546  }
547 
549  {
550  return mOpenIconPath;
551  }
552 
554  {
555  return mOpenIconStyle;
556  }
557 
559  {
560  return mSearchIconPath;
561  }
562 
564  {
565  return mSearchIconStyle;
566  }
567 
569  {
570  return mSearchActiveIconStyle;
571  }
572 
574  {
575  mDisabledIconStyle = style;
576  }
577 
579  {
580  mNewViewIconPath = path;
581  }
582 
584  {
585  mNewDirIconPath = path;
586  }
587 
589  {
590  mNewViewIconStyle = style;
591  }
592 
594  {
595  mRenameIconPath = path;
596  }
597 
599  {
600  mRenameIconStyle = style;
601  }
602 
604  {
605  mDuplicateIconPath = path;
606  }
607 
609  {
610  mDuplicateIconStyle = style;
611  }
612 
614  {
615  mDeleteIconPath = path;
616  }
617 
619  {
620  mDeleteIconStyle = style;
621  }
622 
624  {
625  mOpenIconPath = path;
626  }
627 
629  {
630  mOpenIconStyle = style;
631  }
632 
634  {
635  mSearchIconPath = path;
636  }
637 
639  {
640  mSearchIconStyle = style;
641  }
642 
644  {
645  mSearchActiveIconStyle = style;
646  }
647 
648  void ContextManagerWidget::handleFocusChanged(QWidget* oldWidget, QWidget* newWidget)
649  {
650  Q_UNUSED(oldWidget);
651  if(!newWidget) return;
652  if(newWidget->parent() == this)
653  {
654  mShortCutDeleteItem->setEnabled(true);
655  return;
656  }
657  else
658  {
659  mShortCutDeleteItem->setEnabled(false);
660  return;
661  }
662  }
663 }
Adds an item to a module or grouping.
(Future) Base class for all tree models related to the details widget.
QModelIndex getIndexFromItem(BaseTreeItem *item) const
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
BaseTreeItem * getRootItem() const
BaseTreeItem * getItemFromIndex(QModelIndex index) const
static SettingsItemKeybind * sSettingDeleteItem
Abstract class for Widgets within HAL's ContentArea.
QKeySequence mSearchKeysequence
QShortcut * mSearchShortcut
QVBoxLayout * mContentLayout
void setDuplicateIconStyle(const QString &style)
void selectViewContext(GraphContext *context)
void setSearchIconStyle(const QString &style)
void setRenameIconPath(const QString &path)
void setOpenIconPath(const QString &path)
void handleItemClicked(const QModelIndex &proxyIndex)
void setDeleteIconPath(const QString &path)
void handleItemDoubleClicked(const QModelIndex &proxyIndex)
ContextManagerWidget(GraphTabWidget *tab_view, QWidget *parent=nullptr)
void setDuplicateIconPath(const QString &path)
void setNewDirIconPath(const QString &path)
void setSearchActiveIconStyle(const QString &style)
void setRenameIconStyle(const QString &style)
void setDisabledIconStyle(const QString &path)
void setNewViewIconStyle(const QString &style)
void setOpenIconStyle(const QString &style)
void setNewViewIconPath(const QString &path)
void setSearchIconPath(const QString &path)
void setDeleteIconStyle(const QString &style)
virtual void setupToolbar(Toolbar *toolbar) override
void selectDirectory(ContextTreeItem *item)
void handleRowsInserted(const QModelIndex &parent, int first, int last)
A proxy model to filter the ContextTableModel by a given string.
void startSearch(QString text, int options) override
GraphContext * context() const
ContextDirectory * directory() const
void setCurrentDirectory(ContextTreeItem *currentItem)
void directoryCreatedSignal(ContextTreeItem *item)
QModelIndex getIndexFromContext(GraphContext *context) const
BaseTreeItem * getContext(u32 contextId) const
Checks if a given string is not empty.
Logical container for modules, gates, and nets.
Definition: graph_context.h:55
void setExclusiveModuleId(u32 id, bool emitSignal=true)
QString name() const
ContextTreeModel * getContextTreeModel() const
QVector< GraphContext * > getContexts() const
A ContentWidget that holds all GraphWidget objects (GraphView) as tabs of a QTabWidget.
void showContext(GraphContext *context)
Generic input dialog for user input.
Definition: input_dialog.h:51
void setInfoText(const QString &text)
void setInputText(const QString &text)
void addValidator(Validator *Validator)
QString textValue() const
std::string get_name() const
Definition: module.cpp:88
Module * get_top_module() const
Definition: netlist.cpp:610
virtual QList< QString > getColumnNames()
A QFrame with a QLineEdit that can be used to input a substring to search for.
Definition: searchbar.h:48
bool filterApplied()
Definition: searchbar.cpp:259
void setColumnNames(QList< QString > list)
Definition: searchbar.cpp:130
void triggerNewSearch(const QString &text, int searchOptions)
void keySequenceChanged(QKeySequence value)
Toolbar for all ContentFrames and ContentWidgets.
Definition: toolbar.h:39
Checks if a given string is unique compared to other given strings.
void addAction(UserAction *act)
virtual void setObject(const UserActionObject &obj)
Definition: user_action.cpp:32
The UserActionObject class represents a single object used in UserAction.
QIcon getStyledSvgIcon(const QString &from_to_colors_enabled, const QString &svg_path, QString from_to_colors_disabled=QString())
Definition: graphics.cpp:60
Definition: defines.h:45
GraphContextManager * gGraphContextManager
Definition: plugin_gui.cpp:86
Netlist * gNetlist
Definition: gui_globals.h:69
void rowsInserted(const QModelIndex &parent, int first, int last)
void rowsRemoved(const QModelIndex &parent, int first, int last)
void clicked(const QModelIndex &index)
QModelIndex currentIndex() const const
void doubleClicked(const QModelIndex &index)
void setDragEnabled(bool enable)
void setSelectionBehavior(QAbstractItemView::SelectionBehavior behavior)
void setSelectionMode(QAbstractItemView::SelectionMode mode)
QItemSelectionModel * selectionModel() const const
void setCurrentIndex(const QModelIndex &index)
void setDropIndicatorShown(bool enable)
QWidget * viewport() const const
void setEnabled(bool)
void setIcon(const QIcon &icon)
void setText(const QString &text)
void setToolTip(const QString &tip)
void trigger()
void triggered(bool checked)
void focusChanged(QWidget *old, QWidget *now)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
virtual int exec()
void sectionClicked(int logicalIndex)
void setSortIndicator(int logicalIndex, Qt::SortOrder order)
void setSortIndicatorShown(bool show)
QString getText(QWidget *parent, const QString &title, const QString &label, QLineEdit::EchoMode mode, const QString &text, bool *ok, Qt::WindowFlags flags, Qt::InputMethodHints inputMethodHints)
bool hasSelection() const const
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
void append(const T &value)
QMap::iterator begin()
QMap::iterator end()
QMap::iterator insert(const Key &key, const T &value)
QAction * addAction(const QString &text)
QAction * exec()
QMessageBox::StandardButton information(QWidget *parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
bool isValid() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const const
void activated()
void setEnabled(bool enable)
void setKey(const QKeySequence &key)
virtual QModelIndex mapFromSource(const QModelIndex &sourceIndex) const const override
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const const override
virtual int rowCount(const QModelIndex &parent) const const override
virtual void setSourceModel(QAbstractItemModel *sourceModel) override
void setSortRole(int role)
QString fromStdString(const std::string &str)
bool isEmpty() const const
UserRole
AscendingOrder
QAction * addAction(const QString &text)
void expand(const QModelIndex &index)
QHeaderView * header() const const
virtual QModelIndex indexAt(const QPoint &point) const const override
virtual void setModel(QAbstractItemModel *model) override
void setSortingEnabled(bool enable)
void setAcceptDrops(bool on)
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
void customContextMenuRequested(const QPoint &pos)
void ensurePolished() const const
void hide()
bool isHidden() const const
QPoint mapToGlobal(const QPoint &pos) const const
void setFocus()
void show()
void setSizePolicy(QSizePolicy)
QStyle * style() const const
bool isVisible() const const
void setWindowTitle(const QString &)