Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
81fab737
Commit
81fab737
authored
1 year ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
ditto compound
parent
3b37d90a
No related branches found
No related tags found
1 merge request
!2067
Replace FormLayouter by HeinzFormLayout, which inherits from QFormLayout. Resolve crash in sample view (#808)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/SampleDesigner/CompoundForm.cpp
+9
-11
9 additions, 11 deletions
GUI/View/SampleDesigner/CompoundForm.cpp
GUI/View/SampleDesigner/CompoundForm.h
+2
-2
2 additions, 2 deletions
GUI/View/SampleDesigner/CompoundForm.h
with
11 additions
and
13 deletions
GUI/View/SampleDesigner/CompoundForm.cpp
+
9
−
11
View file @
81fab737
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include
"GUI/View/SampleDesigner/CompoundForm.h"
#include
"GUI/View/SampleDesigner/CompoundForm.h"
#include
"GUI/Model/Sample/CompoundItem.h"
#include
"GUI/Model/Sample/CompoundItem.h"
#include
"GUI/Support/Util/ActionFactory.h"
#include
"GUI/Support/Util/ActionFactory.h"
#include
"GUI/View/SampleDesigner/FormLayout
er
.h"
#include
"GUI/View/SampleDesigner/
Heinz
FormLayout.h"
#include
"GUI/View/SampleDesigner/LayerEditorUtil.h"
#include
"GUI/View/SampleDesigner/LayerEditorUtil.h"
#include
<QAction>
#include
<QAction>
#include
<QPushButton>
#include
<QPushButton>
...
@@ -26,15 +26,15 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compoundItem, SampleEd
...
@@ -26,15 +26,15 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compoundItem, SampleEd
,
m_compositionItem
(
compoundItem
)
,
m_compositionItem
(
compoundItem
)
,
m_ec
(
ec
)
,
m_ec
(
ec
)
{
{
FormLayouter
l
ayout
er
(
this
,
ec
);
m_layout
=
new
HeinzFormL
ayout
(
this
,
ec
);
layouter
.
setContentsMargins
(
30
,
6
,
0
,
0
);
body
()
->
setLayout
(
m_layout
);
layout
er
.
addVector
(
compoundItem
->
position
(),
false
);
m_
layout
->
setContentsMargins
(
30
,
6
,
0
,
0
);
layout
er
.
addSelection
(
compoundItem
->
rotationSelection
()
);
m_
layout
->
addVector
(
compoundItem
->
position
(),
false
);
layout
er
.
addValue
(
compoundItem
->
abundance
());
m_
layout
->
addSelection
(
compoundItem
->
rotationSelection
());
body
()
->
setLayout
(
layouter
.
layout
());
m_layout
->
addValue
(
compoundItem
->
abundance
());
for
(
auto
*
particle
:
compoundItem
->
itemsWithParticles
())
for
(
auto
*
particle
:
compoundItem
->
itemsWithParticles
())
layout
er
.
addRow
(
m_
layout
->
addRow
(
LayerEditorUtil
::
createWidgetForItemWithParticles
(
this
,
particle
,
false
,
ec
));
LayerEditorUtil
::
createWidgetForItemWithParticles
(
this
,
particle
,
false
,
ec
));
auto
*
btn
=
LayerEditorUtil
::
createAddParticleButton
(
auto
*
btn
=
LayerEditorUtil
::
createAddParticleButton
(
...
@@ -42,7 +42,7 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compoundItem, SampleEd
...
@@ -42,7 +42,7 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compoundItem, SampleEd
[
=
](
ItemWithParticlesCatalog
::
Type
type
)
{
ec
->
addCompoundItem
(
compoundItem
,
type
);
});
[
=
](
ItemWithParticlesCatalog
::
Type
type
)
{
ec
->
addCompoundItem
(
compoundItem
,
type
);
});
m_structureEditingWidgets
<<
btn
;
m_structureEditingWidgets
<<
btn
;
layout
er
.
addStructureEditingRow
(
btn
);
m_
layout
->
addStructureEditingRow
(
btn
);
// top right corner actions
// top right corner actions
// show in real space
// show in real space
...
@@ -67,8 +67,6 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compoundItem, SampleEd
...
@@ -67,8 +67,6 @@ CompoundForm::CompoundForm(QWidget* parent, CompoundItem* compoundItem, SampleEd
if
(
allowRemove
)
if
(
allowRemove
)
addTitleAction
(
m_removeAction
);
addTitleAction
(
m_removeAction
);
}
}
m_layout
=
layouter
.
layout
();
}
}
CompoundForm
::~
CompoundForm
()
=
default
;
CompoundForm
::~
CompoundForm
()
=
default
;
...
...
This diff is collapsed.
Click to expand it.
GUI/View/SampleDesigner/CompoundForm.h
+
2
−
2
View file @
81fab737
...
@@ -16,9 +16,9 @@
...
@@ -16,9 +16,9 @@
#define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_COMPOUNDFORM_H
#define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_COMPOUNDFORM_H
#include
"GUI/View/Widget/GroupBoxes.h"
#include
"GUI/View/Widget/GroupBoxes.h"
#include
<QFormLayout>
class
CompoundItem
;
class
CompoundItem
;
class
HeinzFormLayout
;
class
ItemWithParticles
;
class
ItemWithParticles
;
class
SampleEditorController
;
class
SampleEditorController
;
...
@@ -36,7 +36,7 @@ public:
...
@@ -36,7 +36,7 @@ public:
void
onAboutToRemoveParticle
(
ItemWithParticles
*
item
);
void
onAboutToRemoveParticle
(
ItemWithParticles
*
item
);
private:
private:
Q
FormLayout
*
m_layout
;
Heinz
FormLayout
*
m_layout
;
CompoundItem
*
m_compositionItem
;
CompoundItem
*
m_compositionItem
;
QAction
*
m_removeAction
=
nullptr
;
QAction
*
m_removeAction
=
nullptr
;
QAction
*
m_duplicateAction
=
nullptr
;
QAction
*
m_duplicateAction
=
nullptr
;
...
...
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