本文整理汇总了C++中QObjectList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ QObjectList::push_back方法的具体用法?C++ QObjectList::push_back怎么用?C++ QObjectList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QObjectList
的用法示例。
在下文中一共展示了QObjectList::push_back方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetComponentsRaw
QObjectList Entity::GetComponentsRaw(const QString &type_name) const
{
QObjectList ret;
if (type_name.isNull())
for(size_t i = 0; i < components_.size() ; ++i)
ret.push_back(components_[i].get());
else
for(size_t i = 0; i < components_.size() ; ++i)
if (components_[i]->TypeName() == type_name)
ret.push_back(components_[i].get());
return ret;
}
示例2: GetComponentsRaw
QObjectList Entity::GetComponentsRaw(const QString &type_name) const
{
LogWarning("Entity::GetComponentsRaw: This function is deprecated and will be removed. Use GetComponents or Components instead.");
QObjectList ret;
if (type_name.isNull())
for (ComponentMap::const_iterator i = components_.begin(); i != components_.end(); ++i)
ret.push_back(i->second.get());
else
for (ComponentMap::const_iterator i = components_.begin(); i != components_.end(); ++i)
if (i->second->TypeName() == type_name)
ret.push_back(i->second.get());
return ret;
}
示例3: loadAll
QObjectList loadAll(NodeObjectMap &map) {
Nodes nodes;
Triples candidates = m_s->match(Triple(Node(), Uri("a"), Node()));
foreach (Triple t, candidates) {
if (t.c.type != Node::URI) continue;
nodes.push_back(t.a);
}
LoadState state;
state.requested = nodes;
state.map = map;
state.loadFlags = LoadState::IgnoreUnknownTypes;
collect(state);
load(state);
map = state.map;
QObjectList objects;
foreach (Node n, nodes) {
QObject *o = map.value(n);
if (o) objects.push_back(o);
}
示例4: getBodies
QObjectList WorldModel::getBodies() const
{
QObjectList bodies;
foreach (QBodyDef* qbody, bodyList_)
bodies.push_back(qbody);
return bodies;
}