Skip to content

Commit

Permalink
Quotes dialog was improved with FloatDelegate for Quote column (to pr…
Browse files Browse the repository at this point in the history
…otect from wrong inputs)
  • Loading branch information
titov-vv committed Mar 26, 2024
1 parent daf9589 commit 9009b89
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jal/widgets/reference_dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ def __init__(self, table, parent_view):
self._asset_delegate = None
self._timestamp_delegate = None
self._lookup_delegate = None
self._float_delegate = None
self.setRelation(self.fieldIndex("currency_id"), QSqlRelation("currencies", "id", "symbol"))

def configureView(self):
Expand All @@ -444,6 +445,8 @@ def configureView(self):
self._view.setItemDelegateForColumn(self.fieldIndex("timestamp"), self._timestamp_delegate)
self._lookup_delegate = QSqlRelationalDelegate(self._view)
self._view.setItemDelegateForColumn(self.fieldIndex("currency_id"), self._lookup_delegate)
self._float_delegate = FloatDelegate(4, allow_tail=True, parent=self._view)
self._view.setItemDelegateForColumn(self.fieldIndex("quote"), self._float_delegate)


class QuotesListDialog(ReferenceDataDialog):
Expand Down

0 comments on commit 9009b89

Please sign in to comment.