[Qt-interest] QWidget and QThread ?

Patric userqt at gmail.com
Fri Jun 5 12:11:02 CEST 2009


Well, I have an application. With tabs. Every tab have some fields and every 
tab is different widget, created with QT Designer. I use the multiple 
inheritance approach here.

The GUI is generated from the main thread. But I want the data in each tab 
(i.e. the fields in the tabs) to be managed by different threads, so the GUI 
not freeze if there is a problem or a slower operation.
And I'm wondering how to design this situation. It's all about.

I didn't know I can't multiple inherite QObject.

Regards,
Patric


----- Original Message ----- 
From: "Sean Harmer" <sean.harmer at maps-technology.com>
To: <qt-interest at trolltech.com>
Sent: Friday, June 05, 2009 1:03 PM
Subject: Re: [Qt-interest] QWidget and QThread ?


> Hi,
>
> On Friday 05 Jun 2009 10:56:35 Patric wrote:
>> Hi all,
>> I have a form, which i generate in a widget using the multiple 
>> inheritance
>> approach. I need a thread that operates on the data of this widget. I'm
>> wondering, is it a good idea to make my widget thread also (i.e. multiple
>> inheritance from QWidget and QThread), so it'll be more convinient to
>> operate on the data. What do you think about it ?
> In general no. You can only inherit from QObject once and both QWidget and
> QThread are derived from QObject.
>
> Also all GUI operations must be performed in the main thread (the one in 
> which
> QApplication lives).
>
> I would go even further and suggest that you redesign your application to
> separate out the data and processing side from the GUI side. It will make
> things cleaner in the long run.
>
> What is it you are trying to achieve? We may be able to give you some 
> nudges
> in suitable directions?
>
> Cheers,
>
> Sean
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus 
> signature database 4098 (20090522) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
> 


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4098 (20090522) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com






More information about the Qt-interest-old mailing list