[PySide] Qabstracttablemodel supplying multiple Qtableviews.

1+1=2 dbzhang800 at gmail.com
Wed Feb 19 09:27:11 CET 2014


Hi, you can give a try to QAbstractProxyModel


On Fri, Feb 14, 2014 at 5:07 PM, Andrew Nelson <andyfaff at gmail.com> wrote:

> Dear list,
> I have a single dataset that I want to display subsets of in three
> different Qtableview's.  At the moment I have 3 different model
> classes, one for each Qtableview, that extend Qabstracttablemodel.
> However, editing these Qtableview's causes the model (dataset) to grow
> and I have to insert rows.  It is not a problem to grow the model that
> underlies that Qtableview, but how do I inform the two other model
> classes/table views that the dataset has grown?
> It seems wasteful to me to have three different Qabstracttablemodel's,
> when a single Qabstracttablemodel should suffice for all three
> Qtableview's.  The dataset that is displayed in each of the datasets
> is the same, it's just that the views are looking at different subsets
> of the same thing.  It seems to me that if I could know which
> Qtableview is querying the Qabstracttablemodel, then I would only need
> to have one model class.  It would then be easy to grow the models
> when the dataset is edited.
>
> Can anyone provide suggestions of the cleanest way of implementing this
> system?
>
> cheers,
> Andrew.
> --
> _____________________________________
> Dr. Andrew Nelson
>
>
> _____________________________________
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20140219/e483e576/attachment.html>


More information about the PySide mailing list