1
我試圖使用QOAuth卻收到以下錯誤:'QOAuth ::接口和QOAuth ::接口::運算符=(常量QOAuth ::接口和)' 是私有
錯誤:「QOAuth ::接口& QOAuth ::接口::運算符=(const的QOAuth ::接口&)」是私人
我的源代碼如下:
service.h
// ...
class Service : public QObject
{
Q_OBJECT
// ...
private:
QOAuth::Interface *qoauth;
};
// ...
service.cpp
#include "service.h"
Service::Service(QObject *parent) :
QObject(parent)
{
*qoauth = new QOAuth::Interface;
}
QString Service::getAuthorizeUrl(QString consumerKey, QString consumerSecret){
// set the consumer key and secret
qoauth->setConsumerKey(consumerKey);
qoauth->setConsumerSecret(bytes);
// ...
}
void Service::accessToken(QString url) {
// send a request to exchange Request Token for an Access Token
QOAuth::ParamMap reply = qoauth->accessToken(url, QOAuth::POST, m_token, m_tokenSecret, QOAuth::HMAC_SHA1);
// ...
}
我不明白指針不夠,也可能是原因...提前
感謝。
謝謝你,對不起已故的答覆。我試過'qoauth = new QOAuth :: Interface',然後編譯器抱怨說'' - >'的基本操作數有非指針類型'QOAuth :: Interface'「。 'qoauth-> setConsumerKey(consumerKey);'如果我改變它的點運算符和編譯器說「沒有匹配函數調用'QOAuth :: Interface :: setConsumerKey(QString&)'」。哪個是對的...? – 2012-02-28 08:48:41