void QtPropertyDataIntrospection::CreateCustomButtonsForRenderObject() { if(NULL != info && (info->Type() == DAVA::MetaInfo::Instance<DAVA::RenderObject>())) { QPushButton *bakeButton = new QPushButton(QIcon(":/QtIcons/transform_bake.png"), ""); bakeButton->setToolTip("Bake Transform"); bakeButton->setIconSize(QSize(12, 12)); AddOW(QtPropertyOW(bakeButton)); QObject::connect(bakeButton, SIGNAL(pressed()), this, SLOT(BakeTransform())); } }
QtPropertyDataDavaKeyedArcive::QtPropertyDataDavaKeyedArcive(DAVA::KeyedArchive *archive) : curArchive(archive) , lastAddedType(DAVA::VariantType::TYPE_STRING) { if(NULL != curArchive) { curArchive->Retain(); } SetFlags(FLAG_IS_DISABLED); ChildsSync(); // add optional widget (button) to add new key QPushButton *addButton = new QPushButton(QIcon(":/QtIcons/keyplus.png"), ""); addButton->setIconSize(QSize(12, 12)); AddOW(QtPropertyOW(addButton)); QObject::connect(addButton, SIGNAL(pressed()), this, SLOT(AddKeyedArchiveField())); }
void QtPropertyDataDavaKeyedArcive::ChildCreate(const QString &key, DAVA::VariantType *value) { QtPropertyData *childData = NULL; if(value->type == DAVA::VariantType::TYPE_KEYED_ARCHIVE) { childData = new QtPropertyDataDavaKeyedArcive(value->AsKeyedArchive()); } else { childData = new QtPropertyDataDavaVariant(*value); } ChildAdd(key, childData); // add optional widget (button) to remove this key QPushButton *remButton = new QPushButton(QIcon(":/QtIcons/keyminus.png"), ""); remButton->setIconSize(QSize(12, 12)); childData->AddOW(QtPropertyOW(remButton)); childData->SetOWViewport(GetOWViewport()); QObject::connect(remButton, SIGNAL(pressed()), this, SLOT(RemKeyedArchiveField())); }
void QtPropertyDataDavaKeyedArcive::ChildCreate(const QString &key, DAVA::VariantType *value) { QtPropertyData *childData = NULL; if(value->type == DAVA::VariantType::TYPE_KEYED_ARCHIVE) { childData = new QtPropertyDataDavaKeyedArcive(value->AsKeyedArchive()); } else { childData = new QtPropertyKeyedArchiveMember(curArchive, key.toStdString()); int presetValueType = EditorConfig::Instance()->GetPropertyValueType(key.toStdString()); if(presetValueType != DAVA::VariantType::TYPE_NONE) { if(value->type == presetValueType) { const DAVA::Vector<DAVA::String>& allowedValues = EditorConfig::Instance()->GetComboPropertyValues(key.toStdString()); for(size_t i = 0; i < allowedValues.size(); ++i) { ((QtPropertyKeyedArchiveMember *) childData)->AddAllowedValue(DAVA::VariantType((int) i), allowedValues[i].c_str()); } } } } ChildAdd(key, childData); // add optional widget (button) to remove this key QPushButton *remButton = new QPushButton(QIcon(":/QtIcons/keyminus.png"), ""); remButton->setIconSize(QSize(12, 12)); childData->AddOW(QtPropertyOW(remButton)); childData->SetOWViewport(GetOWViewport()); QObject::connect(remButton, SIGNAL(pressed()), this, SLOT(RemKeyedArchiveField())); }