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
ea290d34
Commit
ea290d34
authored
3 years ago
by
Matthias Puchner
Browse files
Options
Downloads
Patches
Plain Diff
enhance UIntDescriptor
parent
66677268
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!570
remove SessionModel/Item from SampleModel and all related items
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/Model/Types/UIntDescriptor.cpp
+8
-0
8 additions, 0 deletions
GUI/Model/Types/UIntDescriptor.cpp
GUI/Model/Types/UIntDescriptor.h
+3
-0
3 additions, 0 deletions
GUI/Model/Types/UIntDescriptor.h
with
11 additions
and
0 deletions
GUI/Model/Types/UIntDescriptor.cpp
+
8
−
0
View file @
ea290d34
...
@@ -49,6 +49,14 @@ UIntDescriptor::UIntDescriptor(QString label, QString tooltip, const RealLimits&
...
@@ -49,6 +49,14 @@ UIntDescriptor::UIntDescriptor(QString label, QString tooltip, const RealLimits&
{
{
}
}
UIntDescriptor
::
UIntDescriptor
(
const
QString
&
label
,
const
uint
*
var
,
const
variant
<
QString
,
Unit
>&
unit
)
:
UIntDescriptor
(
label
,
""
,
RealLimits
::
nonnegative
(),
[
=
](
uint
v
)
{
*
const_cast
<
uint
*>
(
var
)
=
v
;
},
[
=
]
{
return
*
var
;
},
unit
)
{
}
UIntDescriptor
::
operator
uint
()
const
UIntDescriptor
::
operator
uint
()
const
{
{
return
get
();
return
get
();
...
...
This diff is collapsed.
Click to expand it.
GUI/Model/Types/UIntDescriptor.h
+
3
−
0
View file @
ea290d34
...
@@ -35,6 +35,7 @@ using std::variant;
...
@@ -35,6 +35,7 @@ using std::variant;
//! member, or any other construction to hold a uint value.
//! member, or any other construction to hold a uint value.
class
UIntDescriptor
{
class
UIntDescriptor
{
public:
public:
UIntDescriptor
()
=
default
;
//! Operates on a session item. The settings (like limits) are taken from the session
//! Operates on a session item. The settings (like limits) are taken from the session
//! item.
//! item.
//! Only for easier migration. Should be removed after SessionItem refactoring.
//! Only for easier migration. Should be removed after SessionItem refactoring.
...
@@ -45,6 +46,8 @@ public:
...
@@ -45,6 +46,8 @@ public:
//! Only for easier migration. Should be removed after SessionItem refactoring.
//! Only for easier migration. Should be removed after SessionItem refactoring.
UIntDescriptor
(
const
QString
&
label
,
SessionItem
*
item
,
const
variant
<
QString
,
Unit
>&
unit
);
UIntDescriptor
(
const
QString
&
label
,
SessionItem
*
item
,
const
variant
<
QString
,
Unit
>&
unit
);
UIntDescriptor
(
const
QString
&
label
,
const
uint
*
var
,
const
variant
<
QString
,
Unit
>&
unit
);
private:
private:
//! Operates on any kind of storage (e.g. session items), by using setter/getter methods
//! Operates on any kind of storage (e.g. session items), by using setter/getter methods
UIntDescriptor
(
QString
label
,
QString
tooltip
,
const
RealLimits
&
limits
,
UIntDescriptor
(
QString
label
,
QString
tooltip
,
const
RealLimits
&
limits
,
...
...
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