Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qt3dstudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
public-demos
qt3dstudio
Commits
893442db
Commit
893442db
authored
Mar 16, 2018
by
Tomi Korpipää
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use data inputs with properties
Also fix application for macOS
parent
afe29dc8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
kria-cluster-3d-demo/main.cpp
kria-cluster-3d-demo/main.cpp
+10
-0
kria-cluster-3d-demo/qml/main.qml
kria-cluster-3d-demo/qml/main.qml
+4
-11
No files found.
kria-cluster-3d-demo/main.cpp
View file @
893442db
...
...
@@ -56,6 +56,16 @@
int
main
(
int
argc
,
char
*
argv
[])
{
#if defined(Q_OS_MACOS)
QSurfaceFormat
openGLFormat
;
openGLFormat
.
setRenderableType
(
QSurfaceFormat
::
OpenGL
);
openGLFormat
.
setProfile
(
QSurfaceFormat
::
CoreProfile
);
openGLFormat
.
setMajorVersion
(
4
);
openGLFormat
.
setMinorVersion
(
1
);
openGLFormat
.
setStencilBufferSize
(
8
);
QSurfaceFormat
::
setDefaultFormat
(
openGLFormat
);
#endif
QGuiApplication
app
(
argc
,
argv
);
QQuickView
viewer
;
...
...
kria-cluster-3d-demo/qml/main.qml
View file @
893442db
...
...
@@ -112,21 +112,25 @@ Item {
DataInput
{
id
:
tachometerNeedle
name
:
"
tacho
"
value
:
simuData
.
rpm
}
DataInput
{
id
:
tachometerText
name
:
"
tachoText
"
value
:
(
simuData
.
rpm
/
1000.0
).
toFixed
(
1
)
}
DataInput
{
id
:
speedometerNeedle
name
:
"
speed
"
value
:
simuData
.
speed
}
DataInput
{
id
:
speedometerText
name
:
"
speedText
"
value
:
useMetric
?
simuData
.
speed
.
toFixed
(
0
)
:
(
simuData
.
speed
/
1.625
).
toFixed
(
0
)
}
DataInput
{
...
...
@@ -242,17 +246,6 @@ Item {
onTimeChanged
:
{
indicatorPane
.
time
.
text
=
time
;
}
// Connect speed
onSpeedChanged
:
{
speedometerNeedle
.
setValue
(
speed
);
if
(
useMetric
)
speedometerText
.
setValue
(
speed
.
toFixed
(
0
));
else
speedometerText
.
setValue
((
speed
/
1.625
).
toFixed
(
0
));
tachometerNeedle
.
setValue
(
rpm
);
tachometerText
.
setValue
((
rpm
/
1000.0
).
toFixed
(
1
));
}
}
function
menuSelect
(
next
)
{
...
...
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