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
f07ea90f
Commit
f07ea90f
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Patches
Plain Diff
Replace line with polygon in arrow
parent
a85589d2
No related branches found
No related tags found
1 merge request
!103
Replace line with polygon in arrow
Pipeline
#88072
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
b_asic/GUI/arrow.py
+11
-13
11 additions, 13 deletions
b_asic/GUI/arrow.py
with
11 additions
and
13 deletions
b_asic/GUI/arrow.py
+
11
−
13
View file @
f07ea90f
from
qtpy.QtCore
import
Q
LineF
,
Qt
from
qtpy.QtGui
import
QPen
from
qtpy.QtWidgets
import
QGraphics
Line
Item
,
QMenu
from
qtpy.QtCore
import
Q
PointF
from
qtpy.QtGui
import
QPen
,
QPolygonF
from
qtpy.QtWidgets
import
QGraphics
Polygon
Item
,
QMenu
from
b_asic.GUI._preferences
import
LINECOLOR
from
b_asic.GUI._preferences
import
LINECOLOR
,
PORTHEIGHT
,
PORTWIDTH
from
b_asic.signal
import
Signal
class
Arrow
(
QGraphics
Line
Item
):
class
Arrow
(
QGraphics
Polygon
Item
):
"""
Arrow/connection in signal flow graph GUI.
"""
def
__init__
(
self
,
source
,
destination
,
window
,
signal
=
None
,
parent
=
None
):
...
...
@@ -81,11 +81,9 @@ class Arrow(QGraphicsLineItem):
Draw a line connecting self.source with self.destination. Used as callback when moving operations.
"""
self
.
setPen
(
QPen
(
LINECOLOR
,
3
))
self
.
setLine
(
QLineF
(
self
.
source
.
operation
.
x
()
+
self
.
source
.
x
()
+
14
,
self
.
source
.
operation
.
y
()
+
self
.
source
.
y
()
+
7.5
,
self
.
destination
.
operation
.
x
()
+
self
.
destination
.
x
(),
self
.
destination
.
operation
.
y
()
+
self
.
destination
.
y
()
+
7.5
,
)
)
x0
=
self
.
source
.
operation
.
x
()
+
self
.
source
.
x
()
+
PORTWIDTH
y0
=
self
.
source
.
operation
.
y
()
+
self
.
source
.
y
()
+
PORTHEIGHT
/
2
x1
=
self
.
destination
.
operation
.
x
()
+
self
.
destination
.
x
()
y1
=
self
.
destination
.
operation
.
y
()
+
self
.
destination
.
y
()
+
PORTHEIGHT
/
2
p
=
QPolygonF
()
<<
QPointF
(
x0
,
y0
)
<<
QPointF
(
x1
,
y1
)
self
.
setPolygon
(
p
)
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