Note that there are some explanatory texts on larger screens.

plurals
  1. POQTableView issue with selectionModel()
    primarykey
    data
    text
    <p>I have a problem with my call to QTableView.selectionModel(). I instanciate my QTableView in another class, then when I open a new project and need to fill in my view I call a function fillGrid() in which I get the data among other things. This is also where I call the selectionModel() method.</p> <p>Everything goes well the first time I call it. But if I try to call it again in the same instance of the program then it gives me the following error : </p> <blockquote> <p>TypeError: 'QItemSelectionModel' object is not callable</p> </blockquote> <p>my function fillGrid looks like :</p> <pre><code>def fillGrid(self): self.infos = select.getInfosProject(self.parent.db, self.parent.currentProj) self.getData() header = ["id","hidden","state","filename","asset-shot name","task","buffer","pass","camera","version","user","date","deps","check","comment","start frame","end frame","missing frames","edit start frame","edit end frame"] self.model = SequenceGridModel(self.data, header, self) self.setModel(self.model) self.hideColumn(0) self.hideColumn(1) font = QtGui.QFont("Verdana", 8) self.setFont(font) vh = self.verticalHeader() vh.setVisible(False) hh = self.horizontalHeader() hh.setStretchLastSection(True) self.resizeColumnsToContents() self.setSelectionBehavior(QtGui.QTableView.SelectRows) self.selectionModel = self.selectionModel() self.connect(self.selectionModel, QtCore.SIGNAL("selectionChanged(QItemSelection, QItemSelection)"), self.getSelection) self.setSortingEnabled(True) self.setEditTriggers(QtGui.QAbstractItemView.CurrentChanged) self.viewport().installEventFilter(self) self.setItemDelegateForColumn(13,ComboBoxDelegate(self, self.checkValues)) self.setColumnWidth(13, 64) </code></pre> <p>Any idea why this is happening ? Thanks in advance</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload