-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
224 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .motion import motion, track | ||
from .util import * | ||
from .util import * | ||
from .guiConnector import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
from PyQt5 import QtCore | ||
|
||
|
||
class tableGuiConnector(QtCore.QAbstractTableModel): | ||
def __init__(self, myTab): | ||
self.__internalTable = myTab | ||
super().__init__() | ||
|
||
def rowCount(self, parent): | ||
return len(self.__internalTable) | ||
|
||
def columnCount(self, parent): | ||
return int(2) | ||
|
||
def data(self, index, role): | ||
if role != QtCore.Qt.DisplayRole: | ||
return QtCore.QVariant() | ||
|
||
return self.__internalTable[index.row()][index.column()] | ||
|
||
def headerData(self, section, orientation, role): | ||
if role != QtCore.Qt.DisplayRole: | ||
return QtCore.QVariant() | ||
|
||
if orientation == QtCore.Qt.Horizontal: | ||
if section == 0: | ||
return "Position" | ||
else: | ||
return "Height" | ||
if orientation == QtCore.Qt.Vertical: | ||
return section | ||
|
||
def flags(self,index): | ||
return QtCore.Qt.ItemIsEnabled|QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEditable | ||
|
||
def setData(self,index,value,role): | ||
if role!=QtCore.Qt.EditRole: | ||
return False | ||
try: | ||
self.__internalTable[index.row()][index.column()]=float(value) | ||
except: | ||
return False | ||
return True | ||
|
||
def insertRows(self, row, count=1, parent=QtCore.QModelIndex()): | ||
self.beginInsertRows(parent,row,row+count-1) | ||
|
||
for i in range(0,count): | ||
self.__internalTable.insert(row,[0]*2) | ||
|
||
self.endInsertRows() | ||
|
||
return True | ||
|
||
def removeRows(self, row, count=1, parent=QtCore.QModelIndex()): | ||
self.beginRemoveRows(parent,row,row+count-1) | ||
|
||
for i in range(row,row+count): | ||
self.__internalTable.pop(i) | ||
|
||
self.endRemoveRows() | ||
|
||
return True | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.