My application is based on the wtwithqt example, and I am trying to
update the application state from the Qt thread that the example uses.
My problem is that when I call WApplication::triggerUpdate,
modifiedWithoutEvent_ is false so no updates are sent to the browser. My
function to update the application state looks like this:
void MyWidget::callback()
{
Wt::WApplication::UpdateLock lock(app);
if (lock)
{
// update application state here...
app->triggerUpdate();
}
}
The wtwithqt example code creates a Qt thread and calls
WApplication::attachThread, so in my callback, the UpdateLock
constructor finds that the session already has a handler and returns
without initialising the UpdateLockImpl member, and it is in the
constructor of UpdateLockImpl that modifiedWithoutEvent_ is set to true.
For comparison, I examined the serverpush example code. This uses a
boost thread, which is not attached to the application, so it constructs
the UpdateLockImpl as expected. If I remove the call to attachThread
from the wtwithqt example, my application will crash in layout code
called from my overridden WQApplication::create function because
WApplication::instance returns a null pointer. If I try to acquire the
update lock so I can get a valid pointer to WApplication, it gets stuck
in a loop in the UpdateLockImpl constructor trying to get the lock.
I can't think of anything else I can do to make this work. Am I missing
something here?
Tristan Bonsall
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest