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
6556cd11
Commit
6556cd11
authored
6 years ago
by
Samuel GAIST
Browse files
Options
Downloads
Patches
Plain Diff
[widgets][field] Rename Field to FieldWidget
parent
c334bc09
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
beat/editor/test/test_editors.py
+6
-6
6 additions, 6 deletions
beat/editor/test/test_editors.py
beat/editor/widgets/field.py
+4
-2
4 additions, 2 deletions
beat/editor/widgets/field.py
with
10 additions
and
8 deletions
beat/editor/test/test_editors.py
+
6
−
6
View file @
6556cd11
...
...
@@ -32,7 +32,7 @@ from PyQt5.QtWidgets import QPushButton
from
PyQt5.QtWidgets
import
QVBoxLayout
from
..widgets.editor
import
AbstractAssetEditor
from
..widgets.field
import
Field
from
..widgets.field
import
Field
Widget
class
MockAssetEditor
(
AbstractAssetEditor
):
...
...
@@ -50,7 +50,7 @@ class MockAssetEditor(AbstractAssetEditor):
self
.
add_field_button
.
clicked
.
connect
(
self
.
__add_field
)
def
__add_field
(
self
):
self
.
layout
().
addWidget
(
Field
(
self
.
dataformat_model
))
self
.
layout
().
addWidget
(
Field
Widget
(
self
.
dataformat_model
))
def
set_dataformat_model
(
self
,
model
):
self
.
dataformat_model
=
model
...
...
@@ -59,7 +59,7 @@ class MockAssetEditor(AbstractAssetEditor):
"""
Load the json object passed as parameter
"""
for
name
,
type_
in
json_object
.
items
():
field
=
Field
(
self
.
dataformat_model
)
field
=
Field
Widget
(
self
.
dataformat_model
)
field
.
format_name
=
name
field
.
format_type
=
type_
self
.
layout
().
addWidget
(
field
)
...
...
@@ -67,7 +67,7 @@ class MockAssetEditor(AbstractAssetEditor):
def
dump_json
(
self
):
"""
Returns the json representation of the asset
"""
field_list
=
self
.
findChildren
(
Field
)
field_list
=
self
.
findChildren
(
Field
Widget
)
json_data
=
{}
...
...
@@ -99,7 +99,7 @@ class TestMockEditor:
widget
.
set_dataformat_model
(
dataformat_model
)
qtbot
.
mouseClick
(
widget
.
add_field_button
,
QtCore
.
Qt
.
LeftButton
)
fields
=
widget
.
findChildren
(
Field
)
fields
=
widget
.
findChildren
(
Field
Widget
)
assert
len
(
fields
)
==
1
...
...
@@ -111,7 +111,7 @@ class TestMockEditor:
assert
widget
.
dump_json
()
==
{
"
value32
"
:
"
float32
"
}
qtbot
.
mouseClick
(
widget
.
add_field_button
,
QtCore
.
Qt
.
LeftButton
)
fields
=
widget
.
findChildren
(
Field
)
fields
=
widget
.
findChildren
(
Field
Widget
)
assert
len
(
fields
)
==
2
...
...
This diff is collapsed.
Click to expand it.
beat/editor/widgets/field.py
+
4
−
2
View file @
6556cd11
...
...
@@ -29,11 +29,13 @@ from PyQt5.QtWidgets import QLineEdit
from
PyQt5.QtWidgets
import
QWidget
class
Field
(
QWidget
):
class
Field
Widget
(
QWidget
):
"""
Class representing a dataformat field
"""
def
__init__
(
self
,
dataformat_model
,
parent
=
None
):
super
(
Field
,
self
).
__init__
(
parent
)
"""
Constructor
"""
super
(
FieldWidget
,
self
).
__init__
(
parent
)
self
.
dataformat_name
=
QLineEdit
()
self
.
dataformat_box
=
QComboBox
()
...
...
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