Fix bug #164 - __len__() function missing in QItemSelection.
Reviewed by Renato Araujo <renato.filho@openbossa.org> Reviewed by Hugo Parente <hugo.lima@openbossa.org> Reviewed by Lauro Moura <lauro.neto@openbossa.org>
This commit is contained in:
parent
915a34b39f
commit
c7199a6ecb
2 changed files with 23 additions and 0 deletions
|
|
@ -693,6 +693,11 @@
|
||||||
<modify-function signature="operator+=(const QItemSelectionRange&)" remove="all"/>
|
<modify-function signature="operator+=(const QItemSelectionRange&)" remove="all"/>
|
||||||
<modify-function signature="operator<<(const QList<QItemSelectionRange>&)" remove="all"/>
|
<modify-function signature="operator<<(const QList<QItemSelectionRange>&)" remove="all"/>
|
||||||
<modify-function signature="operator<<(QItemSelectionRange)" remove="all"/>
|
<modify-function signature="operator<<(QItemSelectionRange)" remove="all"/>
|
||||||
|
<add-function signature="__len__">
|
||||||
|
<inject-code class="target" position="beginning">
|
||||||
|
return %CPPSELF.count();
|
||||||
|
</inject-code>
|
||||||
|
</add-function>
|
||||||
</value-type>
|
</value-type>
|
||||||
<value-type name="QMatrix">
|
<value-type name="QMatrix">
|
||||||
<extra-includes>
|
<extra-includes>
|
||||||
|
|
|
||||||
18
tests/qtgui/qitemselection_test.py
Normal file
18
tests/qtgui/qitemselection_test.py
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from helper import UsesQApplication
|
||||||
|
from PySide.QtGui import QItemSelection, QStandardItemModel
|
||||||
|
|
||||||
|
class QItemSelectionTest(UsesQApplication):
|
||||||
|
def testLen(self):
|
||||||
|
model = QStandardItemModel(2, 2)
|
||||||
|
model.insertRow(0)
|
||||||
|
model.insertRow(1)
|
||||||
|
model.insertColumn(0)
|
||||||
|
model.insertColumn(1)
|
||||||
|
selection = QItemSelection(model.index(0,0), model.index(1,1))
|
||||||
|
self.assertEqual(len(selection), 1)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue