I’m trying to use QOAuth but received following error:
error: ‘QOAuth::Interface& QOAuth::Interface::operator=(const QOAuth::Interface&)’ is private
My source code is as follows:
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);
// ...
}
I don’t understand pointer enough and it may be the cause…
Thanks in advance.
*qoauth = new QOAuth::Interface;is not correct sincenewreturns a pointer to the object it should beqoauth = new QOAuth::Interface;