Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jan Zelenka
prasopes
Commits
3f0a9cc4
Commit
3f0a9cc4
authored
Sep 03, 2018
by
Yan
Browse files
Changed DRL window type to main window
* solves the annoying default button Qt5 feature
parent
00b658c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
prasopes/__main__.py
View file @
3f0a9cc4
...
...
@@ -83,7 +83,7 @@ def main():
main_window
.
menuBar
().
addMenu
(
tools_menu
)
tools_menu
.
addAction
(
'&TSQ zce'
,
lambda
:
zce
.
dialog
(
main_window
,
ds
,
filename
),
QtCore
.
Qt
.
CTRL
+
QtCore
.
Qt
.
Key_T
)
tools_menu
.
addAction
(
'&DRL..'
,
lambda
:
drl
.
dialog
(
tools_menu
.
addAction
(
'&DRL..'
,
lambda
:
drl
.
main_window
(
main_window
,
ds
,
filename
,
drlcache
),
QtCore
.
Qt
.
CTRL
+
QtCore
.
Qt
.
Key_D
)
...
...
prasopes/drltools.py
View file @
3f0a9cc4
...
...
@@ -325,14 +325,19 @@ def export_drlspectrum(parent, fn, ptable, dtable, ds):
expf
.
close
()
def
dialog
(
parent
,
ds
,
filename
,
cache
):
def
main_window
(
parent
,
ds
,
filename
,
cache
):
"""constructs a dialog window"""
def
savecache
(
cache
,
pt
,
dt
,
canvas
):
def
saveonclose
(
window
,
event
,
cache
,
pt
,
dt
,
canvas
):
cache
[
0
],
cache
[
1
],
cache
[
2
]
=
pt
,
dt
,
canvas
QtWidgets
.
QMainWindow
.
closeEvent
(
window
,
event
)
dial_widget
=
QtWidgets
.
Q
Dialog
(
main_window
=
QtWidgets
.
Q
MainWindow
(
parent
,
windowTitle
=
'Delayed reactant labelling'
)
dial_widget
=
QtWidgets
.
QWidget
(
main_window
)
main_window
.
setCentralWidget
(
dial_widget
)
main_window
.
closeEvent
=
lambda
event
:
saveonclose
(
main_window
,
event
,
cache
,
pt
,
dt
,
graph_canvas
)
dial_graph
=
Figure
(
figsize
=
(
5
,
2
),
dpi
=
100
,
facecolor
=
"None"
)
chromplot
=
dial_graph
.
add_subplot
(
111
,
facecolor
=
(
1
,
1
,
1
,
0.8
))
...
...
@@ -381,8 +386,7 @@ def dialog(parent, ds, filename, cache):
pt
,
dt
,
dial_widget
))
drl_export
.
clicked
.
connect
(
lambda
:
export_drlspectrum
(
dial_widget
,
filename
,
pt
,
dt
,
ds
))
dial_widget
.
finished
.
connect
(
lambda
:
savecache
(
cache
,
pt
,
dt
,
graph_canvas
))
main_layout
=
QtWidgets
.
QVBoxLayout
(
dial_widget
)
sub_layout
=
QtWidgets
.
QHBoxLayout
()
...
...
@@ -413,4 +417,4 @@ def dialog(parent, ds, filename, cache):
tablelayout
.
addWidget
(
QtWidgets
.
QLabel
(
"Corrected ions table:"
))
tablelayout
.
addWidget
(
dt
)
dial_widget
.
show
()
main_window
.
show
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment