QNetworkReply没有在Windows中接收数据但在Linux中工作

时间:2014-10-08 21:43:42

标签: c++ json windows qt bitcoin

在Linux和Mac OS X Qt上,钱包构建完美且有效。在Windows上,Qt wallet构建,但Coinbase API调用(提取btc_gbp价格数据)不起作用。

完整资源here

//Coinbase API
const QString apiCoinbasePrice = "https://api.coinbase.com/v1/currencies/exchange_rates";

// THE CALL
void PoolBrowser::coinbasePrice(QNetworkReply* response)
{
mValue jsonResponse = new mValue();
QString apiResponse = response->readAll();

//Make sure the response is valid
if(!read_string(apiResponse.toStdString(), jsonResponse)) { return; }

mObject jsonObject = jsonResponse.get_obj();

_dBtcPriceCurrent =  QString::fromStdString(getPairValue(jsonObject,  "btc_to_gbp").get_str()).toDouble();

updateLabel(ui->lblOverviewBtcGbpPrice,
            _dBtcPriceCurrent,
            _dBtcPriceLast,
            QString::fromUtf8("£"),
            2);

_dBtcPriceLast = _dBtcPriceCurrent;
_dScPriceLast = _dBtcPriceCurrent * _bittrexMarketSummary->getLastCurrent(double());

0 个答案:

没有答案