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
7879b40c
Commit
7879b40c
authored
7 months ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Plain Diff
[j.0] ctd ()
Merging branch 'j.0' into 'main'. See merge request
!2699
parents
de4bbf10
8ab24288
No related branches found
No related tags found
1 merge request
!2699
ctd
Pipeline
#153810
passed
7 months ago
Stage: build
Changes
2
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/Sample/ISelectionForm.cpp
+24
-1
24 additions, 1 deletion
GUI/View/Sample/ISelectionForm.cpp
GUI/View/Sample/ISelectionForm.h
+7
-32
7 additions, 32 deletions
GUI/View/Sample/ISelectionForm.h
with
31 additions
and
33 deletions
GUI/View/Sample/ISelectionForm.cpp
+
24
−
1
View file @
7879b40c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
// BornAgain: simulate and fit reflection and scattering
// BornAgain: simulate and fit reflection and scattering
//
//
//! @file GUI/View/Sample/ISelectionForm.cpp
//! @file GUI/View/Sample/ISelectionForm.cpp
//! @brief Implements class ISelectionForm
, except for templated functions
.
//! @brief Implements class ISelectionForm.
//!
//!
//! @homepage http://www.bornagainproject.org
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @license GNU General Public License v3 or higher (see COPYING)
...
@@ -21,6 +21,29 @@ ISelectionForm::ISelectionForm(QWidget* parent, SampleEditorController* ec)
...
@@ -21,6 +21,29 @@ ISelectionForm::ISelectionForm(QWidget* parent, SampleEditorController* ec)
{
{
}
}
void
ISelectionForm
::
initUI
(
PolyBase
&
d
)
{
m_grid_layout
=
new
QGridLayout
(
this
);
m_grid_layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_grid_layout
->
setSpacing
(
6
);
m_combo
=
new
QComboBox
;
WheelEventEater
::
install
(
m_combo
);
m_combo
->
addItems
(
d
.
menuEntries
());
m_combo
->
setCurrentIndex
(
d
.
certainIndex
());
m_combo
->
setMaxVisibleItems
(
m_combo
->
count
());
QObject
::
connect
(
m_combo
,
&
QComboBox
::
currentIndexChanged
,
[
this
,
&
d
](
int
current
)
{
clear
();
d
.
setCertainIndex
(
current
);
createContent
();
emit
gDoc
->
sampleChanged
();
});
m_grid_layout
->
addWidget
(
m_combo
,
1
,
0
);
createContent
();
}
void
ISelectionForm
::
clear
()
void
ISelectionForm
::
clear
()
{
{
auto
*
layoutItemOfComboBox
=
m_grid_layout
->
itemAtPosition
(
1
,
0
);
auto
*
layoutItemOfComboBox
=
m_grid_layout
->
itemAtPosition
(
1
,
0
);
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Sample/ISelectionForm.h
+
7
−
32
View file @
7879b40c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
// BornAgain: simulate and fit reflection and scattering
// BornAgain: simulate and fit reflection and scattering
//
//
//! @file GUI/View/Sample/ISelectionForm.h
//! @file GUI/View/Sample/ISelectionForm.h
//! @brief Defines class ISelectionForm
, and implements templated functions
.
//! @brief Defines class ISelectionForm.
//!
//!
//! @homepage http://www.bornagainproject.org
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @license GNU General Public License v3 or higher (see COPYING)
...
@@ -22,11 +22,8 @@
...
@@ -22,11 +22,8 @@
#include
<QComboBox>
#include
<QComboBox>
#include
<QGridLayout>
#include
<QGridLayout>
//! Abstract widget base class to contain a selection, defined by a SelectionDescriptor.
//! Abstract widget class that provides a combo box for selecting a polymorphous class.
//!
//! This abstract base class contains only the selection combo box and the infrastructure to
//! call the SampleEditorController to change the current selection. A derived class has to
//! implement the showing of the contents (method createContent).
class
ISelectionForm
:
public
QWidget
{
class
ISelectionForm
:
public
QWidget
{
public:
public:
virtual
void
createContent
()
=
0
;
virtual
void
createContent
()
=
0
;
...
@@ -34,37 +31,15 @@ public:
...
@@ -34,37 +31,15 @@ public:
protected:
protected:
ISelectionForm
(
QWidget
*
parent
,
SampleEditorController
*
ec
);
ISelectionForm
(
QWidget
*
parent
,
SampleEditorController
*
ec
);
void
initUI
(
PolyBase
&
d
)
void
initUI
(
PolyBase
&
d
);
{
m_grid_layout
=
new
QGridLayout
(
this
);
m_grid_layout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
m_grid_layout
->
setSpacing
(
6
);
m_combo
=
new
QComboBox
;
WheelEventEater
::
install
(
m_combo
);
m_combo
->
addItems
(
d
.
menuEntries
());
m_combo
->
setCurrentIndex
(
d
.
certainIndex
());
m_combo
->
setMaxVisibleItems
(
m_combo
->
count
());
QObject
::
connect
(
m_combo
,
&
QComboBox
::
currentIndexChanged
,
[
this
,
&
d
](
int
current
)
{
QGridLayout
*
m_grid_layout
;
clear
();
QComboBox
*
m_combo
;
d
.
setCertainIndex
(
current
);
SampleEditorController
*
m_ec
;
createContent
();
emit
gDoc
->
sampleChanged
();
});
m_grid_layout
->
addWidget
(
m_combo
,
1
,
0
);
createContent
();
}
private:
private:
//! Remove all properties from the layout
//! Remove all properties from the layout
void
clear
();
void
clear
();
protected
:
QGridLayout
*
m_grid_layout
;
QComboBox
*
m_combo
;
SampleEditorController
*
m_ec
;
};
};
#endif // BORNAGAIN_GUI_VIEW_SAMPLE_ISELECTIONFORM_H
#endif // BORNAGAIN_GUI_VIEW_SAMPLE_ISELECTIONFORM_H
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