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
Merge requests
!103
Replace line with polygon in arrow
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Replace line with polygon in arrow
polygonarrow
into
master
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Oscar Gustafsson
requested to merge
polygonarrow
into
master
2 years ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
Helps with
#119
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
f07ea90f
1 commit,
2 years ago
1 file
+
11
−
13
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
b_asic/GUI/arrow.py
+
11
−
13
Options
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
)
Loading