• 6143阅读
  • 1回复

qt s60 网络通信 [复制链接]

上一主题 下一主题
离线kym2005
 
只看楼主 倒序阅读 楼主  发表于: 2010-04-26
— 本帖被 XChinux 执行加亮操作(2010-09-21) —
各位大侠帮小弟看看,为什么我的网络不通呢,qt s60 应该如何通过GPRS访问网络呢
#include "testttt.h"
#include <QTime>
#include <QHostAddress>
#include <QDebug>
#include <QTimer>
testttt::testttt(QWidget *parent)
    : QWidget(parent)
{
    ui.setupUi(this);
    connect(ui.logonptn, SIGNAL(clicked()),this,SLOT(start()));
    connect(ui.pushButton,SIGNAL(clicked()),this,SLOT(close()));
    
}
testttt::~testttt()
{
    tcpClient.close();
}
void testttt::start(){
    tcpClient.connectToHost(QHostAddress("232.128.7.51"), 6789);
    QTimer::singleShot(1000, this, SLOT(send()));
}
void testttt::send(){
    QString str1 = "$sssddd,G123,2010-04-26 13:35:23,116.6856,39.9996,23.65,342,6#";
    qDebug()<<str1;
    tcpClient.write(str1.toUtf8());    
    QTimer::singleShot(1000, this, SLOT(send()));
}

离线kym2005
只看该作者 1楼 发表于: 2010-04-28
问题解决了,在.mmp 文件中加一行CAPABILITY   NetworkSerbices
快速回复
限100 字节
 
上一个 下一个