当前位置: 首页>>代码示例>>C++>>正文


C++ LabelList::empty方法代码示例

本文整理汇总了C++中LabelList::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelList::empty方法的具体用法?C++ LabelList::empty怎么用?C++ LabelList::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LabelList的用法示例。


在下文中一共展示了LabelList::empty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

// Find the label whose buddy the widget is.
QLabel *buddyLabelOf(QDesignerFormWindowInterface *fw, QWidget *w)
{
    typedef QList<QLabel*> LabelList;
    const LabelList labelList = fw->findChildren<QLabel*>();
    if (labelList.empty())
        return 0;
    const LabelList::const_iterator cend = labelList.constEnd();
    for (LabelList::const_iterator it = labelList.constBegin(); it != cend; ++it )
        if ( (*it)->buddy() == w)
            return *it;
    return 0;
}
开发者ID:Blizzard,项目名称:qt4,代码行数:13,代码来源:morphmenu.cpp

示例2: updateBuddies

void QDesignerFormWindowCommand::updateBuddies(QDesignerFormWindowInterface *form,
                                               const QString &old_name,
                                               const QString &new_name)
{
    QExtensionManager* extensionManager = form->core()->extensionManager();

    typedef QList<QLabel*> LabelList;

    const LabelList label_list = qFindChildren<QLabel*>(form);
    if (label_list.empty())
        return;
    
    const QString buddyProperty = QLatin1String("buddy");

    const LabelList::const_iterator cend = label_list.constEnd();
    for (LabelList::const_iterator it = label_list.constBegin(); it != cend; ++it ) {
        if (QDesignerPropertySheetExtension* sheet = qt_extension<QDesignerPropertySheetExtension*>(extensionManager, *it)) {
            const int idx = sheet->indexOf(buddyProperty);
            if (idx != -1 && sheet->property(idx).toString() == old_name)
                sheet->setProperty(idx, new_name);
        }
    }
}
开发者ID:pk-codebox-evo,项目名称:remixos-usb-tool,代码行数:23,代码来源:qdesigner_formwindowcommand.cpp

示例3: channelColors

void
AverageDisplay::Initialize( const SignalProperties&, const SignalProperties& )
{
  for( size_t i = 0; i < mVisualizations.size(); ++i )
    mVisualizations[ i ].Send( CfgID::Visible, false );
  mVisualizations.clear();
  mChannelIndices.clear();
  mPowerSums.clear();
  mTargetCodes.clear();
  mSignalOfCurrentRun.clear();
#ifdef SET_BASELINE
  mBaselines.clear();
  mBaselineSamples.clear();
#endif // SET_BASELINE
  LabelList markerLabels;
  for( int i = 0; i < Parameter( "AvgDisplayMarkers" )->NumRows(); ++i )
  {
    string markerName = Parameter( "AvgDisplayMarkers" )( i, 0 );
    int position =
      MeasurementUnits::ReadAsTime( OptionalParameter( markerName, -1 ) )
                                               * Parameter( "SampleBlockSize" );
    if( position >= 0 )
      markerLabels.push_back( Label( position, markerName ) );
  }

  int numChannels = Parameter( "AvgDisplayCh" )->NumRows();
  mPowerSums.resize( maxPower + 1, vector<vector<vector<float> > >( numChannels ) );
  for( int i = 0; i < numChannels; ++i )
  {
    ostringstream oss;
    oss << "AVG" << i;
    mVisualizations.push_back( GenericVisualization( oss.str() ) );
    GenericVisualization& vis = mVisualizations[ i ];

    string windowTitle = Parameter( "AvgDisplayCh" )( i, 1 );
    if( windowTitle == "" )
      windowTitle = "unknown";
    windowTitle += " Average";
    vis.Send( CfgID::WindowTitle, windowTitle );
    // Note min and max value are interchanged to account for EEG display direction.
    vis.Send( CfgID::MinValue, int( Parameter( "AvgDisplayMin" ) ) );
    vis.Send( CfgID::MaxValue, int( Parameter( "AvgDisplayMax" ) ) );
    vis.Send( CfgID::NumSamples, 0 );
    vis.Send( CfgID::GraphType, CfgID::Polyline );

    if( !markerLabels.empty() )
      vis.Send( CfgID::XAxisMarkers, markerLabels );

    ColorList channelColors( sChannelColors );
    vis.Send( CfgID::ChannelColors, channelColors );

    vis.Send( CfgID::ChannelGroupSize, 0 );
    vis.Send( CfgID::ShowBaselines, 1 );
    vis.Send( CfgID::Visible, true );

    mChannelIndices.push_back( Parameter( "AvgDisplayCh" )( i, 0 ) - 1 );
  }

  mSignalOfCurrentRun.resize( numChannels );
#ifdef SET_BASELINE
  mBaselines.resize( numChannels );
  mBaselineSamples.resize( numChannels );
#endif // SET_BASELINE
  mLastTargetCode = 0;
}
开发者ID:sonyyassine,项目名称:weka-bci2000,代码行数:65,代码来源:AverageDisplay.cpp


注:本文中的LabelList::empty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。