[Qt-interest] [MVC] Can signals connect / disconnect dynamically to reduce overhead on GUI thread?
Thomas McGuire
thomas.mcguire at kdab.com
Tue Nov 29 08:50:33 CET 2011
Hi,
On Tuesday 29 November 2011 06:05:25 Ed Sutton wrote:
> I am seeking design advice.
>
> My GUI is similar to the Windows File or Nautilus file explorer with a
> split windows interface; the left-pane selects the item to browse and the
> right-pane displays views of static and dynamic data. There could be
> hundreds of network devices in the left-pane tree view. My concern is the
> overhead of all these signal callbacks will overwhelm the GUI performance
> if connected to all of them. Can signals be connected to and disconnected
> dynamically to reduce the callback overhead on the GUI thread?
>
> [..]
>
> I am thinking I should use the Model View Controller (MVC) pattern. I am
> just not sure if the Qt disconnect is meant to be used this way?
Using the model view framework in Qt is a good idea. This will solve your
problem automatically, since there is just a single signal when an item is
clicked, in your case that would be QTreeView::clicked(const QModelIndex &).
So there is one single signal for all items, so no overhead related to too
many connections.
Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3637 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20111129/e24e6e4d/attachment.bin
More information about the Qt-interest-old
mailing list