[PyQt] headerDataChanged

Phil Thompson phil at riverbankcomputing.com
Thu Aug 20 09:04:53 BST 2009


On Thu, 20 Aug 2009 09:53:48 +0200, Mads Ipsen <mpi at comxnet.dk> wrote:
> Hi,
> 
> How do I emit the signal headerDataChanged in PyQt when implementing  
> the method
> setHeaderData() for a QAbstractTableModel?
> 
> The C++ syntax is
> 
>   emit headerDataChanged(orientation, section, section);
> 
> and the C++ definition of the signal reads
> 
>   void QAbstractItemModel::headerDataChanged ( Qt::Orientation 
> orientation, int first, int last )
> 
> but I don't know how to convert that to Python syntax.

Old API...

model.emit(SIGNAL('headerDataChanged(Qt::Orientation, int, int)'),
orientation, section, section)

New API...

model.headerDataChanged.emit(orientation, section, section)

Phil


More information about the PyQt mailing list