427 # Force update of preview view |
427 # Force update of preview view |
428 idxStart = self.index(0, 0, QModelIndex()) |
428 idxStart = self.index(0, 0, QModelIndex()) |
429 idxEnd = self.index(0, 2, QModelIndex()) |
429 idxEnd = self.index(0, 2, QModelIndex()) |
430 self.dataChanged.emit(idxStart, idxEnd) |
430 self.dataChanged.emit(idxStart, idxEnd) |
431 |
431 |
432 def index(self, row, column, parent=QModelIndex()): |
432 def index(self, row, column, parent=None): |
433 """ |
433 """ |
434 Public Qt slot to get the index of item at row:column of parent. |
434 Public Qt slot to get the index of item at row:column of parent. |
435 |
435 |
436 @param row number of rows |
436 @param row number of rows |
437 @type int |
437 @type int |
438 @param column number of columns |
438 @param column number of columns |
439 @type int |
439 @type int |
440 @param parent the model parent |
440 @param parent the model parent (defaults to None) |
441 @type QModelIndex |
441 @type QModelIndex (optional) |
442 @return new model index for child |
442 @return new model index for child |
443 @rtype QModelIndex |
443 @rtype QModelIndex |
444 """ |
444 """ |
|
445 if parent is None: |
|
446 parent = QModelIndex() |
|
447 |
445 if not self.hasIndex(row, column, parent): |
448 if not self.hasIndex(row, column, parent): |
446 return QModelIndex() |
449 return QModelIndex() |
447 |
450 |
448 return self.createIndex(row, column, None) |
451 return self.createIndex(row, column, None) |
449 |
452 |
456 @return new model index for parent |
459 @return new model index for parent |
457 @rtype QModelIndex |
460 @rtype QModelIndex |
458 """ |
461 """ |
459 return QModelIndex() |
462 return QModelIndex() |
460 |
463 |
461 def columnCount(self, parent=QModelIndex()): # noqa: U100 |
464 def columnCount(self, parent=None): # noqa: U100 |
462 """ |
465 """ |
463 Public Qt slot to get the column count. |
466 Public Qt slot to get the column count. |
464 |
467 |
465 @param parent the model parent (unused) |
468 @param parent the model parent (defaults to None) (unused) |
466 @type QModelIndex |
469 @type QModelIndex (optional) |
467 @return number of columns |
470 @return number of columns |
468 @rtype int |
471 @rtype int |
469 """ |
472 """ |
470 return 1 |
473 return 1 |
471 |
474 |
472 def rowCount(self, parent=QModelIndex()): # noqa: U100 |
475 def rowCount(self, parent=None): # noqa: U100 |
473 """ |
476 """ |
474 Public Qt slot to get the row count. |
477 Public Qt slot to get the row count. |
475 |
478 |
476 @param parent the model parent (unused) |
479 @param parent the model parent (defaults to None) (unused) |
477 @type QModelIndex |
480 @type QModelIndex (optional) |
478 @return number of rows |
481 @return number of rows |
479 @rtype int |
482 @rtype int |
480 """ |
483 """ |
481 return 4 |
484 return 4 |
482 |
485 |