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
a3b99bac
Commit
a3b99bac
authored
4 years ago
by
morkolai
Browse files
Options
Downloads
Patches
Plain Diff
#96 WIP Laget module base funksjoner
parent
4f3fe21b
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
#83388
failed
4 years ago
Stage: lint
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
soitool/media/phonetable.png
+0
-0
0 additions, 0 deletions
soitool/media/phonetable.png
soitool/modules/module_phonebook.py
+50
-13
50 additions, 13 deletions
soitool/modules/module_phonebook.py
with
50 additions
and
13 deletions
soitool/media/phonetable.png
0 → 100644
+
0
−
0
View file @
a3b99bac
9.83 KiB
This diff is collapsed.
Click to expand it.
soitool/modules/module_phonebook.py
+
50
−
13
View file @
a3b99bac
...
...
@@ -10,7 +10,7 @@ from PySide2.QtWidgets import (
QCheckBox
,
)
from
PySide2.QtCore
import
Qt
,
QSize
from
PySide2.QtGui
import
QKeySequence
,
QBrush
,
QColor
from
PySide2.QtGui
import
QKeySequence
,
QBrush
,
QColor
,
QIcon
from
soitool.modules.module_base
import
(
ModuleBase
,
HEADLINE_FONT
,
...
...
@@ -303,24 +303,61 @@ class PhonebookModule(ModuleBase, QWidget, metaclass=Meta):
# !!!!! MODULE BASE OPERATIONS !!!!!
def
get_size
(
self
):
return
super
().
get_size
()
"""
Getter for module size.
Returns
-------
tupple
Size of the module (width, height)
"""
self
.
resize
()
return
(
self
.
minimumWidth
,
self
.
minimumHeight
)
def
get_data
(
self
):
return
super
().
get_data
()
"""
Get module content as serialized data.
Returns
-------
dict
Serialized module content.
"""
data
=
{}
for
column_index
in
range
(
self
.
table
.
columnCount
()):
self
.
table
.
setCurrentCell
(
0
,
column_index
)
header
=
self
.
table
.
currentItem
().
text
()
if
self
.
selected_columns
[
header
]:
row_data
=
[]
for
row_index
in
range
(
1
,
self
.
table
.
rowCount
()):
self
.
table
.
setCurrentCell
(
row_index
,
column_index
)
row_item
=
self
.
table
.
currentItem
()
if
row_item
:
row_data
.
append
(
row_item
.
text
())
else
:
row_data
.
append
(
""
)
data
[
header
]
=
row_data
return
data
@staticmethod
def
get_user_friendly_name
():
pass
"""
Get user friendly name.
Returns
-------
string
User friendly name.
"""
return
"
Telefonliste
"
@staticmethod
def
get_icon
():
pass
"""
Get icon.
if
__name__
==
"
__main__
"
:
from
PySide2.QtWidgets
import
QApplication
app
=
QApplication
()
module
=
PhonebookModule
()
module
.
show
()
app
.
exec_
()
Returns
-------
QIcon
Picture of module.
"""
return
QIcon
(
"
soitool/media/phonetable.png
"
)
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