本文整理汇总了C++中TAttribute::IsSet方法的典型用法代码示例。如果您正苦于以下问题:C++ TAttribute::IsSet方法的具体用法?C++ TAttribute::IsSet怎么用?C++ TAttribute::IsSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TAttribute
的用法示例。
在下文中一共展示了TAttribute::IsSet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Construct
void SWidget::Construct(
const TAttribute<FText> & InToolTipText ,
const TSharedPtr<IToolTip> & InToolTip ,
const TAttribute< TOptional<EMouseCursor::Type> > & InCursor ,
const TAttribute<bool> & InEnabledState ,
const TAttribute<EVisibility> & InVisibility,
const TAttribute<TOptional<FSlateRenderTransform>>& InTransform,
const TAttribute<FVector2D>& InTransformPivot,
const FName& InTag,
const bool InForceVolatile,
const TArray<TSharedRef<ISlateMetaData>>& InMetaData
)
{
if ( InToolTip.IsValid() )
{
// If someone specified a fancy widget tooltip, use it.
ToolTip = InToolTip;
}
else if ( InToolTipText.IsSet() )
{
// If someone specified a text binding, make a tooltip out of it
ToolTip = FSlateApplicationBase::Get().MakeToolTip(InToolTipText);
}
else if( !ToolTip.IsValid() || (ToolTip.IsValid() && ToolTip->IsEmpty()) )
{
// We don't have a tooltip.
ToolTip.Reset();
}
Cursor = InCursor;
EnabledState = InEnabledState;
Visibility = InVisibility;
RenderTransform = InTransform;
RenderTransformPivot = InTransformPivot;
Tag = InTag;
bForceVolatile = InForceVolatile;
MetaData = InMetaData;
}
示例2: ShowFoliagePropertiesForCategory
void FFoliageTypePaintingCustomization::ShowFoliagePropertiesForCategory(IDetailLayoutBuilder& DetailLayoutBuilder, const FName CategoryName, TMap<const FName, IDetailPropertyRow*>& OutDetailRowsByPropertyName)
{
// Properties that have a ReapplyCondition should be disabled behind the specified property when in reapply mode
static const FName ReapplyConditionKey("ReapplyCondition");
// Properties with a HideBehind property specified should only be shown if that property is true, non-zero, or not empty
static const FName HideBehindKey("HideBehind");
IDetailCategoryBuilder& CategoryBuilder = DetailLayoutBuilder.EditCategory(CategoryName);
TArray<TSharedRef<IPropertyHandle>> CategoryProperties;
CategoryBuilder.GetDefaultProperties(CategoryProperties, true, true);
// Determine whether each property should be shown and how
for (auto& PropertyHandle : CategoryProperties)
{
bool bShowingProperty = false;
if (UProperty* Property = PropertyHandle->GetProperty())
{
// Check to see if this property can be reapplied
TSharedPtr<IPropertyHandle> ReapplyConditionPropertyHandle = DetailLayoutBuilder.GetProperty(*Property->GetMetaData(ReapplyConditionKey));
if (ReapplyConditionPropertyHandle.IsValid() && ReapplyConditionPropertyHandle->IsValidHandle())
{
// Create a custom entry that allows explicit enabling/disabling of the property when reapplying
TSharedPtr<IPropertyHandle> PropertyHandlePtr = PropertyHandle;
OutDetailRowsByPropertyName.FindOrAdd(PropertyHandle->GetProperty()->GetFName()) =
&AddFoliageProperty(CategoryBuilder, PropertyHandlePtr, ReapplyConditionPropertyHandle, TAttribute<EVisibility>(), TAttribute<bool>());
}
else
{
TSharedPtr<IPropertyHandle> InvalidProperty;
TSharedPtr<IPropertyHandle> PropertyHandlePtr = PropertyHandle;
// Check to see if this property is hidden behind another
TSharedPtr<IPropertyHandle> HiddenBehindPropertyHandle = DetailLayoutBuilder.GetProperty(*Property->GetMetaData(HideBehindKey));
if (HiddenBehindPropertyHandle.IsValid() && HiddenBehindPropertyHandle->IsValidHandle())
{
TAttribute<bool> IsEnabledAttribute;
ReapplyConditionPropertyHandle = DetailLayoutBuilder.GetProperty(*HiddenBehindPropertyHandle->GetProperty()->GetMetaData(ReapplyConditionKey));
if (ReapplyConditionPropertyHandle.IsValid() && ReapplyConditionPropertyHandle->IsValidHandle())
{
// If the property this is hidden behind has a reapply condition, disable this when the condition is false
IsEnabledAttribute = TAttribute<bool>::Create(TAttribute<bool>::FGetter::CreateSP(this, &FFoliageTypePaintingCustomization::IsReapplyPropertyEnabled, ReapplyConditionPropertyHandle));
}
TAttribute<EVisibility> VisibilityAttribute;
GetHiddenPropertyVisibility(HiddenBehindPropertyHandle, !IsEnabledAttribute.IsSet(), VisibilityAttribute);
OutDetailRowsByPropertyName.FindOrAdd(PropertyHandle->GetProperty()->GetFName()) =
&AddFoliageProperty(CategoryBuilder, PropertyHandlePtr, InvalidProperty, VisibilityAttribute, IsEnabledAttribute);
}
else
{
// This property cannot be reapplied and isn't hidden behind anything, so show it whenever the reapply tool isn't active
OutDetailRowsByPropertyName.FindOrAdd(PropertyHandle->GetProperty()->GetFName()) =
&AddFoliageProperty(CategoryBuilder, PropertyHandlePtr, InvalidProperty,
TAttribute<EVisibility>::Create(TAttribute<EVisibility>::FGetter::CreateSP(this, &FFoliageTypePaintingCustomization::GetNonReapplyPropertyVisibility)),
TAttribute<bool>());
}
}
}
}
}