Skip to content
Snippets Groups Projects
Commit b8f1f4ba authored by Anders H. Rebner's avatar Anders H. Rebner
Browse files

#87 Flyttet felles kodelinje til parent

parent 6cd663d8
No related branches found
No related tags found
1 merge request!53#87 Subtraktorkoder
Pipeline #78613 passed
......@@ -45,6 +45,15 @@ class CodeTableBase(ModuleBase, QTableWidget, metaclass=Meta):
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
# Resize table when headline changes
self.cellChanged.connect(
lambda: resize_table(
self,
resize_rows=False,
resize_columns=False,
has_headline=True,
)
)
# If parameters are None, generate new table
if size is None and data is None:
self.generate_table()
......
......@@ -45,8 +45,8 @@ class AuthenticationBoardModule(CodeTableBase):
The widget does not use more room than needed, and resizes dynamically.
It has shortcuts for adding and removing rows.
Codes are not horizontally centered because 'BGD' is wider than 'III'
(example) in certain fonts.
Codes are not horizontally centered for readability because 'BGD' is wider
than 'III' (example) in certain fonts.
"""
def __init__(self, size=None, data=None):
......@@ -63,7 +63,6 @@ class AuthenticationBoardModule(CodeTableBase):
"Invalid value for CONSTANT 'CODE_CHARACTER_TYPE': "
"'{}'".format(CODE_CHARACTER_TYPE)
)
self.start_no_of_codes = START_NO_OF_CODES
self.code_length = CODE_LENGTH
self.space_interval = SPACE_INTERVAL
......@@ -72,15 +71,6 @@ class AuthenticationBoardModule(CodeTableBase):
self.headline = HEADLINE_TEXT
CodeTableBase.__init__(self, size, data)
# Resize table when headline changes
self.cellChanged.connect(
lambda: resize_table(
self,
resize_rows=False,
resize_columns=False,
has_headline=True,
)
)
def insert_row_identifiers(self):
"""Insert values in column one and two."""
......
......@@ -48,24 +48,14 @@ class SubtractorcodesModule(CodeTableBase):
"Invalid value for CONSTANT 'START_NO_OF_CODES': "
"'{}'".format(START_NO_OF_CODES)
)
# pylint: disable=R0801
self.start_no_of_codes = START_NO_OF_CODES
self.headline = HEADLINE_TEXT
self.code_length = CODE_LENGTH
self.start_no_of_codes = START_NO_OF_CODES
self.space_interval = SPACE_INTERVAL
self.space_amount = SPACE_AMOUNT
self.code_character_type = "digits"
self.headline = HEADLINE_TEXT
CodeTableBase.__init__(self, size, data)
# Resize table when headline changes
self.cellChanged.connect(
lambda: resize_table(
self,
resize_rows=False,
resize_columns=False,
has_headline=True,
)
)
def insert_row_identifiers(self, has_headline=False):
"""Insert row identifiers in first and second column.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment