[Qt-interest] QFile* threads

_h_ hiralsmaillist at gmail.com
Fri Jul 31 10:54:09 CEST 2009


Hi,
Can anybody explain, how following can be implemented in Qt...
- allow to stop QFile threads temporarily when the QFileDialog is
hidden and start them when QFileDialog shown again.

Thank you.

On Sat, Jul 25, 2009 at 2:06 AM, Malyushytsky, Alex<alex at wai.com> wrote:
> You got a good suggestion:
> "I'd suggest caching the QFileDialog info somewhere and when reopening one of them you'd just initialize it to the corresponding cache values."
>
> You  could store even location and size of the dialogs, so user would never even notice that a new instance was created.
> It is more efficient and elegant, than keeping all QFileDialog objects in the memory.
> Why would you not follow it?
>
> Regards,
>   Alex
>
>
>
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of _h_
> Sent: Friday, July 24, 2009 5:17 AM
> To: qt-interest at trolltech.com
> Subject: Re: [Qt-interest] QFile* threads
>
> Hi Thiago Macieira,
> Wouldn't it incure overhead?
> Is there any other alternative? Or is there any way Qt allows to stop
> the threads temporarily when the QFileDialog is hidden and start them
> when QFileDialog shown again ???
> I am not getting why threads are running when QFileDialog is hidden.
> Thank you.
>
> On Fri, Jul 24, 2009 at 5:21 PM, Thomas
> Dähling<t.daehling at googlemail.com> wrote:
>> I'd suggest caching the QFileDialog info somewhere and when reopening
>> one of them you'd just initialize it to the corresponding cache
>> values.
>>
>> 2009/7/24 _h_ <hiralsmaillist at gmail.com>:
>>> Hi Thiago Macieira,
>>> Thanks for information.
>>> Can you please suggest how can I reduce these many threads?
>>> My application uses more than 20 QFileDialog object pointers (why
>>> pointer? because I want to persist the directoy/file filters/file
>>> browsed info within that instance, so), and if I open and close all
>>> these file broswers one by one, then I can see about 20 threads
>>> running. So I wanted to reduce these many threads.
>>> Can you please suggest nice way to achieve this?
>>> Thank you.
>>>
>>>
>>>
>>> On Fri, Jul 24, 2009 at 4:50 PM, Thiago
>>> Macieira<thiago.macieira at trolltech.com> wrote:
>>>> Em Sexta-feira 24 Julho 2009, às 12:26:03, _h_ escreveu:
>>>>> Hi,
>>>>> In one of my qt application I am using multiple instance of
>>>>> QFileDialog by taking object pointer.
>>>>> When observing process stack of this application, it shows following...
>>>>>
>>>>> Thread 3 (Thread 183630768 (LWP 10648)):
>>>>> #0 0x008e348d in pthread_cond_wait@@GLIBC_2.3.2 ()
>>>>> #1 0x02a34178 in QWaitCondition::wait ()
>>>>> #2 0x06bbbced in QFileSystemModel::sort ()
>>>>> #3 0x02a335a0 in QThread::setPriority ()
>>>>> #4 0x008e0d78 in start_thread () from /lib/tls/libpthread.so.0
>>>>> #5 0x05e613fa in clone () from /lib/tls/libc.so.6
>>>>> Thread 2 (Thread 173140912 (LWP 10649)):
>>>>> #0 0x05e5a757 in ___newselect_nocancel () from /lib/tls/libc.so.6
>>>>> #1 0x02b55bbf in QEventDispatcherUNIX::select ()
>>>>> #2 0x02b56c50 in QEventDispatcherUNIXPrivate::doSelect ()
>>>>> #3 0x02b57117 in QEventDispatcherUNIX::processEvents ()
>>>>> #4 0x02b26b6d in QEventLoop::processEvents ()
>>>>> #5 0x02b26eed in QEventLoop::exec ()
>>>>> #6 0x02a30087 in QThread::exec ()
>>>>> #7 0x02b0b91e in QFSFileEngine::rmdir ()
>>>>> #8 0x02a335a0 in QThread::setPriority ()
>>>>> #9 0x008e0d78 in start_thread () from /lib/tls/libpthread.so.0
>>>>> #10 0x05e613fa in clone () from /lib/tls/libc.so.6
>>>>>
>>>>> Can you please let me know how can I stop these threads?
>>>>
>>>> Those threads are created by the QFileDialog -- more specifically, by
>>>> QFileSystemModel. You can't stop them.
>>>>
>>>> --
>>>> Thiago Macieira - thiago.macieira (AT) nokia.com
>>>>  Senior Product Manager - Nokia, Qt Software
>>>>     Sandakerveien 116, NO-0402 Oslo, Norway
>>>>
>>>> _______________________________________________
>>>> Qt-interest mailing list
>>>> Qt-interest at trolltech.com
>>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
> ---------------------------------------------------------------------------------------------------
> Weidlinger Associates, Inc. made the following annotations.
>
> "This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
>
> "Please consider our environment before printing this email."
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>




More information about the Qt-interest-old mailing list