davidrhcp
8th May 2014, 00:52
i got this code that is suppose to - when a network interface is chosen from the 'comboBox_Interface' widget listen to packets and write to 'packet' widget.
I have tried using similar code patterns from the same project and have come up with:
@
void Monice::on_comboBox_Interface_activated(const QString &arg1)
{
QTextStream pText;
pText.read(ui->comboBox_Interface)
if (pText.setDevice(QNetworkInterface::flags())
{
QTextStream out(server);
out << ui->packet->text();
}
}
@
its very temperamental, im confused as to whether or not i should be using Qtextstream first to read the combobox (which im pretty sure i should) but if thats the case how do i get the program to understand that its an interface i won't it to listen to?
i know i can use QTcpScocket and server, not to sure which is the one to use for listening and writing packets?
I have tried using similar code patterns from the same project and have come up with:
@
void Monice::on_comboBox_Interface_activated(const QString &arg1)
{
QTextStream pText;
pText.read(ui->comboBox_Interface)
if (pText.setDevice(QNetworkInterface::flags())
{
QTextStream out(server);
out << ui->packet->text();
}
}
@
its very temperamental, im confused as to whether or not i should be using Qtextstream first to read the combobox (which im pretty sure i should) but if thats the case how do i get the program to understand that its an interface i won't it to listen to?
i know i can use QTcpScocket and server, not to sure which is the one to use for listening and writing packets?