本文整理汇总了C++中PropertyList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ PropertyList::end方法的具体用法?C++ PropertyList::end怎么用?C++ PropertyList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyList
的用法示例。
在下文中一共展示了PropertyList::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: propertyToStream
void KWidgetStreamer::propertyToStream( const QObject* from, QDataStream& stream )
{
// Only handle widgets. Alternatives to widgets are layouts, validators, timers, etc.
if ( ! from->inherits("QWidget") )
return;
// Serializing all the children (if any).
const QObjectList* children = from->children();
if ( children ) {
stream << children->count();
for ( QObjectListIt it = QObjectListIt(*children); *it; ++it ) {
toStream( *it, stream );
}
}
else {
stream << (unsigned int) 0;
}
// Now stream out properties
for ( PropertyMapIt mapIt = _map.begin(); mapIt != _map.end(); mapIt++ ) {
QString tp = mapIt.key();
PropertyList list = mapIt.data();
if ( from->inherits( tp.latin1() ) ) {
for ( PropertyListIt it = list.begin(); it != list.end(); ++it ) {
QVariant prop = from->property( (*it).latin1() );
if ( ! prop.isValid() )
qWarning("Invalid property: %s:%s", tp.latin1(), (*it).latin1() );
stream << prop ;
}
}
}
}
示例2: propertyFromStream
void KWidgetStreamer::propertyFromStream( QDataStream& stream, QObject* to )
{
// Only handle widgets. Alternatives to widgets are layouts, validators, timers, etc.
if ( ! to->inherits("QWidget") )
return;
// Stream in all the children (if any)
const QObjectList* children = to->children();
unsigned int count;
stream >> count;
if ( children ) {
Q_ASSERT( count == children->count() );
for ( QObjectListIt it = QObjectListIt(*children); *it; ++it )
fromStream( stream, *it );
}
else {
Q_ASSERT( count == 0 );
}
// Now stream in properties
for ( PropertyMapIt mapIt = _map.begin(); mapIt != _map.end(); mapIt++ ) {
QString tp = mapIt.key();
PropertyList list = mapIt.data();
if ( to->inherits( tp.latin1() ) ) {
for ( PropertyListIt it = list.begin(); it != list.end(); ++it ) {
QVariant value;
stream >> value;
to->setProperty((*it).latin1(), value);
}
}
}
}
示例3: xmlFromWidgetBox
// Get XML for a new form from the widget box. Change objectName/geometry
// properties to be suitable for new forms
static QString xmlFromWidgetBox(const QDesignerFormEditorInterface *core, const QString &className, const QString &objectName)
{
typedef QList<DomProperty*> PropertyList;
QDesignerWidgetBoxInterface::Widget widget;
const bool found = QDesignerWidgetBox::findWidget(core->widgetBox(), className, QString(), &widget);
if (!found)
return QString();
QScopedPointer<DomUI> domUI(QDesignerWidgetBox::xmlToUi(className, widget.domXml(), false));
if (domUI.isNull())
return QString();
domUI->setAttributeVersion(QLatin1String("4.0"));
DomWidget *domWidget = domUI->elementWidget();
if (!domWidget)
return QString();
// Properties: Remove the "objectName" property in favour of the name attribute and check geometry.
domWidget->setAttributeName(objectName);
const QString geometryProperty = QLatin1String("geometry");
const QString objectNameProperty = QLatin1String("objectName");
PropertyList properties = domWidget->elementProperty();
for (PropertyList::iterator it = properties.begin(); it != properties.end(); ) {
DomProperty *property = *it;
if (property->attributeName() == objectNameProperty) { // remove "objectName"
it = properties.erase(it);
delete property;
} else {
if (property->attributeName() == geometryProperty) { // Make sure form is at least 400, 300
if (DomRect *geom = property->elementRect()) {
if (geom->elementWidth() < NewFormWidth)
geom->setElementWidth(NewFormWidth);
if (geom->elementHeight() < NewFormHeight)
geom->setElementHeight(NewFormHeight);
}
}
++it;
}
}
// Add a window title property
DomString *windowTitleString = new DomString;
windowTitleString->setText(objectName);
DomProperty *windowTitleProperty = new DomProperty;
windowTitleProperty->setAttributeName(QLatin1String("windowTitle"));
windowTitleProperty->setElementString(windowTitleString);
properties.push_back(windowTitleProperty);
// ------
domWidget->setElementProperty(properties);
// Embed in in DomUI and get string. Omit the version number.
domUI->setElementClass(objectName);
QString rc;
{ // Serialize domUI
QXmlStreamWriter writer(&rc);
writer.setAutoFormatting(true);
writer.setAutoFormattingIndent(1);
writer.writeStartDocument();
domUI->write(writer);
writer.writeEndDocument();
}
return rc;
}
示例4: populateList
void ModelerUserInterface::populateList(GroupProperty* group, Fl_Tree_Item* parent) {
// Create a tree node for this group.
Fl_Tree_Item* item;
if (parent == NULL) {
// HACK: We have to add and remove a fake list item so that the tree
// control will create a root node to put it under.
m_controlsTree->remove(m_controlsTree->add("You shouldn't see this."));
item = m_controlsTree->root();
item->label(group->getName());
} else {
item = m_controlsTree->add(parent, group->getName());
}
item->user_data(group);
// Examine the group's property list for group properties.
PropertyList* controls = group->getProperties();
for (PropertyList::iterator iter = controls->begin();
iter != controls->end();
iter++) {
// See if it's a GroupProperty by attempting to cast it
GroupProperty* childGroup = dynamic_cast<GroupProperty*>(*iter);
// If it is, add it to the list.
if (childGroup) {
ModelerUserInterface::populateList(childGroup, item);
}
}
}
示例5: GetParentSheet
//////////////////////////////////////////////////////////////////////////
// Page 2
//////////////////////////////////////////////////////////////////////////
LRESULT CDiskPropertyPage2::OnInitDialog(HWND /*hWndFocus*/, LPARAM /*lParam*/)
{
WTL::CString strCaption;
strCaption.LoadString(IDS_DISKPROPERTYPAGE_CAPTION);
GetParentSheet()->SetWindowText(strCaption);
CDiskObjectPtr disk = GetParentSheet()->GetDiskObject();
m_listProperty.SubclassWindow( GetDlgItem(IDC_LIST_PROPERTY) );
DWORD dwStyle = LVS_EX_FULLROWSELECT;
//| LVS_EX_GRIDLINES
//| LVS_EX_INFOTIP
m_listProperty.SetExtendedListViewStyle( dwStyle, dwStyle );
WTL::CString strCol[2];
strCol[0].LoadString( IDS_DISKPROPERTYPAGE_LIST_COL_NAME );
strCol[1].LoadString( IDS_DISKPROPERTYPAGE_LIST_COL_VALUE );
m_listProperty.InsertColumn( 0, strCol[0], LVCFMT_LEFT, 130, -1 );
m_listProperty.InsertColumn( 1, strCol[1], LVCFMT_LEFT, 200, -1 );
const CObjectUIHandler *phandler = CObjectUIHandler::GetUIHandler( disk );
PropertyList propList = phandler->GetPropertyList( disk );
PropertyList::iterator itr;
for ( itr = propList.begin(); itr != propList.end(); ++itr )
{
m_listProperty.InsertItem( itr->strName, itr->strValue, itr->strToolTip );
}
return 0;
}
示例6: selectAllQuery
QString Mapping::selectAllQuery() const {
Q_CHECK_PTR(table());
PropertyList pl = properties();
QStringList cn;
for (PropertyList::const_iterator it = pl.begin(); it != pl.end(); it++) {
cn << (*it)->tableColumn()->name();
}
return QString("SELECT %1 FROM %2").arg(cn.join(", ")).arg(table()->qualifiedName());
}
示例7: setProperties
void Entity::setProperties(const PropertyList& properties, bool replace) {
if (replace) {
m_propertyStore.clear();
setProperty(SpawnFlagsKey, "0");
}
PropertyList::const_iterator it, end;
for (it = properties.begin(), end = properties.end(); it != end; ++it)
setProperty(it->key(), it->value());
}
示例8: updateSupported
void Core::updateSupported(PropertyList added, PropertyList removed)
{
/// add the newly supported to master list
for(PropertyList::iterator itr = added.begin(); itr != added.end(); itr++)
{
if(ListPlusPlus<VehicleProperty::Property>(&added).contains(*itr))
{
mMasterPropertyList.push_back(*itr);
}
}
/// removed no longer supported properties from master list.
for(PropertyList::iterator itr = removed.begin(); itr != removed.end(); itr++)
{
ListPlusPlus<VehicleProperty::Property>(&mMasterPropertyList).removeOne(*itr);
}
/// tell all new sinks about the newly supported properties.
for(SinkList::iterator itr = mSinks.begin(); itr != mSinks.end(); itr++)
{
(*itr)->supportedChanged(mMasterPropertyList);
}
/// iterate through subscribed properties and resubscribe. This catches newly supported properties in the process.
for(map<VehicleProperty::Property, SinkList>::iterator itr = propertySinkMap.begin(); itr != propertySinkMap.end(); itr++)
{
VehicleProperty::Property property = (*itr).first;
for(SourceList::iterator source = mSources.begin(); source != mSources.end(); source++)
{
PropertyList properties = (*source)->supported();
if(ListPlusPlus<VehicleProperty::Property>(&properties).contains(property))
{
(*source)->subscribeToPropertyChanges(property);
}
}
}
}
示例9: evaluate
bool ModelDefinitionFlagEvaluator::evaluate(const PropertyList& properties) const {
PropertyList::const_iterator it, end;
for (it = properties.begin(), end = properties.end(); it != end; ++it) {
const Property& property = *it;
if (property.key() == m_propertyKey) {
if ((std::atoi(property.value().c_str()) & m_flagValue) != 0)
return true;
break;
}
}
return false;
}
示例10: dumpToLog
void dumpToLog(vmime::ref<vmime::net::session> session)
{
typedef std::vector<vmime::ref<vmime::propertySet::property> >
PropertyList;
PropertyList list = session->getProperties().getPropertyList();
PropertyList::const_iterator end = list.end();
for(PropertyList::const_iterator it = list.begin(); it != end; ++it) {
qLog() << QString("%1 %2").arg(
(*it)->getName().c_str()).arg((*it)->getValue().c_str());
}
}
示例11: setSupported
void Core::setSupported(PropertyList supported, AbstractSource* source)
{
mSources.push_back(source);
for(PropertyList::iterator itr = supported.begin(); itr != supported.end(); itr++)
{
if(!ListPlusPlus<VehicleProperty::Property>(&mMasterPropertyList).contains((*itr)))
{
DebugOut()<<__FUNCTION__<<"() adding suport for property "<<VehicleProperty::name((*itr))<<endl;
mMasterPropertyList.push_back((*itr));
}
}
}
示例12: Load
void ResourceNode::Load(int startID, ResourceType newType, PropertyList properties)
{
ID = startID;
type = newType;
//make sure the new ID generator wont overlap
RegisterID(ID);
PropertyList::iterator i;
for(i = properties.begin(); i != properties.end(); ++i)
{
if(i.value().isValid())
SetProperty(i.key(), i.value());
}
}
示例13: populateCurveList
// TODO: populate the curve list once we actually have a list of curves.
void ModelerUserInterface::populateCurveList(Property* prop, Fl_Tree_Item* parent) {
// Create a tree node for this property
Fl_Tree_Item* item;
if (parent == NULL) {
// HACK: We have to add and remove a fake list item so that the tree
// control will create a root node to put it under.
curvesTree->remove(curvesTree->add("You shouldn't see this."));
item = curvesTree->root();
item->label(prop->getName());
} else {
item = curvesTree->add(parent, prop->getName());
}
item->labelfont(FL_HELVETICA_BOLD);
if (GroupProperty* g = dynamic_cast<GroupProperty*>(prop)) {
if (g->getCollapsed()) {
item->close();
}
} else if (dynamic_cast<RGBProperty*>(prop)) {
item->close();
}
// Examine the list of properties.
PropertyList* controls = prop->getProperties();
for (PropertyList::iterator iter = controls->begin();
iter != controls->end();
iter++) {
// For now, only RangeProperty is supported by the Curve interface.
// The RGBProperty is also indirectly supported because it can provide
// RangeProperties when its getProperties() method is called.
// TODO: make this work with more property types (using a new
// plotting widget?)
if (RangeProperty* range = dynamic_cast<RangeProperty*>(*iter)) {
// TODO: connect to Curve object instead of Property object.
Fl_Tree_Item* childNode = curvesTree->add(item, range->getName());
curveProps.push_back(range);
childNode->user_data((void*)(curveProps.size() - 1));
range->setCurveIndex(curveProps.size() - 1);
graph->addCurve(range->getValue(), range->getMin(),
range->getMax());
} else if ((*iter)->getProperties() != NULL) {
// Try to get a list of GroupProperties out of it.
populateCurveList(*iter, item);
}
}
}
示例14: slot_register_properties
static void slot_register_properties(const PropertyList& props)
{
// save props to panel_props
panel_props = props;
// logo prop
std::vector<String> list;
list.push_back(Property2String(logo_prop));
// panel props
{
PropertyList::const_iterator it = props.begin();
PropertyList::const_iterator end = props.end();
PropertyList::const_iterator next = it;
while (it != end) {
++next;
if (next == end || !next->is_a_leaf_of(*it)) {
list.push_back(Property2String(*it));
it = next;
}
}
}
// helper props
{
std::map<int, PropertyList>::iterator it = helper_props_map.begin();
for (; it != helper_props_map.end(); ++it) {
const PropertyList& helper_props = it->second;
PropertyList::const_iterator it = helper_props.begin();
PropertyList::const_iterator end = helper_props.end();
PropertyList::const_iterator next = it;
while (it != end) {
++next;
if (next == end || !next->is_a_leaf_of(*it)) {
list.push_back(Property2String(*it));
it = next;
}
}
}
}
// show help prop
list.push_back(Property2String(show_help_prop));
panel->RegisterProperties(list);
}
示例15: implementedProperties
AbstractDBusInterface::~AbstractDBusInterface()
{
unregisterObject();
PropertyList impl = implementedProperties();
for(auto itr = impl.begin(); itr != impl.end(); itr++)
{
if(properties.find(*itr) != properties.end())
{
// Deleted in ~DBusSink()
//delete properties[*itr];
properties.erase(*itr);
}
}
objectMap.erase(mObjectPath);
}