本文整理汇总了C++中ExplorerCollectionTreeItem类的典型用法代码示例。如果您正苦于以下问题:C++ ExplorerCollectionTreeItem类的具体用法?C++ ExplorerCollectionTreeItem怎么用?C++ ExplorerCollectionTreeItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ExplorerCollectionTreeItem类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ui_viewIndex
void ExplorerCollectionDirIndexesTreeItem::ui_viewIndex()
{
ExplorerCollectionTreeItem *par = dynamic_cast<ExplorerCollectionTreeItem *>(parent());
if (par) {
par->openCurrentCollectionShell("getIndexes()");
}
}
示例2: ui_itemDoubleClicked
void ExplorerWidget::ui_itemDoubleClicked(QTreeWidgetItem *item, int column)
{
ExplorerCollectionTreeItem *collectionItem = dynamic_cast<ExplorerCollectionTreeItem *>(item);
if (collectionItem) {
AppRegistry::instance().app()->openShell(collectionItem->collection());
}
}
示例3: ui_refreshIndex
void ExplorerCollectionDirIndexesTreeItem::ui_refreshIndex()
{
ExplorerCollectionTreeItem *par = dynamic_cast<ExplorerCollectionTreeItem *>(parent());
if (par) {
par->expand();
}
}
示例4: ui_dropIndex
void ExplorerCollectionDirIndexesTreeItem::ui_dropIndex()
{
ExplorerCollectionTreeItem *par = dynamic_cast<ExplorerCollectionTreeItem *>(parent());
if (par) {
par->openCurrentCollectionShell("dropIndex({ \"<field>\" : 1 });", false);
}
}
示例5: selectedCollectionItem
void ExplorerTreeWidget::ui_renameCollection()
{
ExplorerCollectionTreeItem *collectionItem = selectedCollectionItem();
if (!collectionItem)
return;
MongoCollection *collection = collectionItem->collection();
MongoDatabase *database = collection->database();
MongoServer *server = database->server();
ConnectionSettings *settings = server->connectionRecord();
CreateDatabaseDialog dlg(settings->getFullAddress(),
database->name(),
collection->name());
dlg.setWindowTitle("Rename Collection");
dlg.setOkButtonText("&Rename");
dlg.setInputLabelText("New Collection Name:");
dlg.setInputText(collection->name());
int result = dlg.exec();
if (result == QDialog::Accepted) {
database->renameCollection(collection->name(), dlg.databaseName());
// refresh list of collections
database->loadCollections();
}
}
示例6: ui_reIndex
void ExplorerCollectionDirIndexesTreeItem::ui_reIndex()
{
ExplorerCollectionTreeItem *par = dynamic_cast<ExplorerCollectionTreeItem *>(parent());
if (par) {
par->openCurrentCollectionShell("reIndex()", false);
}
}
示例7: ui_itemClicked
void ExplorerWidget::ui_itemClicked(QTreeWidgetItem *item, int cloumn)
{
if (!AppRegistry::instance().settingsManager()->useTabbar()) {
ExplorerCollectionTreeItem *collectionItem = dynamic_cast<ExplorerCollectionTreeItem *>(item);
if (collectionItem) {
AppRegistry::instance().app()->openShell(collectionItem->collection());
}
}
}
示例8: ui_addIndex
void ExplorerCollectionDirIndexesTreeItem::ui_addIndex()
{
ExplorerCollectionTreeItem *par = dynamic_cast<ExplorerCollectionTreeItem *>(parent());
if (par) {
par->openCurrentCollectionShell(
"ensureIndex({ \"<field>\" : 1 }); \n"
"\n"
"// options: \n"
"// { unique : true } - A unique index causes MongoDB to reject all documents that contain a duplicate value for the indexed field. \n"
"// { sparse : true } - Sparse indexes only contain entries for documents that have the indexed field. \n"
"// { dropDups : true } - Sparse indexes only contain entries for documents that have the indexed field. \n"
, false);
}
}
示例9: ui_addIndexGui
void ExplorerCollectionDirIndexesTreeItem::ui_addIndexGui()
{
ExplorerCollectionTreeItem *par = dynamic_cast<ExplorerCollectionTreeItem *const>(parent());
if (!par)
return;
EnsureIndexInfo fakeInfo(par->collection()->info(),"");
EditIndexDialog dlg(fakeInfo , QtUtils::toQString(par->databaseItem()->database()->name()),QtUtils::toQString(par->databaseItem()->database()->server()->connectionRecord()->getFullAddress()), treeWidget());
int result = dlg.exec();
if (result != QDialog::Accepted)
return;
ExplorerDatabaseTreeItem *databaseTreeItem = static_cast<ExplorerDatabaseTreeItem *>(par->databaseItem());
if (!databaseTreeItem)
return;
databaseTreeItem->enshureIndex(par,fakeInfo, dlg.info());
}