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


C++ QStringRef::toLatin1方法代码示例

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


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

示例1: sendTurnChangeMessage

void Server::sendTurnChangeMessage(QStringRef name){
    for (int i = 0; i < nickContainer->size(); ++i){
        if (nickContainer->at(i) == name){
            clientContainer->at(i)->write("/Turn::" + name.toLatin1());
        }
    }
}
开发者ID:Brona123,项目名称:school-projects,代码行数:7,代码来源:server.cpp

示例2: sendChallengeAccepted

void Server::sendChallengeAccepted(QStringRef source){
    for (int i = 0; i < nickContainer->size(); ++i){
        if (nickContainer->at(i) == source){
            clientContainer->at(i)->write("/ChallengeAccepted::" + source.toLatin1());
        }
    }
}
开发者ID:Brona123,项目名称:school-projects,代码行数:7,代码来源:server.cpp

示例3: AbstractMultipartSource

Image::Image(QQmlEngine *engine, const QString &filename) :
    AbstractMultipartSource(),
    m_engine(engine)
{
    m_self = engine->newQObject(this);
    engine->setObjectOwnership(this, QQmlEngine::JavaScriptOwnership);
    if (filename.startsWith(QStringLiteral("data:"))) {
        int comma = filename.indexOf(QChar(','));
        QStringRef data = filename.midRef(comma+1);
        QBuffer *buffer = new QBuffer(this);
        buffer->setData(QByteArray::fromBase64(data.toLatin1()));
        m_reader = new QImageReader(buffer);
    } else {
        m_reader = new QImageReader(filename);
    }
}
开发者ID:Cutehacks,项目名称:duperagent,代码行数:16,代码来源:imageutils.cpp

示例4: handleText

 bool handleText(const QStringRef &text)
 {
     data->pack = QByteArray::fromBase64(text.toLatin1());
     return true;
 }
开发者ID:czeidlertest,项目名称:woodpidgen,代码行数:5,代码来源:remotesync.cpp

示例5: attribute

void GeogebraTransformer::attribute( const QXmlName& name, const QStringRef& value )
{
  if( name.localName( m_np ) == QLatin1String( "label" ) )
  {
    const QByteArray objectLabel = value.toLatin1();
    bool isDoubleValue;
    const double dblval = value.toString().toDouble( &isDoubleValue );

    switch( m_currentState )
    {
    case GeogebraTransformer::ReadingObject:
      m_currentObjectLabel = value.toLatin1();
      // There must be a better place for this
      m_currentState = GeogebraTransformer::ReadingArguments;

      break;
    case GeogebraTransformer::ReadingArguments:
      if( isDoubleValue )
      {
        /* This is to handle the circle-point-radius, dilate (and similar) type of Geogebra objects.
         * <command name="Circle">
         * <input a0="A" a1="3"/>
         * <output a0="c"/>
         *
         * Notice the attribute 'a1' of the 'input' element. The value - '3' is the radius of the circle.
         * First, we try to convert that value to Double. If the conversion suceeds, we stack a DoubleImp (Calcer)
         * in the m_currentArgStack and break. Otherwise, we check the m_objectMap for that label entry.
         */
        DoubleImp * doubleImp = new DoubleImp( dblval );
        m_currentArgStack.push_back( new ObjectConstCalcer( doubleImp ) );
      }
      else if( m_objectMap.contains( objectLabel ) )
      {
        m_currentArgStack.push_back( m_objectMap[objectLabel] );
      }
      else
      {
        //TODO Figure out error reporting
      }

      break;
    default:
      break;
    }
  }
  else if ( name.localName( m_np ) == QLatin1String( "value" ) )
  {
    Q_ASSERT( m_currentState == ReadingDouble );
    DoubleImp * doubleImp = new DoubleImp( value.toString().toDouble() );

    m_currentArgStack.push_back( new ObjectConstCalcer( doubleImp ) );
  }
  else if ( name.localName( m_np ) == QLatin1String( "Name" ) )
  {
    m_sections[m_nsections - 1].setName( value.toString() );
  }
  else if ( name.localName( m_np ) == QLatin1String( "Description" ) )
  {
    m_sections[m_nsections - 1].setDescription( value.toString() );
  }
  else if ( name.localName( m_np ) == QLatin1String( "Input" ) )
  {
    m_inputObjectLabels.insert( value.toLatin1() );
  }
  else if ( name.localName( m_np ) == QLatin1String( "Output" ) )
  {
    m_outputObjectLabels.insert( value.toLatin1() );
  }
  else if( name.localName( m_np ) == QLatin1String( "show" ) )
  {
    m_show = ( ( value.toString()=="true" ) ? true:false );
  }
  else if( name.localName( m_np ) == QLatin1String( "thickness" ) )
  {
    m_thickness = value.toString().toInt();
  }
  else if( name.localName( m_np ) == QLatin1String( "thickness_point" ) )
  {
    m_thickness = value.toString().toInt();
    m_thickness += 6;
  }
  else if( name.localName( m_np ) == QLatin1String( "type" ) )
  {
    int penType = value.toString().toInt() ;
    switch( penType )
    {
    case SOLIDLINE:
      m_type = Qt::SolidLine;
      break;
    case DASHDOTDOTLINE:
      m_type = Qt::DashDotDotLine;
      break;
    case DASHLINE:
      m_type = Qt::DashLine;
      break;
    case DOTLINE:
      m_type = Qt::DotLine;
      break;
    case DASHDOTLINE:
      m_type = Qt::DashDotLine;
//.........这里部分代码省略.........
开发者ID:KDE,项目名称:kig,代码行数:101,代码来源:geogebratransformer.cpp

示例6: FromString

QByteArray FromString(const QStringRef &Hash) noexcept
   {
      return QByteArray::fromHex(Hash.toLatin1());
   }
开发者ID:DimanNe,项目名称:eventmanager,代码行数:4,代码来源:TreeUtils.cpp


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