Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
5b65318a
Commit
5b65318a
authored
Jun 29, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Validation support
parent
8e9dd2f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
4 deletions
+35
-4
FactTextField.qml
src/FactSystem/FactControls/FactTextField.qml
+33
-3
QGCView.qml
src/QmlControls/QGCView.qml
+2
-1
No files found.
src/FactSystem/FactControls/FactTextField.qml
View file @
5b65318a
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
QGCTextField
{
property
Fact
fact
:
null
text
:
fact
.
valueString
id
:
_textField
property
Fact
fact
:
null
property
string
_validateString
text
:
fact
.
valueString
unitsLabel
:
fact
.
units
onEditingFinished
:
fact
.
value
=
text
onEditingFinished
:
{
if
(
qgcView
)
{
var
errorString
=
fact
.
validate
(
text
,
false
/* convertOnly */
)
if
(
errorString
==
""
)
{
fact
.
value
=
text
}
else
{
_validateString
=
text
qgcView
.
showDialog
(
editorDialogComponent
,
"
Invalid Parameter Value
"
,
50
,
StandardButton
.
Save
)
}
}
else
{
fact
.
value
=
text
fact
.
valueChanged
(
fact
.
value
)
}
}
Component
{
id
:
editorDialogComponent
ParameterEditorDialog
{
validate
:
true
validateValue
:
_validateString
fact
:
_textField
.
fact
}
}
}
src/QmlControls/QGCView.qml
View file @
5b65318a
...
...
@@ -37,7 +37,8 @@ import QGroundControl.FactControls 1.0
FactPanel
{
id
:
__rootItem
property
bool
completedSignalled
:
false
property
var
qgcView
:
__rootItem
/// Used by Fact controls for validation dialogs
property
bool
completedSignalled
:
false
property
var
viewPanel
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment