Esempio n. 1
0
void KSession::sendKey(int rep, int key, int mod) const
{
    Qt::KeyboardModifier kbm = Qt::KeyboardModifier(mod);

    QKeyEvent qkey(QEvent::KeyPress, key, kbm);

    while (rep > 0){
        m_session->sendKey(&qkey);
        --rep;
    }
}
 bool PropertyItemType::loadTypedef(const rapidjson::Value & config)
 {
     const rapidjson::Value *value = &config["type"];
     if(!value->IsString())
     {
         return false;
     }
     type_ = value->GetString();
     
     value = &config["item"];
     if(value->IsArray())
     {
         for (rapidjson::Value::ConstValueIterator it = value->Begin(); it != value->End(); ++it)
         {                
             PropertyItemType *item = new PropertyItemType();
             if(!item->loadValue(*it))
             {
                 delete item;
                 return false;
             }
             
             items_.push_back(item);
         }
     }
     
     value = &config["attribute"];
     if(value->IsObject())
     {
         for(rapidjson::Value::ConstMemberIterator it = value->MemberBegin();
             it != value->MemberEnd(); ++it)
         {
             QString qkey(it->name.GetString());
             QVariant qvalue;
             parseAttributeValue(qvalue, it->value);
             attributes_.insert(qkey, qvalue);
         }
     }
     return true;
 }