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
2cc92cd4
Commit
2cc92cd4
authored
4 years ago
by
morkolai
Browse files
Options
Downloads
Patches
Plain Diff
#96 Lagt til mulighet for å laste inn data i modulen
parent
50e21d47
No related branches found
Branches containing commit
No related tags found
1 merge request
!57
#96 Telefonliste & Fiks til høyde på tabeller (rundt oppløsning)
Pipeline
#83531
failed
4 years ago
Stage: lint
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
soitool/modules/module_phonebook.py
+26
-3
26 additions, 3 deletions
soitool/modules/module_phonebook.py
with
26 additions
and
3 deletions
soitool/modules/module_phonebook.py
+
26
−
3
View file @
2cc92cd4
...
...
@@ -123,7 +123,7 @@ class PhonebookModule(ModuleBase, QWidget, metaclass=Meta):
self
.
setLayout
(
layout
)
if
data
:
pass
self
.
load_data_to_module
(
data
)
else
:
self
.
set_columns
()
...
...
@@ -306,8 +306,31 @@ class PhonebookModule(ModuleBase, QWidget, metaclass=Meta):
self
.
setFixedHeight
(
height
)
def
load_data_to_module
(
self
,
data
):
pass
# Må oppdatere dict
"""
Load module content from data.
Parameters
----------
data : dict
Module serialized as dict.
"""
for
column_header
in
self
.
selected_columns
.
keys
():
if
column_header
in
data
.
keys
():
self
.
selected_columns
[
column_header
]
=
True
else
:
self
.
selected_columns
[
column_header
]
=
False
self
.
set_columns
()
number_of_rows
=
len
(
list
(
data
.
values
())[
0
])
self
.
table
.
setRowCount
(
self
.
table
.
rowCount
()
+
number_of_rows
-
1
)
for
column_header
in
data
.
keys
():
column_index
=
self
.
get_column_index_by_header
(
column_header
)
for
row_index
in
range
(
1
,
number_of_rows
+
1
):
current_item
=
QTableWidgetItem
(
data
[
column_header
][
row_index
-
1
]
)
self
.
table
.
setItem
(
row_index
,
column_index
,
current_item
)
def
open_popup
(
self
):
"""
Open dialog for editing columns.
"""
...
...
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