查看完整版本: [-- ubuntu qt编程局域网通信问题 --]

QTCN开发网 -> Qt 作品展 -> ubuntu qt编程局域网通信问题 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

alizi2010 2015-02-08 22:46

ubuntu qt编程局域网通信问题


代码:
xchat->bind( QHostAddress::QHostAddress(getIP()), xport );
xchat->writeDatagram(data,data.length(),QHostAddress::QHostAddress(xpasvuserip), 45456);
错误:
/home/mohammed/Desktop/chat2015.2.5/chat.cpp:280: error: cannot call constructor 'QHostAddress::QHostAddress' directly [-fpermissive]

如上编码会出现无法代用构造函数的错误,请问哪位大神帮忙解决一下

退避九舍 2015-02-08 22:49
你觉得 QHostAddress::QHostAddress(xpasvuserip) 这样写对吗?

alizi2010 2015-02-09 12:43
退避九舍:你觉得 QHostAddress::QHostAddress(xpasvuserip) 这样写对吗? (2015-02-08 22:49) 

我刚刚学qt 不太了解,,请你请教一下

罗彬853 2017-01-16 13:28
QHostAddress address (ui->tableWidget->item(index.row(),2)->text())
udpSocket->writeDatagram(data, data.length(), address, port);


查看完整版本: [-- ubuntu qt编程局域网通信问题 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled