[PySide] QStandardItemModel vs QAbstractItemModel

Frank Rueter | OHUfx frank at ohufx.com
Tue Jan 12 21:32:04 CET 2016


Thanks Sam,

in PySide there is no QVariant anyway, so that's all good.
I started yesterday trying to re-write what I already had going with 
QStandardItemModel using QAbstractTableModel, but it seems there is a 
lot I have to re-invent that QStandardTableModel already offered. I will 
keep going for learning purposes but would be very interested in any 
other opinions.

Cheers,
frank

On 13/01/16 9:29 am, Fries, Samuel wrote:
> Hey Frank,
>
> I'm using QAbstractItemModel as the parent class in a couple of my MVC 
> components. It was pretty easy to implement, and works nicely. I wrote 
> the code using it a while back, so I don't really recall the impetus 
> for not using QStandardItemModel (I'd wager it was my general 
> preference to avoid QVariant).
>
> -Sam Fries
> AIMS Group, LLNL
>
> From: PySide <pyside-bounces at qt-project.org 
> <mailto:pyside-bounces at qt-project.org>> on behalf of Frank 
> Rueter|OHUfx <frank at ohufx.com <mailto:frank at ohufx.com>>
> Organization: OHUfx
> Date: Tuesday, January 12, 2016 12:22 PM
> To: PySide <PySide at qt-project.org <mailto:PySide at qt-project.org>>
> Subject: Re: [PySide] QStandardItemModel vs QAbstractItemModel
>
> Anybody still on this list in 2016? :)
>
> On 11/01/16 9:48 am, Frank Rueter | OHUfx wrote:
>> Hi,
>>
>> I am building a spreadsheet widget for custom data and will need many 
>> custom editors and item delegates.
>> The amount of items will potentially be in the 100,000s and a lot of 
>> filtering will be going on.
>>
>> I started using the QStandardItemModel and so far things are working 
>> fine, but I haven't implemented the delegates or editors yet, and I 
>> will also have to override the data()/setData().
>>
>> I'm wondering if I should switch to using the QAbstractItemModel 
>> before proceeding but can't make up my mind.
>> I am using some of the QStandardItemModel's method's, such as clear() 
>> and item() and setItem(), but I guess those are easy to re-implement.
>>
>> The docs say that one should consider using QAbstractItemModel for 
>> efficiency and flexibility, but I am struggling to make an educated 
>> decision because I haven't used model/views often enough yet to know 
>> about all the pros and cons.
>>
>> Any advice on how to make that decision would be much appreciated. 
>> I'd hate to finish writing the code only to find out that it's too 
>> slow for large data sets, and then re-jig everything to use the 
>> QAbstractItemModel.
>>
>>
>> Thanks,
>> frank
>>
>> -- 
>> ohufxLogo 50x50 <http://www.ohufx.com> 	*vfx compositing 
>> <http://ohufx.com/index.php/vfx-compositing> | *workflow 
>> customisation and consulting 
>> <http://ohufx.com/index.php/vfx-customising>**
>>
>>
>>
>> _______________________________________________
>> PySide mailing list
>> PySide at qt-project.orghttp://lists.qt-project.org/mailman/listinfo/pyside
>
> -- 
> ohufxLogo 50x50 <http://www.ohufx.com> 	*vfx compositing 
> <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation 
> and consulting <http://ohufx.com/index.php/vfx-customising>**
>

-- 
ohufxLogo 50x50 <http://www.ohufx.com> 	*vfx compositing 
<http://ohufx.com/index.php/vfx-compositing> | *workflow customisation 
and consulting <http://ohufx.com/index.php/vfx-customising>* *

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20160113/b6de04e9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ohufxLogo_50x50.png
Type: image/png
Size: 2666 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20160113/b6de04e9/attachment.png>


More information about the PySide mailing list