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
272ff562
Commit
272ff562
authored
5 years ago
by
Anders H. Rebner
Browse files
Options
Downloads
Patches
Plain Diff
#40 Visning av SOI'er i db oppdateres ved lagring av ny SOI
parent
96a1c3bb
No related branches found
Branches containing commit
No related tags found
1 merge request
!59
#40 Lagre SOI i database
Pipeline
#79717
failed
5 years ago
Stage: lint
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
soitool/main_window.py
+2
-2
2 additions, 2 deletions
soitool/main_window.py
soitool/soi_model_view.py
+15
-0
15 additions, 0 deletions
soitool/soi_model_view.py
with
17 additions
and
2 deletions
soitool/main_window.py
+
2
−
2
View file @
272ff562
...
...
@@ -22,7 +22,7 @@ from soitool.codebook_widget import CodebookWidget
from
soitool.codebook_model_view
import
CodeBookTableModel
from
soitool.database
import
Database
,
DBPATH
from
soitool.help_actions
import
ShortcutsHelpDialog
,
BasicUsageHelpDialog
from
soitool.soi_db_widget
import
soi_db_w
idget
from
soitool.soi_db_widget
import
SOIDbW
idget
from
soitool.soi_model_view
import
SOITableModel
from
soitool.serialize_export_import_soi
import
(
export_soi
,
...
...
@@ -289,7 +289,7 @@ class MainWindow(QMainWindow):
if
isinstance
(
tab_widget
,
SOIWorkspaceWidget
):
# Update tab showing SOI's in db if it is open
for
i
in
range
(
self
.
tabs
.
count
()):
if
self
.
tabs
.
tabText
(
i
)
==
"
SOI
'
er i
db
"
:
if
self
.
tabs
.
tabText
(
i
)
==
"
SOI
'
er i
DB
"
:
view
=
self
.
tabs
.
widget
(
i
).
view
view
.
setModel
(
None
)
self
.
database
.
insert_soi
(
tab_widget
.
soi
)
...
...
This diff is collapsed.
Click to expand it.
soitool/soi_model_view.py
+
15
−
0
View file @
272ff562
...
...
@@ -94,6 +94,21 @@ class SOITableView(QTableView):
self
.
tab_widget
.
addTab
(
tab
,
soi
.
title
)
self
.
tab_widget
.
setCurrentWidget
(
tab
)
def
setModel
(
self
,
model
):
"""
Set model, resize and hide
'
SOI
'
-column.
Parameters
----------
model : SOITableModel or None
Model containing data to display.
"""
super
().
setModel
(
model
)
if
model
is
not
None
:
self
.
hideColumn
(
1
)
self
.
resizeColumnsToContents
()
width
=
self
.
columnWidth
(
0
)
+
self
.
columnWidth
(
2
)
+
2
# +2 offset
self
.
setFixedWidth
(
width
)
class
SOITableModel
(
QSqlTableModel
):
"""
Uneditable QSqlTableModel of database-table
'
SOI
'
.
"""
...
...
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