Mixing Qt with Tcl (missing event processing ?)



Hi,

i am working a Qt application that needs to work with some existing
TCL code.
The application works in most cases except when TCL brings up the
dialog
message box. At this point the whole application hung.

The communication code between Qt and TCL is a modified code of
tclXtNotification.cpp from the TCL package. Here is the code changed
that I made.
I think the events are not processing in right sequence or not being
process at all.

If I replace the Qt process event with the
XtAppProcessEvent(notifier.appContext, XtIMAll);
everything works fine.

Due to platform porting, i need to get rid all X related code so
this routine call must go.

I would greatly appreciate it, if anyone can tell what i did wrong and
how to fix it.

Madison


static int
WaitForEvent(
Tcl_Time *timePtr) /* Maximum block time, or NULL. */
{
int timeout = 0;

if (timePtr)
{
timeout = timePtr->sec * 1000 + timePtr->usec / 1000;
}

processEvent (timeout);

return 1;
}

static void
SetTimer(timePtr)
Tcl_Time *timePtr; /* Timeout value, may be NULL. */
{
long timeout;

if (notifier.currentTimeout != 0)
{
stopTimer();
}

if (timePtr)
{
timeout = timePtr->sec * 1000 + timePtr->usec / 1000;
startTimer (timeout);

notifier.currentTimeout = 1;
}
else
{
notifier.currentTimeout = 0;
}
}

// this routine is called by the QTimer timeout handler
void
timeoutHandler ()
{
notifier.currentTimeout = 0;

Tcl_ServiceAll();
}

// Here is the code that interface with Qt

void
processEvent (int timeout)
{
qApp->processEvents (timeout);
}

//----------------- start QTimer
void
startTimer (int timeOut_)
{
_proxy.startTimer (timeOut_);
}

// --------------- stop QTimer
void
stopTimer ()
{
_proxy.stopTimer ();
}

.



Relevant Pages

  • XINETD
    ... have read timeout in place so it doesn't block forever. ... set outbuf ... How can this be implemented in TCL? ...
    (comp.lang.tcl)
  • [PATCH] backlight dimmer
    ... other attributes (britness levels & timeout): ... * GNU General Public License for more details. ... +static inline int timeout_jif2sec ... +static inline void touch_latest ...
    (Linux-Kernel)
  • Re: [PATCH] backlight dimmer
    ... * timeout.h - simple timeout ... * GNU General Public License for more details. ... +static inline int timeout_jif2sec ... +static inline void touch_latest ...
    (Linux-Kernel)
  • [Fwd: Corrections please ...]
    ... static inline void init_completion ... * This will wake up a single thread waiting on this completion. ... * interruptible and there is no timeout. ... But there is a timeout in jiffies. ...
    (Linux-Kernel)
  • Re: Own implementation of multithread
    ... Beyond that I agree with Alexandre andwonder if instead you can make the main controlling flow of control Tcl, ... Each interpreter will need to eval a script. ... void * func{ ...
    (comp.lang.tcl)