本文整理汇总了C++中QtProperty::setEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ QtProperty::setEnabled方法的具体用法?C++ QtProperty::setEnabled怎么用?C++ QtProperty::setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QtProperty
的用法示例。
在下文中一共展示了QtProperty::setEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setAxisScaleDrawStyle
void QwtPlotPropertySetDialog::setAxisScaleDrawStyle(QwtPlot::Axis axis, const QVariant& value)
{
ScaleDraw sType = ScaleDraw( value.toInt());//强制转换,因为已经设置好枚举的值,所以这里可以进行强制转换
QwtScaleDraw *scaleDraw = m_plot->axisScaleDraw(axis);
QwtDateScaleDraw* dateScale = dynamic_cast<QwtDateScaleDraw*>(scaleDraw);
QtProperty * property = m_property_id.getProperty(axisPropertyID(axis,3));
if(NormalScale == sType)
{
if(property)
property->setEnabled(false);
if(dateScale)
{//说明当前是时间坐标轴
QwtScaleDraw* scale = nullptr;
scale = new QwtScaleDraw;
m_plot->setAxisScaleDraw(axis,scale);
}
}
else if(DateScale == sType)
{
ChartWave_qwt::AxisDateScaleType st(ChartWave_qwt::hh_mm_ss);
if(property)
{
property->setEnabled(true);
st = ChartWave_qwt::AxisDateScaleType( static_cast<QtVariantProperty*>(property)->value().toInt() );
}
if(!dateScale)
{//说明当前不是时间坐标轴
m_plot->setDateAxis(st,axis,QwtDate::Second);
}
}
}
示例2:
QtProperty *ShapePropertyString::getQtProperty()
{
QtProperty *pProp = m_stringManager->addProperty( m_sName );
pProp->setToolTip( m_sDescription );
pProp->setWhatsThis( m_sDescription );
pProp->setEnabled( m_bEnabled );
return pProp;
}
示例3:
QtProperty *ShapePropertyRCNames::getQtProperty()
{
QtProperty *pProp = m_keyMatrixNameManager->addProperty( m_sName );
pProp->setToolTip( m_sDescription );
pProp->setWhatsThis( m_sDescription );
pProp->setEnabled( m_bEnabled );
return pProp;
}
示例4: addAxisSet
void QwtPlotPropertySetDialog::addAxisSet(QtProperty* parentGroup, ChartWave_qwt* plot,QwtPlot::Axis axis)
{
m_enableSet = false;
QtVariantProperty *pro = nullptr;
//QwtScaleWidget* scaleWidget = plot->axisWidget(axis);
QwtScaleDraw *scaleDraw = plot->axisScaleDraw(axis);
QwtDateScaleDraw* dateScale = dynamic_cast<QwtDateScaleDraw*>(scaleDraw);
//轴详细设置
QtProperty *childGroup = m_property_id.addGroupInGroup(m_variantManager,parentGroup
,QStringLiteral("%1轴设置").arg(axisString(axis))
,axisPropertyID(axis,0));
childGroup->setEnabled(plot->axisEnabled(axis));//在轴允许时才让设置
QwtInterval inv= plot->axisInterval(axis);
m_property_id.addVariantPropertyInGroup(m_variantManager,QVariant::PointF
,childGroup
,QStringLiteral("坐标范围")
,axisPropertyID(axis,4)
,QPointF(inv.minValue(),inv.maxValue()));
m_property_id.addVariantPropertyInGroup(m_variantManager,QVariant::String
,childGroup,QStringLiteral("标题")
,axisPropertyID(axis,1)
,m_plot->axisTitle(axis).text());
//
m_property_id.addVariantPropertyInGroup(m_variantManager,QVariant::Double
,childGroup,QStringLiteral("刻度文字角度")
,axisPropertyID(axis,5)
,scaleDraw->labelRotation());
pro = m_property_id.addVariantPropertyInGroup(m_variantManager,QtVariantPropertyManager::enumTypeId()
,childGroup
,QStringLiteral("%1轴样式").arg(axisString(axis))
,axisPropertyID(axis,2)
,0);
pro->setAttribute(QLatin1String("enumNames"),QStringList()
<<QStringLiteral("正常坐标轴")
<<QStringLiteral("时间坐标轴")
);
ScaleDraw sd = NormalScale;
sd = ((dateScale == nullptr) ? NormalScale : DateScale);
pro->setValue(int(sd));
pro = m_property_id.addVariantPropertyInGroup(m_variantManager,QtVariantPropertyManager::enumTypeId()
,childGroup
,QStringLiteral("时间格式")
,axisPropertyID(axis,3)
,int(ChartWave_qwt::hh_mm_ss));
pro->setAttribute(QLatin1String("enumNames"), QStringList()
<<QStringLiteral("h_m")
<<QStringLiteral("hh_mm")
<<QStringLiteral("h_m_s")
<<QStringLiteral("hh_mm_ss")
<<QStringLiteral("yyyy_M_d")
<<QStringLiteral("yyyy_M_d_h_m")
<<QStringLiteral("yyyy_M_d_h_m_s")
<<QStringLiteral("yyyy_MM_dd")
<<QStringLiteral("yyyy_MM_dd_hh_mm")
<<QStringLiteral("yyyy_MM_dd_hh_mm_ss")
);//在setAttribute过程中会触发onPropertyValueChanged,而onPropertyValueChanged的值是0,需要使用m_enableAxisEnableSet来抑制
pro->setValue(int(ChartWave_qwt::hh_mm_ss));
pro->setEnabled(sd == DateScale);
m_enableSet = true;
}