27 #include "../../datasource/explorer/DataSetGroupItem.h" 28 #include "../../datasource/explorer/DataSetCategoryGroupItem.h" 29 #include "../../datasource/explorer/DataSetItem.h" 45 m_isCategoryModel(true),
46 m_useCheckableItems(true)
48 this->setContextMenuPolicy(Qt::CustomContextMenu);
51 connect(
this, SIGNAL(
clicked(
const QModelIndex&)),
this, SLOT(
onItemClicked(
const QModelIndex&)));
53 connect(
this, SIGNAL(
entered(
const QModelIndex&)),
this, SLOT(
onItemEntered(
const QModelIndex&)));
54 connect(
this, SIGNAL(
pressed(
const QModelIndex&)),
this, SLOT(
onItemPressed(
const QModelIndex&)));
55 connect(
this, SIGNAL(customContextMenuRequested(
const QPoint&)),
this, SLOT(
customContextMenu(
const QPoint&)));
79 std::list<DataSetItem*> ditems;
81 QModelIndexList items = selectedIndexes();
83 for(QModelIndexList::iterator it = items.begin(); it != items.end(); ++it)
93 ditems.push_back(ditem);
101 QModelIndexList items = selectedIndexes();
103 for(QModelIndexList::iterator it = items.begin(); it != items.end(); ++it)
136 if(categoryItem !=
nullptr)
144 if(groupItem !=
nullptr)
166 QVariant value = item->
data(0, Qt::CheckStateRole);
178 if(categoryItem !=
nullptr)
188 QVariant value = item->
data(0, Qt::CheckStateRole);
200 if(groupItem !=
nullptr)
210 QVariant value = item->
data(0, Qt::CheckStateRole);
238 if(categoryItem !=
nullptr)
246 if(groupItem !=
nullptr)
267 if(categoryItem !=
nullptr)
275 if(groupItem !=
nullptr)
296 if(categoryItem !=
nullptr)
304 if(groupItem !=
nullptr)
311 QMenu *menu =
new QMenu(
"",
this);
313 QAction * organize =
new QAction(tr(
"Organize by category"), menu);
314 organize->setCheckable(
true);
317 organize->setChecked(
true);
320 menu->addAction(organize);
321 menu->exec(QCursor::pos());
335 QModelIndex idx = nmodel->index(0, 0);
339 if(m_isCategoryModel)
343 for(
int i = 0; i < item->children().size(); i++)
345 QModelIndex idxChild = nmodel->index(i, 0, idx);
A tree view for datasets of a data source.
static te::dt::Date ds(2010, 01, 01)
A simple model for datasets belonging to a data source.
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr