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
01f38113
Commit
01f38113
authored
3 years ago
by
Matthias Puchner
Committed by
Wuttke, Joachim
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
docu; add convenience parameter
parent
de8b07f1
No related branches found
No related tags found
1 merge request
!708
Refactor and simplify UI
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/Tool/WidgetUtils.cpp
+6
-1
6 additions, 1 deletion
GUI/View/Tool/WidgetUtils.cpp
GUI/View/Tool/WidgetUtils.h
+4
-2
4 additions, 2 deletions
GUI/View/Tool/WidgetUtils.h
with
10 additions
and
3 deletions
GUI/View/Tool/WidgetUtils.cpp
+
6
−
1
View file @
01f38113
...
...
@@ -42,10 +42,15 @@ QSpinBox* GUI::Util::createSpinBox(QWidget* parent, const UIntDescriptor& d,
return
spinBox
;
}
DoubleSpinBox
*
GUI
::
Util
::
createSpinBox
(
QFormLayout
*
parentLayout
,
const
DoubleDescriptor
&
d
)
DoubleSpinBox
*
GUI
::
Util
::
createSpinBox
(
QFormLayout
*
parentLayout
,
const
DoubleDescriptor
&
d
,
std
::
function
<
void
(
double
)
>
slot
)
{
auto
*
sb
=
new
DoubleSpinBox
(
parentLayout
->
parentWidget
(),
d
);
parentLayout
->
addRow
(
labelWithUnit
(
d
.
label
,
d
.
unit
)
+
":"
,
sb
);
if
(
slot
)
QObject
::
connect
(
sb
,
&
DoubleSpinBox
::
baseValueChanged
,
[
=
](
int
v
)
{
slot
(
v
);
});
return
sb
;
}
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Tool/WidgetUtils.h
+
4
−
2
View file @
01f38113
...
...
@@ -91,8 +91,10 @@ QSpinBox* createSpinBox(QFormLayout* parentLayout, const UIntDescriptor& d);
//!
//! No connections to update the descriptor will be established! Therefore changes in the spin box
//! will *not* be notified to the descriptor. The additional (and optional) slot can be used to be
//! notified about a value change.
DoubleSpinBox
*
createSpinBox
(
QFormLayout
*
parentLayout
,
const
DoubleDescriptor
&
d
);
//! notified about a value change (the notified new value is in the base unit of the
//! DoubleDescriptor).
DoubleSpinBox
*
createSpinBox
(
QFormLayout
*
parentLayout
,
const
DoubleDescriptor
&
d
,
std
::
function
<
void
(
double
)
>
slot
=
nullptr
);
//! Create a label with an optional unit in brackets.
//!
...
...
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