Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B-ASIC - Better ASIC Toolbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computer Engineering
B-ASIC - Better ASIC Toolbox
Commits
c343b860
Commit
c343b860
authored
4 years ago
by
Felix Goding
Browse files
Options
Downloads
Patches
Plain Diff
Add ability to zoom and move workspace by dragging it
parent
2aa504d6
No related branches found
Branches containing commit
No related tags found
3 merge requests
!67
WIP: B-ASIC version 1.0.0 hotfix
,
!65
B-ASIC version 1.0.0
,
!36
Add ability to zoom and move workspace by dragging it
Pipeline
#14419
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
b_asic/GUI/improved_main_window.py
+11
-7
11 additions, 7 deletions
b_asic/GUI/improved_main_window.py
with
11 additions
and
7 deletions
b_asic/GUI/improved_main_window.py
+
11
−
7
View file @
c343b860
...
...
@@ -32,7 +32,6 @@ class MainWindow(QMainWindow):
self
.
setWindowIcon
(
QIcon
(
'
small_logo.png
'
))
self
.
scene
=
None
self
.
init_ui
()
self
.
add_counter
=
0
self
.
sub_counter
=
0
self
.
mul_counter
=
0
...
...
@@ -48,11 +47,10 @@ class MainWindow(QMainWindow):
self
.
input_counter
=
0
self
.
output_counter
=
0
self
.
reg_counter
=
0
self
.
zoom
=
1
self
.
operationList
=
[]
self
.
signalList
=
[]
self
.
pressed_button
=
[]
self
.
source
=
None
def
init_ui
(
self
):
...
...
@@ -63,9 +61,16 @@ class MainWindow(QMainWindow):
def
create_graphics_view
(
self
):
self
.
scene
=
QGraphicsScene
()
graphic_view
=
QGraphicsView
(
self
.
scene
,
self
)
graphic_view
.
setRenderHint
(
QPainter
.
Antialiasing
)
graphic_view
.
setGeometry
(
250
,
40
,
600
,
520
)
self
.
graphic_view
=
QGraphicsView
(
self
.
scene
,
self
)
self
.
graphic_view
.
setRenderHint
(
QPainter
.
Antialiasing
)
self
.
graphic_view
.
setGeometry
(
250
,
40
,
600
,
520
)
self
.
graphic_view
.
setDragMode
(
QGraphicsView
.
ScrollHandDrag
)
def
wheelEvent
(
self
,
event
):
old_zoom
=
self
.
zoom
self
.
zoom
+=
event
.
angleDelta
().
y
()
/
2500
self
.
graphic_view
.
scale
(
self
.
zoom
,
self
.
zoom
)
self
.
zoom
=
old_zoom
def
exit_app
(
self
,
checked
):
QApplication
.
quit
()
...
...
@@ -120,7 +125,6 @@ class MainWindow(QMainWindow):
self
.
scene
.
addWidget
(
self
.
addition_operation
)
self
.
operationList
.
append
(
self
.
addition_operation
)
self
.
addition_operation
.
connectionRequested
.
connect
(
self
.
connectButton
)
self
.
operationList
.
append
(
self
.
addition_operation
)
self
.
add_ports
(
self
.
addition_operation
)
...
...
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