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
99e383b1
Commit
99e383b1
authored
2 years ago
by
Oscar Gustafsson
Browse files
Options
Downloads
Plain Diff
Merge branch 'polygonarrow' into 'master'
Replace line with polygon in arrow See merge request
!103
parents
a85589d2
f07ea90f
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!103
Replace line with polygon in arrow
Pipeline
#88073
failed
2 years ago
Stage: test
Stage: deploy
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 @
99e383b1
from
qtpy.QtCore
import
Q
LineF
,
Qt
from
qtpy.QtCore
import
Q
PointF
from
qtpy.QtGui
import
QPen
from
qtpy.QtGui
import
QPen
,
QPolygonF
from
qtpy.QtWidgets
import
QGraphics
Line
Item
,
QMenu
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
from
b_asic.signal
import
Signal
class
Arrow
(
QGraphics
Line
Item
):
class
Arrow
(
QGraphics
Polygon
Item
):
"""
Arrow/connection in signal flow graph GUI.
"""
"""
Arrow/connection in signal flow graph GUI.
"""
def
__init__
(
self
,
source
,
destination
,
window
,
signal
=
None
,
parent
=
None
):
def
__init__
(
self
,
source
,
destination
,
window
,
signal
=
None
,
parent
=
None
):
...
@@ -81,11 +81,9 @@ class Arrow(QGraphicsLineItem):
...
@@ -81,11 +81,9 @@ class Arrow(QGraphicsLineItem):
Draw a line connecting self.source with self.destination. Used as callback when moving operations.
Draw a line connecting self.source with self.destination. Used as callback when moving operations.
"""
"""
self
.
setPen
(
QPen
(
LINECOLOR
,
3
))
self
.
setPen
(
QPen
(
LINECOLOR
,
3
))
self
.
setLine
(
x0
=
self
.
source
.
operation
.
x
()
+
self
.
source
.
x
()
+
PORTWIDTH
QLineF
(
y0
=
self
.
source
.
operation
.
y
()
+
self
.
source
.
y
()
+
PORTHEIGHT
/
2
self
.
source
.
operation
.
x
()
+
self
.
source
.
x
()
+
14
,
x1
=
self
.
destination
.
operation
.
x
()
+
self
.
destination
.
x
()
self
.
source
.
operation
.
y
()
+
self
.
source
.
y
()
+
7.5
,
y1
=
self
.
destination
.
operation
.
y
()
+
self
.
destination
.
y
()
+
PORTHEIGHT
/
2
self
.
destination
.
operation
.
x
()
+
self
.
destination
.
x
(),
p
=
QPolygonF
()
<<
QPointF
(
x0
,
y0
)
<<
QPointF
(
x1
,
y1
)
self
.
destination
.
operation
.
y
()
+
self
.
destination
.
y
()
+
7.5
,
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