Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.editor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
beat
beat.editor
Commits
d7075e5a
Commit
d7075e5a
authored
6 years ago
by
Flavio TARSETTI
Browse files
Options
Downloads
Patches
Plain Diff
[widgets] Save/Restore window state and geometry
parent
fe01dd01
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!54
[widgets] Save/Restore window state and geometry
Pipeline
#27295
passed
6 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/editor/widgets/mainwindow.py
+13
-0
13 additions, 0 deletions
beat/editor/widgets/mainwindow.py
with
13 additions
and
0 deletions
beat/editor/widgets/mainwindow.py
+
13
−
0
View file @
d7075e5a
...
@@ -27,6 +27,7 @@ from PyQt5.QtWidgets import QHBoxLayout
...
@@ -27,6 +27,7 @@ from PyQt5.QtWidgets import QHBoxLayout
from
PyQt5.QtWidgets
import
QMainWindow
from
PyQt5.QtWidgets
import
QMainWindow
from
PyQt5.QtWidgets
import
QWidget
from
PyQt5.QtWidgets
import
QWidget
from
PyQt5.QtWidgets
import
qApp
from
PyQt5.QtWidgets
import
qApp
from
PyQt5.QtCore
import
QSettings
from
.assetbrowser
import
AssetBrowser
from
.assetbrowser
import
AssetBrowser
from
.assetwidget
import
AssetWidget
from
.assetwidget
import
AssetWidget
...
@@ -42,6 +43,13 @@ class MainWindow(QMainWindow):
...
@@ -42,6 +43,13 @@ class MainWindow(QMainWindow):
super
(
MainWindow
,
self
).
__init__
(
parent
)
super
(
MainWindow
,
self
).
__init__
(
parent
)
# MainWindow settings
self
.
settings
=
QSettings
(
"
beat
"
,
"
editor
"
)
if
not
self
.
settings
.
value
(
"
geometry
"
)
is
None
:
self
.
restoreGeometry
(
self
.
settings
.
value
(
"
geometry
"
))
if
not
self
.
settings
.
value
(
"
windowState
"
)
is
None
:
self
.
restoreState
(
self
.
settings
.
value
(
"
windowState
"
))
menubar
=
self
.
menuBar
()
menubar
=
self
.
menuBar
()
fileMenu
=
menubar
.
addMenu
(
self
.
tr
(
"
File
"
))
fileMenu
=
menubar
.
addMenu
(
self
.
tr
(
"
File
"
))
quitAction
=
fileMenu
.
addAction
(
self
.
tr
(
"
Quit
"
))
quitAction
=
fileMenu
.
addAction
(
self
.
tr
(
"
Quit
"
))
...
@@ -71,3 +79,8 @@ class MainWindow(QMainWindow):
...
@@ -71,3 +79,8 @@ class MainWindow(QMainWindow):
def
show_settings
(
self
):
def
show_settings
(
self
):
"""
Show settings dialog
"""
"""
Show settings dialog
"""
pass
pass
def
closeEvent
(
self
,
event
):
self
.
settings
.
setValue
(
"
geometry
"
,
self
.
saveGeometry
())
self
.
settings
.
setValue
(
"
windowState
"
,
self
.
saveState
())
QMainWindow
.
closeEvent
(
self
,
event
)
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