[PyQt] Qt4/Qt5 incompatible results of QTableWidget.selectedItems()?

Andreas Pakulat apaku at gmx.de
Tue Jul 2 19:38:28 BST 2013


Hi,

Qt makes no guarantee on the order of returned items, it merely guarantee's
that all items that are selected are returned in a list. There's no
incompatibility, just a change in a behaviour that is not explicitly
defined.

Andreas


On Tue, Jul 2, 2013 at 6:31 PM, T.N.T. <tnt at banza.net> wrote:

> Hello
>
> When I have a QTableWidget with the following settings:
>
>
>   tw.setColumnCount(2)
>   tw.setSelectionBehavior(QtGui.**QAbstractItemView.SelectRows)
>
> and say I have selected the first two rows, then tw.selectedItems()
> returns a list of 4 items.
>
> Now in PyQt4 compiled with Qt4 the order is:
>
>  [ c0_r0, c0_r1, c1_r0, c1_r1 ]
>
> but compiled with Qt5:
>
>  [ c0_r0, c1_r0, c0_r1, c1_r1 ]
>
>
> Regards, T.
> ______________________________**_________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.**com/mailman/listinfo/pyqt<http://www.riverbankcomputing.com/mailman/listinfo/pyqt>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20130702/c1d0bd58/attachment.html>


More information about the PyQt mailing list