Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
soitool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bachelor-paa-bittet
soitool
Commits
9b67d4bb
Commit
9b67d4bb
authored
5 years ago
by
Anders H. Rebner
Browse files
Options
Downloads
Patches
Plain Diff
#86 Endring i resize-funksjon
parent
450384c7
No related branches found
Branches containing commit
No related tags found
1 merge request
!50
#86 Modul: Autentiseringstavle
Pipeline
#77842
failed
5 years ago
Stage: lint
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
soitool/modules/module_authentification_board.py
+2
-3
2 additions, 3 deletions
soitool/modules/module_authentification_board.py
soitool/modules/module_base.py
+2
-1
2 additions, 1 deletion
soitool/modules/module_base.py
soitool/modules/module_table.py
+2
-3
2 additions, 3 deletions
soitool/modules/module_table.py
with
6 additions
and
7 deletions
soitool/modules/module_authentification_board.py
+
2
−
3
View file @
9b67d4bb
...
...
@@ -6,7 +6,7 @@ from PySide2 import QtGui
from
PySide2.QtCore
import
Qt
from
soitool.modules.module_base
import
(
ModuleBase
,
set_table_siz
e
,
resize_tabl
e
,
get_table_size
,
)
...
...
@@ -241,8 +241,7 @@ class AuthentificationBoardModule(ModuleBase, QTableWidget, metaclass=Meta):
def
resize
(
self
):
"""
Resize widget and rows.
"""
self
.
resizeRowsToContents
()
set_table_size
(
self
)
resize_table
(
self
)
def
get_size
(
self
):
"""
Get size of widget.
"""
...
...
This diff is collapsed.
Click to expand it.
soitool/modules/module_base.py
+
2
−
1
View file @
9b67d4bb
...
...
@@ -38,7 +38,7 @@ class ModuleBase(ABC):
raise
NotImplementedError
def
set_table_siz
e
(
widget
):
def
resize_tabl
e
(
widget
):
"""
Calculate and set the size of a QTableWidget.
Parameters
...
...
@@ -55,6 +55,7 @@ def set_table_size(widget):
for
y
in
range
(
widget
.
rowCount
()):
height
+=
widget
.
rowHeight
(
y
)
+
0.5
widget
.
resizeRowsToContents
()
widget
.
setFixedWidth
(
width
)
widget
.
setFixedHeight
(
height
)
...
...
This diff is collapsed.
Click to expand it.
soitool/modules/module_table.py
+
2
−
3
View file @
9b67d4bb
...
...
@@ -3,7 +3,7 @@ from PySide2.QtWidgets import QTableWidget, QTableWidgetItem
from
PySide2
import
QtGui
,
QtCore
from
soitool.modules.module_base
import
(
ModuleBase
,
set_table_siz
e
,
resize_tabl
e
,
get_table_size
,
)
...
...
@@ -159,8 +159,7 @@ class TableModule(ModuleBase, QTableWidget, metaclass=Meta):
Resize rows and columns to contents.
"""
self
.
resizeColumnsToContents
()
self
.
resizeRowsToContents
()
set_table_size
(
self
)
resize_table
(
self
)
def
get_size
(
self
):
"""
Get size of widget.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment