Skip to content

Commit

Permalink
Merge pull request vnpy#2777 from vnpy/dev
Browse files Browse the repository at this point in the history
[Mod] import from QtWidgets instead of QtGui
  • Loading branch information
vnpy authored Dec 22, 2020
2 parents 4988649 + 961900e commit f8f76e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ peewee
pymysql
psycopg2
mongoengine
numpy
numpy==1.19.3
pandas
matplotlib
seaborn
Expand Down
8 changes: 5 additions & 3 deletions vnpy/app/portfolio_manager/ui/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ def update_trades(self) -> None:
""""""
trades = self.main_engine.get_all_trades()
for trade in trades:
self.monitor.update_trade(trade)
# Ignore trade with no order reference
if hasattr(trade, "reference"):
self.monitor.update_trade(trade)

def get_portfolio_item(self, reference: str) -> QtWidgets.QTreeWidgetItem:
""""""
Expand Down Expand Up @@ -315,12 +317,12 @@ def set_filter(self, filter: str) -> None:
self.hideRow(row)


class TreeDelegate(QtGui.QStyledItemDelegate):
class TreeDelegate(QtWidgets.QStyledItemDelegate):
""""""

def sizeHint(
self,
option: QtGui.QStyleOptionViewItem,
option: QtWidgets.QStyleOptionViewItem,
index: QtCore.QModelIndex
) -> QtCore.QSize:
""""""
Expand Down

0 comments on commit f8f76e6

Please sign in to comment.