def __init__(self): QtWidgets.QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) # data = pd.read_csv("../database/SPYtoDF1.csv") data = dataTable.dataSelect(callSw=True, putSw=True) self.model = TableModel(data) self.quoteTableView.setModel(self.model) self.quoteTableView.setDragEnabled(True) # self.quoteTableView.setAcceptDrops(True) self.quoteTableView.setSelectionBehavior(QAbstractItemView.SelectRows) self.quoteTableView.setDragDropOverwriteMode(False) self.quoteTableView.setSelectionMode(QAbstractItemView.SingleSelection) strategyLeg = pd.DataFrame() self.model = TableModel(strategyLeg) self.strategyTableView.setModel(self.model) self.strategyTableView.setDragEnabled(True) self.strategyTableView.setAcceptDrops(True) self.strategyTableView.setSelectionBehavior( QAbstractItemView.SelectRows) self.strategyTableView.setDragDropOverwriteMode(False) self.calls_push_button.clicked.connect(self.callsputsBthState) self.puts_push_button.clicked.connect(self.callsputsBthState)
def putsBtnHandler(self): if self.puts_push_button.isChecked(): print("calls_push_button.isChecked") data = dataTable.dataSelect(False, True) self.model = TableModel(data) self.jktableView.setModel(self.model) else: # self.putsTable() print("PutsPushButton.clicked")
def callsputsBtnHnadler(self): print("In: callsputsBtnHnadler(self)") if self.calls_push_button.isChecked( ) and not self.puts_push_button.isChecked: print("dataTable.dataSelect(True, False)") data = dataTable.dataSelect(True, False) self.model = TableModel(data) self.jktableView.setModel(self.model) elif self.puts_push_button.isChecked( ) and not self.calls_push_button.isChecked: print("dataTable.dataSelect(False, True)") dataTable.dataSelect(True, False) data = dataTable.dataSelect(False, True) self.model = TableModel(data) self.jktableView.setModel(self.model) else: print("dataTable.dataSelect(False, True)") data = dataTable.dataSelect(True, True) self.model = TableModel(data) self.jktableView.setModel(self.model)
def callsputsBthState(self): print("In callsputsBthState(self)") self.callsCheckedSw = False self.putsCheckedSw = False # data = dataTable.dataSelect(callSw=True,putSw=True) if self.calls_push_button.isChecked(): self.callsCheckedSw = True if self.puts_push_button.isChecked(): self.putsCheckedSw = True print("going to print") print("self.callsChecked=", self.callsCheckedSw) print(" self.putsChecked=", self.putsCheckedSw) data = dataTable.dataSelect(callSw=self.callsCheckedSw, putSw=self.putsCheckedSw) self.model = TableModel(data) self.quoteTableView.setModel(self.model)