本文整理汇总了C++中removeProperty函数的典型用法代码示例。如果您正苦于以下问题:C++ removeProperty函数的具体用法?C++ removeProperty怎么用?C++ removeProperty使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了removeProperty函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findDev
/* delete the property in the given device, including widgets and data structs.
* when last property is deleted, delete the device too.
* if no property name attribute at all, delete the whole device regardless.
* return 0 if ok, else -1 with reason in errmsg[].
*/
int INDI::BaseClientQt::delPropertyCmd (XMLEle * root, char * errmsg)
{
XMLAtt * ap;
INDI::BaseDevice * dp;
/* dig out device and optional property name */
dp = findDev (root, 0, errmsg);
if (!dp)
return INDI_DEVICE_NOT_FOUND;
dp->checkMessage(root);
ap = findXMLAtt (root, "name");
/* Delete property if it exists, otherwise, delete the whole device */
if (ap)
{
INDI::Property * rProp = dp->getProperty(valuXMLAtt(ap));
removeProperty(rProp);
int errCode = dp->removeProperty(valuXMLAtt(ap), errmsg);
return errCode;
}
// delete the whole device
else
return deleteDevice(dp->getDeviceName(), errmsg);
}
示例2: getPropertyCountMap
/**
* Synchronize properties with scatterer members
*
* This method synchronizes the properties of CompositeBraggScatterer with the
* properties of the contained BraggScatterer instances. It adds new properties
* if required and removed properties that are no longer used (for example
* because the member that introduced the property has been removed).
*/
void CompositeBraggScatterer::redeclareProperties() {
std::map<std::string, size_t> propertyUseCount = getPropertyCountMap();
for (auto &scatterer : m_scatterers) {
// Check if any of the declared properties is in this scatterer (and set
// value if that's the case)
for (auto &prop : propertyUseCount) {
if (scatterer->existsProperty(prop.first)) {
prop.second += 1;
propagatePropertyToScatterer(scatterer, prop.first,
getPropertyValue(prop.first));
}
}
// Use the properties of this scatterer which have been marked as exposed to
// composite
std::vector<Property *> properties =
scatterer->getPropertiesInGroup(getPropagatingGroupName());
for (auto &property : properties) {
const std::string &propertyName = property->name();
if (!existsProperty(propertyName)) {
declareProperty(std::unique_ptr<Property>(property->clone()));
}
}
}
// Remove unused properties
for (auto &property : propertyUseCount) {
if (property.second == 0) {
removeProperty(property.first);
}
}
}
示例3: cssPropertyID
String CSSStyleDeclaration::removeProperty(const String& propertyName, ExceptionCode& ec)
{
int propID = cssPropertyID(propertyName);
if (!propID)
return String();
return removeProperty(propID, ec);
}
示例4: set
void ToDo::setClass(iCalProperty& p) {
set(&classEvent, p);
removeProperty(TEXT("CLASS"));
if(classEvent) {
insertProperty(getVPropertyFromiCalProperty(TEXT("CLASS"), classEvent));
}
}
示例5: removeProperty
void ContextPaneWidgetImage::onFileNameChanged()
{
if (m_fileWidget->fileName().isNull())
emit removeProperty(QLatin1String("source"));
else
emit propertyChanged(QLatin1String("source"), QString(QLatin1Char('\"') + m_fileWidget->fileName() + QLatin1Char('\"')));
}
示例6: removeProperty
void ContextPaneTextWidget::onStyleComboBoxChanged(const QString &style)
{
if (style == QLatin1String("Normal"))
emit removeProperty(QLatin1String("style"));
else
emit propertyChanged(QLatin1String("style"), QVariant(QLatin1String("Text.") + style));
}
示例7: getProperty
void PoldiTruncateData::exec()
{
MatrixWorkspace_sptr inputWorkspace = getProperty("InputWorkspace");
setChopperFromWorkspace(inputWorkspace);
setTimeBinWidthFromWorkspace(inputWorkspace);
try {
MatrixWorkspace_sptr cropped = getCroppedWorkspace(inputWorkspace);
setProperty("OutputWorkspace", cropped);
if(!getPointerToProperty("ExtraCountsWorkspaceName")->isDefault()) {
try {
MatrixWorkspace_sptr extraCounts = getExtraCountsWorkspace(inputWorkspace);
std::string extraCountsWorkspaceName = getProperty("ExtraCountsWorkspaceName");
declareProperty(new WorkspaceProperty<MatrixWorkspace>("ExtraCountsWorkspace", extraCountsWorkspaceName, Direction::Output));
setProperty("ExtraCountsWorkspace", extraCounts);
} catch(std::invalid_argument) {
m_log.warning() << "Extra count information was requested, but there are no extra bins." << std::endl;
}
}
} catch(std::invalid_argument) {
m_log.error() << "Cannot crop workspace. Please check the timing information." << std::endl;
m_log.error() << " Calculated bin count: " << getCalculatedBinCount() << std::endl;
m_log.error() << " Bin count in the workspace: " << getActualBinCount() << std::endl;
removeProperty("OutputWorkspace");
}
}
示例8: propertyChanged
void ContextPaneTextWidget::onUnderlineCheckedChanged(bool value)
{
if (value)
emit propertyChanged(QLatin1String("font.underline"), value);
else
emit removeProperty(QLatin1String("font.underline"));
}
示例9: setAutoFillBackground
Uint32Edit::Uint32Edit(Uint32Property* property, Model& model,QWidget* parent):QWidget(parent),property_(property),model_(model),entity_(property->owner()){
QPalette palette;
palette.setColor(QPalette::Base,QColor(170, 170,0));
setAutoFillBackground(true);
setPalette(palette);
QFont font;
font.setPointSize(7);
toplayout_ = new QHBoxLayout(this);
label_ = new QLabel(this);
nameEdit_ = new QLineEdit(this);
valEdit_ = new QLineEdit(this);
del_ = new QPushButton(this);
del_->setText("X");
del_->setMaximumSize(QSize(20,20));
del_->setStyleSheet("background-color: #EE6666;");
label_->setText("unsigned int");
nameEdit_->setPlaceholderText("Name");
valEdit_->setPlaceholderText("Value");
valEdit_->setValidator( new QRegExpValidator(QRegExp("[0-9]{,10}"), this));
nameEdit_->setText(property_->name.c_str());
valEdit_->setText(std::to_string(property_->value).c_str());
toplayout_->addWidget(label_);
toplayout_->addWidget(nameEdit_);
toplayout_->addWidget(valEdit_);
toplayout_->addWidget(del_);
connect(nameEdit_, SIGNAL(textChanged(const QString&)), this, SLOT(changeName(const QString&)));
connect(valEdit_, SIGNAL(textChanged(const QString&)), this, SLOT(changeValue(const QString&)));
connect(del_, SIGNAL(clicked()), this, SLOT(removeProperty()));
}
示例10: foreach
/**
* Update the browser when minimizer changes.
*/
void FitOptionsBrowser::updateMinimizer() {
int i = m_enumManager->value(m_minimizer);
QString minimizerName = m_enumManager->enumNames(m_minimizer)[i];
m_minimizerGroup->setPropertyName("Minimizer " + minimizerName);
// Remove properties of the old minimizer
auto subProperties = m_minimizerGroup->subProperties();
foreach (QtProperty *prop, subProperties) {
if (prop != m_minimizer) {
m_minimizerGroup->removeSubProperty(prop);
removeProperty(prop->propertyName());
}
}
// Check if the new minimizer has its own properties
auto minimizer =
Mantid::API::FuncMinimizerFactory::Instance().createMinimizer(
minimizerName.toStdString());
// Create and add properties to the minimizer group
auto minimizerProperties = minimizer->getProperties();
for (auto property = minimizerProperties.begin();
property != minimizerProperties.end(); ++property) {
auto prop = createPropertyProperty(*property);
if (!*property)
continue;
m_minimizerGroup->addSubProperty(prop);
}
}
示例11: removeProperty
void ContextPaneTextWidget::onWarpModeComboBoxChanged(const QString &warpMode)
{
if (warpMode == QLatin1String("NoWrap"))
emit removeProperty(QLatin1String("wrapMode"));
else
emit propertyChanged(QLatin1String("wrapMode"), QVariant(QLatin1String("Text.") + warpMode));
}
示例12: tvc
void PropertyOwner::deserialize(Deserializer& d) {
// This is for finding renamed composites, and moving old properties to new composites.
NodeVersionConverter tvc(this, &PropertyOwner::findPropsForComposites);
d.convertVersion(&tvc);
std::vector<std::string> ownedIdentifiers;
d.deserialize("OwnedPropertyIdentifiers", ownedIdentifiers, "PropertyIdentifier");
auto des = util::IdentifiedDeserializer<std::string, Property*>("Properties", "Property")
.setGetId([](Property* const& p) { return p->getIdentifier(); })
.setMakeNew([]() { return nullptr; })
.setNewFilter([&](const std::string& id, size_t ind) {
return util::contains(ownedIdentifiers, id);
})
.onNew([&](Property*& p) { addProperty(p, true); })
.onRemove([&](const std::string& id) {
if (util::contains_if(ownedProperties_, [&](std::unique_ptr<Property>& op) {
return op->getIdentifier() == id;
})) {
delete removeProperty(id);
}
});
des(d, properties_);
}
示例13: propertyChanged
void ContextPaneWidgetImage::onTopMarginsChanged()
{
if (previewDialog()->previewLabel()->topMarging())
propertyChanged(QLatin1String("border.top"), previewDialog()->previewLabel()->topMarging());
else
emit removeProperty(QLatin1String("border.top"));
}
示例14: attachChat
void TabsManager::attachChat(ChatWidget *chatWidget)
{
auto chat = chatWidget->chat();
chat.removeProperty("tabs:detached");
chat.addProperty("tabs:attached", true, CustomProperties::Storable);
emit chatAcceptanceChanged(chat);
}
示例15: transaction
void Style::unsetLooseness()
{
if (propertySet(s_looseness)) {
ConfigTransaction transaction(this);
removeProperty(s_looseness);
d->looseness = 1.0;
}
}