maddog_fr
17th November 2010, 15:22
Hi there. I am blocked on a problem since nearly two days i dont find any clue to progress. I am using libQXt to create a small webservice that will send back json string to a webbrowser client. The webservice work well but i have a problem with accessing private data from my class.
class WebService : public QxtWebServiceDirectory {
Q_OBJECT
public:
WebService(QxtAbstractWebSessionManager * sm , QObject * parent = 0);
virtual ~WebService();
addString(const QString& json);
protected:
void indexRequested (QxtWebRequestEvent *event);
private:
QStringList Gadgets;
};
case 1 :
if in the constructor I fill Gadgets with strings;
then i access Gadget from indexRequested (wich is called when a request is done by a client) I can access Gadgets content.
case 2: from outside of WebService I call the public method addString to add strings to Gadgets and in this case Gadgets seems to be empty when accessed from indexRequested
any ideas where it come from ? what I am missing ?
thx
[EDIT] See attachment debug1.jpg is the QStringList content while WebService->getGadget() is called (by a singleshot timer from outside the class).
debug2.jpg is the content of the list when called from webbrowser >> indexRequested()
class WebService : public QxtWebServiceDirectory {
Q_OBJECT
public:
WebService(QxtAbstractWebSessionManager * sm , QObject * parent = 0);
virtual ~WebService();
addString(const QString& json);
protected:
void indexRequested (QxtWebRequestEvent *event);
private:
QStringList Gadgets;
};
case 1 :
if in the constructor I fill Gadgets with strings;
then i access Gadget from indexRequested (wich is called when a request is done by a client) I can access Gadgets content.
case 2: from outside of WebService I call the public method addString to add strings to Gadgets and in this case Gadgets seems to be empty when accessed from indexRequested
any ideas where it come from ? what I am missing ?
thx
[EDIT] See attachment debug1.jpg is the QStringList content while WebService->getGadget() is called (by a singleshot timer from outside the class).
debug2.jpg is the content of the list when called from webbrowser >> indexRequested()