286 const QModelIndex index = iv->indexAt(event->position().toPoint());
287 if (!index.isValid()) {
292 if (!handleImageDragEnterMoveEvent(event))
295 am->dropMimeData(event->mimeData(), event->proposedAction(), index.row(), 0, iv->rootIndex());
320 setDragEnabled(
true);
321 setAcceptDrops(
true);
322 setDropIndicatorShown(
true);
323 setDragDropMode(DragDrop);
325 setRootIsDecorated(
false);
326 setTextElideMode(Qt::ElideMiddle);
329 connect(
this, &QTreeView::activated,
this, &ActionTreeView::slotActivated);
330 connect(header(), &QHeaderView::sectionDoubleClicked,
331 this, &QTreeView::resizeColumnToContents);
333 setIconSize(QSize(listModeIconSize, listModeIconSize));
344 const int rowCount = m_model->rowCount();
345 const bool empty = text.isEmpty();
346 const QModelIndex parent = rootIndex();
347 for (
int i = 0; i < rowCount; i++)
348 setRowHidden(i, parent, !empty && !m_model->actionName(i).contains(text, Qt::CaseInsensitive));
400 setDragEnabled(
true);
401 setAcceptDrops(
true);
402 setDropIndicatorShown(
true);
403 setDragDropMode(DragDrop);
405 setTextElideMode(Qt::ElideMiddle);
406 connect(
this, &QListView::activated,
this, &ActionListView::slotActivated);
414 setViewMode(IconMode);
415 setIconSize(QSize(iconModeIconSize, iconModeIconSize));
416 setGridSize(QSize(4 * iconModeIconSize, 2 * iconModeIconSize));
417 setSpacing(iconModeIconSize / 3);
479 QStackedWidget(parent),
480 m_model(
new ActionModel(
this)),
481 m_actionTreeView(
new ActionTreeView(m_model)),
482 m_actionListView(
new ActionListView(m_model))
484 addWidget(m_actionListView);
485 addWidget(m_actionTreeView);
487 connect(m_actionTreeView, &ActionTreeView::actionContextMenuRequested,
488 this, &ActionView::contextMenuRequested);
489 connect(m_actionListView, &ActionListView::actionContextMenuRequested,
490 this, &ActionView::contextMenuRequested);
494 connect(m_actionListView, &ActionListView::actionActivated,
495 this, [
this](QAction *a) {
this->activated(a, -1); });
496 connect(m_actionTreeView, &ActionTreeView::actionActivated,
this, &ActionView::activated);
498 connect(m_actionListView, &ActionListView::currentActionChanged,
499 this, &ActionView::slotCurrentChanged);
500 connect(m_actionTreeView, &ActionTreeView::currentActionChanged,
501 this, &ActionView::slotCurrentChanged);
503 connect(m_model, &ActionModel::resourceImageDropped,
504 this, &ActionView::resourceImageDropped);
507 QItemSelectionModel *selectionModel = m_actionTreeView->selectionModel();
508 m_actionListView->setSelectionModel(selectionModel);
509 connect(selectionModel, &QItemSelectionModel::selectionChanged,
510 this, &ActionView::selectionChanged);