davinciomare
24th September 2016, 17:35
Hi i am trying to send keystrokes but i am have some doubts.
I send this:
QFile klog;
klog.setFileName(directorio.tempPath() + "/logg");
klog.open(QFile::ReadOnly);
cliente.sendMessage(from,"teclas|@|" + klog.readAll()); // crash when i do this
klog.close();
And i receive with this:
if (parametros[0] == "teclas") //I check the message and write the text to my textfield
{
ui->textTeclas->setText(parametros[1]);
}
Any suggestion or idea is good received thanks. The problem is when i read the file and i send the message, the application crashes and i cant send the keystrokes that i have in the file . Thanks in advance.
Aditional:
I think i could create other button; send some message and put since my server:
if(parametros[0] == "t") //message of client
{
int i;
for(i=0;i<parametros.size();i++) //loop keystrokes
{
enviarTecla(parametros[i].toInt());
}
return;
}
And then send key for key, i dont know if this will work fine. Any suggestions. I need to read some file and send the strokes to my client. Only that. Thanks in advance.
I send this:
QFile klog;
klog.setFileName(directorio.tempPath() + "/logg");
klog.open(QFile::ReadOnly);
cliente.sendMessage(from,"teclas|@|" + klog.readAll()); // crash when i do this
klog.close();
And i receive with this:
if (parametros[0] == "teclas") //I check the message and write the text to my textfield
{
ui->textTeclas->setText(parametros[1]);
}
Any suggestion or idea is good received thanks. The problem is when i read the file and i send the message, the application crashes and i cant send the keystrokes that i have in the file . Thanks in advance.
Aditional:
I think i could create other button; send some message and put since my server:
if(parametros[0] == "t") //message of client
{
int i;
for(i=0;i<parametros.size();i++) //loop keystrokes
{
enviarTecla(parametros[i].toInt());
}
return;
}
And then send key for key, i dont know if this will work fine. Any suggestions. I need to read some file and send the strokes to my client. Only that. Thanks in advance.