-
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.
Formatting, snake_case, type hinting, line length, docstrings, whites…
…pace - Sorry for the big commit - snake_case in all files - Overriden base methods from pysides is still camelCase - These methods are moved to top in classes where they are overriden - Type hinting in some parts of the code - Make some instance variables regular variable - Add some short docstrings - Remove unwanted whitespace
- Loading branch information
1 parent
5f27406
commit 18d5999
Showing
28 changed files
with
1,586 additions
and
1,249 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,41 +1,45 @@ | ||
from PySide6.QtWidgets import QWidget,QTableView,QVBoxLayout | ||
from PySide6.QtGui import QStandardItemModel,QStandardItem | ||
|
||
|
||
from .MainWindow import MainWindow | ||
class AssociationDefinitions(QWidget): | ||
def __init__(self, parent=None): | ||
def __init__(self, parent: MainWindow): | ||
super().__init__(parent) | ||
|
||
self.associationInfo = None | ||
self.mainWindow = parent | ||
self.association_info = None | ||
self.main_window = parent | ||
|
||
self.tableAssociationView = QTableView(self) | ||
self.associationInfoModel = QStandardItemModel() | ||
self.table_association_view = QTableView(self) | ||
self.association_info_model = QStandardItemModel() | ||
|
||
#headers for the columns | ||
self.associationInfoModel.setHorizontalHeaderLabels(['AssocLeftAsset', 'AssocLeftField', 'AssocName', 'AssocRightField','AssocRightAsset']) | ||
self.association_info_model.setHorizontalHeaderLabels( | ||
['AssocLeftAsset', 'AssocLeftField', 'AssocName', | ||
'AssocRightField','AssocRightAsset'] | ||
) | ||
|
||
self.associationInfoModel.removeRows(0, self.associationInfoModel.rowCount()) | ||
self.association_info_model.removeRows( | ||
0, self.association_info_model.rowCount() | ||
) | ||
|
||
for assoc in self.mainWindow.scene.langGraph.associations: | ||
for assoc in self.main_window.scene.lang_graph.associations: | ||
items = [ | ||
QStandardItem(assoc.left_field.asset.name), | ||
QStandardItem(assoc.left_field.fieldname), | ||
QStandardItem(assoc.name), | ||
QStandardItem(assoc.right_field.fieldname), | ||
QStandardItem(assoc.right_field.asset.name) | ||
] | ||
self.associationInfoModel.appendRow(items) | ||
|
||
self.associationInfo = self.associationInfoModel | ||
self.association_info_model.appendRow(items) | ||
|
||
self.tableAssociationView.setModel(self.associationInfoModel) | ||
self.association_info = self.association_info_model | ||
self.table_association_view.setModel(self.association_info_model) | ||
|
||
layout = QVBoxLayout() | ||
layout.addWidget(self.tableAssociationView) | ||
layout.addWidget(self.table_association_view) | ||
|
||
# Set the layout to the widget | ||
self.setLayout(layout) | ||
|
||
def getAssociationInfo(self): | ||
return self.associationInfo | ||
def get_association_info(self): | ||
return self.association_info |
Oops, something went wrong.