本文整理汇总了C++中ITable::getAll方法的典型用法代码示例。如果您正苦于以下问题:C++ ITable::getAll方法的具体用法?C++ ITable::getAll怎么用?C++ ITable::getAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITable
的用法示例。
在下文中一共展示了ITable::getAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getForm
UserModelEditor::UserModelEditor() : ModelEntityEditor< ::Model::User >() {
// Remove unsed widget
getForm()->removeWidget("id");
getForm()->removeWidget("created_at");
getForm()->removeWidget("last_access");
getForm()->removeWidget("puppetftp_role");
getForm()->removeWidget("passwd");
// Set label
getForm()->getWidget("firstname")->setLabel("First Name");
getForm()->getWidget("lastname")->setLabel("Last Name");
getForm()->getWidget("email")->setLabel("Email");
// Add custom attribute
getForm()->getWidget("email")->setAttribute("autocomplete", "off");
// Get role
ITable* table = DatabaseManager::instance()->getTable("puppetftp_role");
if (table == NULL) {
// rediriger ou gérer le cas d'erreur
}
QList<QObject*> roles = table->getAll();
// Create custom widget
InputChoice* selectRole = new InputChoice("puppetftp_role", InputChoice::SELECT);
selectRole->setLabel("Role");
for (QList<QObject*>::const_iterator it = roles.begin(); it != roles.end(); it++) {
Model::Role* role = dynamic_cast<Model::Role*>(*it);
selectRole->addOption(QString::number(role->getId()), role->getName());
}
getForm()->addWidget("editor", selectRole);
Input* password = new Input("passwd", Input::PASSWORD);
password->setLabel("Password");
password->setAttribute("autocomplete", "off");
getForm()->addWidget("editor", password);
roles.clear();
delete table;
}
示例2: process
void ServerListProcessor::process(HTTPRequest& request) {
Session* s = SessionManager::instance()->getSession(request.getSessionId());
addNotify(s->getNotification("edit"));
ITable* object = DatabaseManager::instance()->getTable("server");
if (object == 0) {
s->setNotification("listing", "Entity 'server' doesn't exists.", UI::Notify::ERROR);
request.redirect("index");
return;
}
_table = UI::ModelWidgetFactory::instance()->getListWidget("serverConfigurationList");
if (_table == NULL) {
s->setNotification("listing", "Model Entity List 'serverConfiguration' doesn't exists.", UI::Notify::ERROR);
request.redirect("index");
} else {
_table->fill(object->getAll());
}
delete object;
}