FSModel::FSModel (QObject *parent) : QFileSystemModel (parent) { setIconProvider (new FSIconProvider); setSupportedDragActions (Qt::CopyAction); }
KPrSlidesSorterDocumentModel::KPrSlidesSorterDocumentModel(KPrViewModeSlidesSorter *viewModeSlidesSorter, QWidget *parent, KoPADocument *document) : QAbstractListModel(parent) , m_viewModeSlidesSorter(viewModeSlidesSorter) { setDocument(document); setSupportedDragActions(Qt::MoveAction); }
ProxyModel::ProxyModel(QObject *parent) : QSortFilterProxyModel(parent), m_filterMode(NoFilter), m_sortDirsFirst(true), m_parseDesktopFiles(false), m_patternMatchAll(true) { setSupportedDragActions(Qt::CopyAction | Qt::MoveAction | Qt::LinkAction); }
cceMaterialEffectTreeModel::cceMaterialEffectTreeModel (cceMaterialManager* mgr) : QAbstractItemModel () , _mgr (mgr) { connect (_mgr, SIGNAL(EffectAdded (cceMaterialEffect*)), this, SLOT(ResetContent ())); connect (_mgr, SIGNAL(EffectChanged (cceMaterialEffect*)), this, SLOT(ResetContent ())); connect (_mgr, SIGNAL(EffectRemoved (cceMaterialEffect*)), this, SLOT(ResetContent ())); setSupportedDragActions (Qt::ActionMask); }
RetroshareDirModel::RetroshareDirModel(bool mode, QObject *parent) : QAbstractItemModel(parent), ageIndicator(IND_ALWAYS), RemoteMode(mode), nIndex(1), indexSet(1) /* ass zero index cant be used */ { _visible = false ; _needs_update = true ; setSupportedDragActions(Qt::CopyAction); treeStyle(); }
MealModel::MealModel(int meal, QObject *parent) : QSqlRelationalTableModel(parent), meal(meal) { setTable("menu"); setRelation(2, QSqlRelation("recipes", "id", "name")); setFilter(QString("meal='%1'").arg(meal)); sort(2, Qt::AscendingOrder); select(); setSupportedDragActions(Qt::MoveAction); }
toResultModelEdit::toResultModelEdit(toEventQuery *query, QList<QString> priKeys, QObject *parent, bool read) : toResultModel(query, parent, read) , PriKeys(priKeys) { #if QT_VERSION < 0x050000 setSupportedDragActions(Qt::CopyAction | Qt::MoveAction); #endif }
RetroshareDirModel::RetroshareDirModel(bool mode, QObject *parent) : QAbstractItemModel(parent), ageIndicator(IND_ALWAYS), RemoteMode(mode), nIndex(1), indexSet(1) /* ass zero index cant be used */ { _visible = false ; #if QT_VERSION < QT_VERSION_CHECK (5, 0, 0) setSupportedDragActions(Qt::CopyAction); #endif treeStyle(); }
NavTagItemModel::NavTagItemModel(QObject *parent) : TagItemModel(parent) { #if QT_VERSION < 0x050000 setSupportedDragActions(Qt::CopyAction|Qt::MoveAction); #endif m_navigationActions = 0; connect(GTagMgr(), SIGNAL(bookmarksChanged(TagItem*)), this, SLOT(tagMgr_dataChanged(TagItem*))); }
TrialTreeModel::TrialTreeModel(QObject *parent) : QStandardItemModel(parent) { // appendRow(new QStandardItem("Test 1")); // appendRow(new QStandardItem("Test 2")); // appendRow(new QStandardItem("Test 3")); setColumnCount(1); setHeaderData(0, Qt::Horizontal, "Maze File"); #if QT_VERSION < 0x050000 setSupportedDragActions(Qt::MoveAction); #endif }
ModItemsTree::ModItemsTree(ModLoader* modLoader,MOomc* moomc,QObject *parent) : QAbstractItemModel(parent) { _modLoader = modLoader; _moomc = moomc; _rootElement = new ModItem(_moomc); _enabled = true; _showComponents = false; setSupportedDragActions(Qt::CopyAction | Qt::MoveAction); }
NavigatorTreeModel::NavigatorTreeModel(QObject *parent) : QStandardItemModel(parent), m_blockItemChangedSignal(false) { invisibleRootItem()->setFlags(Qt::ItemIsDropEnabled); #ifdef _LOCK_ITEMS_ setColumnCount(3); #else setColumnCount(2); #endif setSupportedDragActions(Qt::LinkAction); connect(this, SIGNAL(itemChanged(QStandardItem*)), this, SLOT(handleChangedItem(QStandardItem*))); }
FolderModel::FolderModel(QObject *parent) : QSortFilterProxyModel(parent), m_dirWatch(nullptr), m_dragInProgress(false), m_previewGenerator(0), m_viewAdapter(0), m_actionCollection(this), m_newMenu(0), m_fileItemActions(0), m_usedByContainment(false), m_locked(true), m_sortMode(0), m_sortDesc(false), m_sortDirsFirst(true), m_parseDesktopFiles(false), m_previews(false), m_filterMode(NoFilter), m_filterPatternMatchAll(true) { DirLister *dirLister = new DirLister(this); dirLister->setDelayedMimeTypes(true); dirLister->setAutoErrorHandlingEnabled(false, 0); connect(dirLister, &DirLister::error, this, &FolderModel::dirListFailed); connect(dirLister, &KCoreDirLister::itemsDeleted, this, &FolderModel::evictFromIsDirCache); m_dirModel = new KDirModel(this); m_dirModel->setDirLister(dirLister); m_dirModel->setDropsAllowed(KDirModel::DropOnDirectory | KDirModel::DropOnLocalExecutable); m_selectionModel = new QItemSelectionModel(this, this); connect(m_selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged(QItemSelection,QItemSelection))); setSourceModel(m_dirModel); setSortLocaleAware(true); setFilterCaseSensitivity(Qt::CaseInsensitive); setDynamicSortFilter(true); sort(m_sortMode, m_sortDesc ? Qt::DescendingOrder : Qt::AscendingOrder); setSupportedDragActions(Qt::CopyAction | Qt::MoveAction | Qt::LinkAction); createActions(); }
toResultModel::toResultModel(toEventQuery *query, QObject *parent, bool read) : QAbstractTableModel(parent) , Query(NULL) , SortedOnColumn(-1) , SortedOrder(Qt::AscendingOrder) , CurrRowKey(1) , ReadableColumns(read) , First(true) , HeadersRead(false) , ReadAll(false) { MaxRowsToAdd = MaxRows = toConfigurationNewSingle::Instance().option(ToConfiguration::Database::InitialFetchInt).toInt(); Query = query; Query->setParent(this); // this will satisfy QObject's disposal connect(query, SIGNAL(descriptionAvailable(toEventQuery*)), this, SLOT(slotReadHeaders(toEventQuery*))); connect(query, SIGNAL(dataAvailable(toEventQuery*)), this, SLOT(slotFetchMore(toEventQuery*))); connect(query, SIGNAL(error(toEventQuery*, const toConnection::exception &)), this, SLOT(slotQueryError(toEventQuery*, const toConnection::exception &))); // TODO done -> slotFetchMore ?????? connect(query, SIGNAL(done(toEventQuery*)), this, SLOT(slotFetchMore(toEventQuery*))); #if QT_VERSION < 0x050000 setSupportedDragActions(Qt::CopyAction); #endif }
KPrCollectionItemModel::KPrCollectionItemModel(QObject* parent) : QAbstractListModel(parent) { setSupportedDragActions(Qt::IgnoreAction); }
CollectionItemModel::CollectionItemModel(QObject* parent) : QAbstractListModel(parent), m_viewMode(QListView::IconMode) { setSupportedDragActions(Qt::CopyAction); }
ccDBRoot::ccDBRoot(ccCustomQTreeView* dbTreeWidget, QTreeView* propertiesTreeWidget, QObject* parent) : QAbstractItemModel(parent) { m_treeRoot = new ccHObject("DB Tree"); //DB Tree assert(dbTreeWidget); m_dbTreeWidget = dbTreeWidget; m_dbTreeWidget->setModel(this); m_dbTreeWidget->header()->hide(); //drag & drop support m_dbTreeWidget->setDragEnabled(true); m_dbTreeWidget->setAcceptDrops(true); //m_dbTreeWidget->viewport()->setAcceptDrops(true); m_dbTreeWidget->setDropIndicatorShown(true); m_dbTreeWidget->setDragDropMode(QAbstractItemView::InternalMove); setSupportedDragActions(Qt::MoveAction); /*//already done in ui file! m_dbTreeWidget->setEditTriggers(QAbstractItemView::EditKeyPressed); m_dbTreeWidget->setDragDropMode(QAbstractItemView::InternalMove); m_dbTreeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); m_dbTreeWidget->setUniformRowHeights(true); //*/ //context menu on DB tree elements m_dbTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); m_expandBranch = new QAction("Expand branch",this); m_collapseBranch = new QAction("Collapse branch",this); m_gatherInformation = new QAction("Information (recursive)",this); m_sortSiblingsType = new QAction("Sort siblings by type",this); m_sortSiblingsAZ = new QAction("Sort siblings by name (A-Z)",this); m_sortSiblingsZA = new QAction("Sort siblings by name (Z-A)",this); m_deleteSelectedEntities = new QAction("Delete",this); m_toggleSelectedEntities = new QAction("Toggle",this); m_toggleSelectedEntitiesVisibility = new QAction("Toggle visibility",this); m_toggleSelectedEntitiesColor = new QAction("Toggle color",this); m_toggleSelectedEntitiesNormals = new QAction("Toggle normals",this); m_toggleSelectedEntitiesMat = new QAction("Toggle materials/textures",this); m_toggleSelectedEntitiesSF = new QAction("Toggle SF",this); m_toggleSelectedEntities3DName = new QAction("Toggle 3D name",this); m_addEmptyGroup = new QAction("Add empty group",this); m_alignCameraWithEntity = new QAction("Align camera",this); m_alignCameraWithEntityReverse = new QAction("Align camera (reverse)",this); m_contextMenuPos = QPoint(-1,-1); //connect custom context menu actions connect(m_dbTreeWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showContextMenu(const QPoint&))); connect(m_expandBranch, SIGNAL(triggered()), this, SLOT(expandBranch())); connect(m_collapseBranch, SIGNAL(triggered()), this, SLOT(collapseBranch())); connect(m_gatherInformation, SIGNAL(triggered()), this, SLOT(gatherRecursiveInformation())); connect(m_sortSiblingsAZ, SIGNAL(triggered()), this, SLOT(sortSiblingsAZ())); connect(m_sortSiblingsZA, SIGNAL(triggered()), this, SLOT(sortSiblingsZA())); connect(m_sortSiblingsType, SIGNAL(triggered()), this, SLOT(sortSiblingsType())); connect(m_deleteSelectedEntities, SIGNAL(triggered()), this, SLOT(deleteSelectedEntities())); connect(m_toggleSelectedEntities, SIGNAL(triggered()), this, SLOT(toggleSelectedEntities())); connect(m_toggleSelectedEntitiesVisibility, SIGNAL(triggered()), this, SLOT(toggleSelectedEntitiesVisibility())); connect(m_toggleSelectedEntitiesColor, SIGNAL(triggered()), this, SLOT(toggleSelectedEntitiesColor())); connect(m_toggleSelectedEntitiesNormals, SIGNAL(triggered()), this, SLOT(toggleSelectedEntitiesNormals())); connect(m_toggleSelectedEntitiesMat, SIGNAL(triggered()), this, SLOT(toggleSelectedEntitiesMat())); connect(m_toggleSelectedEntitiesSF, SIGNAL(triggered()), this, SLOT(toggleSelectedEntitiesSF())); connect(m_toggleSelectedEntities3DName, SIGNAL(triggered()), this, SLOT(toggleSelectedEntities3DName())); connect(m_addEmptyGroup, SIGNAL(triggered()), this, SLOT(addEmptyGroup())); connect(m_alignCameraWithEntity, SIGNAL(triggered()), this, SLOT(alignCameraWithEntityDirect())); connect(m_alignCameraWithEntityReverse, SIGNAL(triggered()), this, SLOT(alignCameraWithEntityIndirect())); //other DB tree signals/slots connection connect(m_dbTreeWidget->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)), this, SLOT(changeSelection(const QItemSelection&, const QItemSelection&))); //Properties Tree assert(propertiesTreeWidget); m_propertiesTreeWidget = propertiesTreeWidget; m_propertiesModel = new QStandardItemModel(0, 2, parent); /*//already done in ui file! m_propertiesTreeWidget->header()->hide(); m_propertiesTreeWidget->setSelectionMode(QAbstractItemView::NoSelection); m_propertiesTreeWidget->setAllColumnsShowFocus(true); //*/ m_ccPropDelegate = new ccPropertiesTreeDelegate(m_propertiesModel, m_propertiesTreeWidget); m_propertiesTreeWidget->setItemDelegate(m_ccPropDelegate); m_propertiesTreeWidget->setModel(m_propertiesModel); m_propertiesTreeWidget->header()->setResizeMode(QHeaderView::Interactive); m_propertiesTreeWidget->header()->setStretchLastSection(true); m_propertiesTreeWidget->setEnabled(false); //Properties tree signals/slots connection connect(m_ccPropDelegate, SIGNAL(ccObjectPropertiesChanged(ccHObject*)), this, SLOT(updateCCObject(ccHObject*))); connect(m_ccPropDelegate, SIGNAL(ccObjectAppearanceChanged(ccHObject*)), this, SLOT(redrawCCObject(ccHObject*))); connect(m_ccPropDelegate, SIGNAL(ccObjectAndChildrenAppearanceChanged(ccHObject*)), this, SLOT(redrawCCObjectAndChildren(ccHObject*))); }
LocalCollectionModel::LocalCollectionModel (QObject *parent) : QStandardItemModel { parent } { setSupportedDragActions (Qt::CopyAction); }
EntryModel::EntryModel(QObject* parent) : QAbstractTableModel(parent) , m_group(Q_NULLPTR) { setSupportedDragActions(Qt::MoveAction | Qt::CopyAction); }
TargetVariablesModel::TargetVariablesModel(QObject *parent) : QAbstractItemModel(parent) { setSupportedDragActions(Qt::CopyAction); }
toResultModel::toResultModel(const QString &owner, const QString &type, QObject *parent, bool read) : QAbstractTableModel(parent) , Query(NULL) , SortedOnColumn(-1) , SortedOrder(Qt::AscendingOrder) , CurrRowKey(1) , ReadableColumns(read) , First(true) , HeadersRead(false) , ReadAll(false) { MaxRowsToAdd = MaxRows = toConfigurationNewSingle::Instance().option(ToConfiguration::Database::InitialFetchInt).toInt(); #if QT_VERSION < 0x050000 setSupportedDragActions(Qt::CopyAction); #endif // Manually add two columns (first one will be invisible) // NOTE: If this function is used to display say table columns from the cache // it will have to be modified to set header dynamically according to type of // data displayed. struct HeaderDesc d; d.name = "#"; d.name_orig = d.name; d.align = Qt::AlignRight; d.datatype = "INT"; Headers.append(d); d.name = type + " name (cached)"; d.name_orig = type + " name"; d.align = Qt::AlignLeft; d.datatype = "CHAR"; Headers.append(d); HeadersRead = true; // Fetch list of objects from the cache QList<toCache::CacheEntry const*> tmp = toConnection::currentConnection(this).getCache().getEntriesInSchema(owner, type); beginInsertRows(QModelIndex(), 0, tmp.count()); // Convert list of objects to appropriate type toQueryAbstr::Row row; int counter = 1; for (QList<toCache::CacheEntry const*>::iterator i = tmp.begin(); i != tmp.end(); i++) { // For each row a mandatory rownumber integer should be added toRowDesc rowDesc; rowDesc.key = counter++; rowDesc.status = EXISTED; row.append(toQValue(rowDesc)); //row.append(toQValue(counter++)); // Copy all values of a record ////for (toCache::Row::iterator ii = (*i).begin(); ii != (*i).end(); ii++) ///{ /// row.append((*ii).toString()); ///} row.append((*i)->name.second); Rows.append(row); row.clear(); } endInsertRows(); }
CDocumentModel::CDocumentModel( CryptoDoc *doc ) : QAbstractTableModel( doc ) , d( doc ) { setSupportedDragActions( Qt::CopyAction ); }
LibraryModel::LibraryModel(QObject *parent): QStandardItemModel(parent) { setSupportedDragActions(Qt::CopyAction | Qt::MoveAction); searchPattern = ""; }