Saturday 15 September 2012

c++ - Why does my edited WtWithQt example crash? -


I'm developing an application using Qt for the main argument and Wt for the user interface.

Although I came to a problem I could not solve it I applied it on wtwithqt example.

I have just changed the "Getit" function to call Asynchronous instead of sync instead of sync.

App crash

edit : Actually it actually crashes when it comes to "HelloApplication :: doGreet (Const QString & amp;; Qname) "

 Enter image details here Image:

Maybe there is something with the origin of the action that begins with the QT Event loop?

Here is the code.

  #include "HelloApplication.h" #include "QtObject.h" # Include & lt; QDebug & gt; # Include & lt; QThread & gt; QtObject :: QtObject (HelloApplication * wt, QObject * parent): QObject (parent), wt_ (wt) {} zero QtObject :: passGreet (const QString and name) {// Q_EMIT greet (name); Quettaobic :: Invoicemath (this, "Hello", QT :: Queued connection, QARAG (Best String, Name)); } Zero QtObject :: doGreet (const QString and name) {wt _-> DoGreet (name); }   

The remaining unchanged code is here:

Thanks for any help in advance!

What you see here is a Qtith that updates the Wt widget tree, and that WApplication: : Does not receive UpdateLock. In addition to ensuring that you have unique access to the widget tree, the update lock also sets some local local storage, and the unavailable TLS (WApplication :: instance ()) is caused by crashing your application.

The required locking mechanism may be complex - using WServer :: post () to avoid deadlock may be easy.

No comments:

Post a Comment