Qt-interest Archive, March 2008
QTabWidget Slots and Signlas
Message 1 in thread
Hallo, I have a doubt about how are managed the connections between signals from a QThread and the Slots in a QTabWidget. I have a QTabWidget with 12 tabs, in each tad I have Widgets that are enabled and disabled constantly with a signal from a QThread. (Each widget in the tab has its own thread to be manipulated). My doubt is that if meanwhile the user is seeing one tab, the enabling and disabling of the rest of the widgets is still happening even when the user can't see them. If yes, does this means an increase of useless memory consumption and could this slow down the GUI? In each tab exist 8 widgets that are manipulated by a thread, so in the worst case, it could happen that 88 unecesary actions are running, becuase the user dont see them? Is that true? Do I need a function something like void myGUI::just_do_what_user_sees? Regards David
_________________________________________________________________
MSN Video.
http://video.msn.com/?mkt=es-es
Message 2 in thread
On Sunday 30 March 2008 11:41:26 David RodrÃguez wrote:
> exist 8 widgets that are manipulated by a thread, so in the worst case, it
> could happen that 88 unecesary actions are running, becuase the user dont
> see them? Is that true?
yes. they are not receiving paintEvent, but the signals are delivered anyway.
> Do I need a function something like void
> myGUI::just_do_what_user_sees? Regards David
for once you dont need to use threads. But since you won't listen anyway:
enable and disable connections while a widget is visible and not.
If you're lazy, use bool QObject::blockSignals ( bool block ) otherwise have a
proper set of connects and disconnects.
Anyway, just dont use threads for timers. there is QTimer which is pretty
cheap.
--
[ signature omitted ]