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
2b1c0d77
Commit
2b1c0d77
authored
1 year ago
by
Wuttke, Joachim
Committed by
Wuttke, Joachim
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
clang-format
parent
8e11c9cb
No related branches found
No related tags found
1 merge request
!2205
rewrite DoubleSpinBox; use DoubleSpinBox for intensity; simplify RealLimits (#870)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/View/Numeric/DoubleSpinBox.cpp
+2
-3
2 additions, 3 deletions
GUI/View/Numeric/DoubleSpinBox.cpp
GUI/View/Numeric/DoubleSpinBox.h
+3
-1
3 additions, 1 deletion
GUI/View/Numeric/DoubleSpinBox.h
with
5 additions
and
4 deletions
GUI/View/Numeric/DoubleSpinBox.cpp
+
2
−
3
View file @
2b1c0d77
...
@@ -28,7 +28,7 @@ QString toString(double val, int decimal_points = 4) // TODO merge with other to
...
@@ -28,7 +28,7 @@ QString toString(double val, int decimal_points = 4) // TODO merge with other to
return
"0"
;
return
"0"
;
QString
result
=
(
val
>=
10000
||
val
<
0.1
)
?
QString
::
number
(
val
,
'e'
,
decimal_points
)
QString
result
=
(
val
>=
10000
||
val
<
0.1
)
?
QString
::
number
(
val
,
'e'
,
decimal_points
)
:
QString
::
number
(
val
,
'f'
,
decimal_points
);
:
QString
::
number
(
val
,
'f'
,
decimal_points
);
// suppress ".0" in mantissa; normalize exponent
// suppress ".0" in mantissa; normalize exponent
return
result
.
replace
(
QRegularExpression
(
"(
\\
.?0+)?((e)([
\\
+]?)([-]?)(0*)([1-9].*))?$"
),
return
result
.
replace
(
QRegularExpression
(
"(
\\
.?0+)?((e)([
\\
+]?)([-]?)(0*)([1-9].*))?$"
),
...
@@ -71,11 +71,10 @@ void DoubleSpinBox::wheelEvent(QWheelEvent* event)
...
@@ -71,11 +71,10 @@ void DoubleSpinBox::wheelEvent(QWheelEvent* event)
void
DoubleSpinBox
::
stepBy
(
int
steps
)
void
DoubleSpinBox
::
stepBy
(
int
steps
)
{
{
if
(
steps
>
0
)
if
(
steps
>
0
)
setValue
(
m_valueProperty
*
1.2
);
setValue
(
m_valueProperty
*
1.2
);
else
else
setValue
(
m_valueProperty
/
1.2
);
setValue
(
m_valueProperty
/
1.2
);
}
}
void
DoubleSpinBox
::
onDisplayValueChanged
()
void
DoubleSpinBox
::
onDisplayValueChanged
()
...
...
This diff is collapsed.
Click to expand it.
GUI/View/Numeric/DoubleSpinBox.h
+
3
−
1
View file @
2b1c0d77
...
@@ -43,7 +43,9 @@ signals:
...
@@ -43,7 +43,9 @@ signals:
private:
private:
QAbstractSpinBox
::
StepEnabled
stepEnabled
()
const
override
QAbstractSpinBox
::
StepEnabled
stepEnabled
()
const
override
{
return
StepUpEnabled
|
StepDownEnabled
;
}
{
return
StepUpEnabled
|
StepDownEnabled
;
}
void
setValue
(
double
val
);
void
setValue
(
double
val
);
void
wheelEvent
(
QWheelEvent
*
event
)
override
;
void
wheelEvent
(
QWheelEvent
*
event
)
override
;
void
stepBy
(
int
steps
)
override
;
void
stepBy
(
int
steps
)
override
;
...
...
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