[Qt-interest] Problem with QtextCursor and Selecting Text

Girish Ramakrishnan girish at forwardbias.in
Wed Dec 22 09:13:50 CET 2010


Hi,
Signal-slot connections across threads are achieved using normal event
passing. In other words, firing of a signal in one thread is not
synchronized with the slot invocation in the other thread. This is
probably the reason why you are seeing it go out of sync.

That said, if you see that highlight_text being called for 'every'
word event immediately, where is the question of losing sync? Maybe
you should check when exactly it goes out of sync by seeing it read
the entire document.

Girish

On Tue, Dec 21, 2010 at 8:08 PM, Soumen Banerjee <soumen08 at gmail.com> wrote:
> Hi,
> Yes, the espeak events are generated in another thread. Also, every
> time a word event is seen, highlight_next() is called (due to the
> connection). If it is counting the words correctly, I cant see why it
> is losing sync with the reading.
> Regards,
> Soumen
>
> On Tue, Dec 21, 2010 at 2:08 PM, Girish Ramakrishnan
> <girish at forwardbias.in> wrote:
>> Hi,
>>
>> On Tue, Dec 21, 2010 at 11:57 AM, Soumen Banerjee <soumen08 at gmail.com> wrote:
>> 8< snip
>>
>>> Now, as I use the app, the selection begins to lag behind the text
>>> actually being read. Ive tried making a counter to see if espeak is
>>> generating the word events correctly. The final wordcount does match
>>> the number of words in the text. I cant understand the reason for this
>>> lag.
>>
>> How do you synchronize the word events generated by espeak and the UI?
>> Are espeak events generated in a non-UI thread?
>>
>> Girish
>>
>



More information about the Qt-interest-old mailing list