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
54a52c87
Commit
54a52c87
authored
Jul 28, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Figure out if device has touch control
parent
a85e2068
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
QGCApplication.h
src/QGCApplication.h
+1
-1
ScreenToolsController.cc
src/QmlControls/ScreenToolsController.cc
+6
-0
ScreenToolsController.h
src/QmlControls/ScreenToolsController.h
+5
-2
No files found.
src/QGCApplication.h
View file @
54a52c87
...
...
@@ -79,7 +79,7 @@ public:
void
showMessage
(
const
QString
&
message
);
/// @return true: Fake ui into showing mobile interface
bool
fakeMobile
(
void
)
{
return
_fakeMobile
;
}
bool
fakeMobile
(
void
)
const
{
return
_fakeMobile
;
}
// Still working on getting rid of this and using dependency injection instead for everything
QGCToolbox
*
toolbox
(
void
)
{
return
_toolbox
;
}
...
...
src/QmlControls/ScreenToolsController.cc
View file @
54a52c87
...
...
@@ -26,6 +26,12 @@ ScreenToolsController::ScreenToolsController()
}
bool
ScreenToolsController
::
hasTouch
()
const
{
return
QTouchDevice
::
devices
().
count
()
>
0
||
isMobile
();
}
QString
ScreenToolsController
::
iOSDevice
()
const
{
...
...
src/QmlControls/ScreenToolsController.h
View file @
54a52c87
...
...
@@ -37,6 +37,7 @@ public:
Q_PROPERTY
(
bool
isLinux
READ
isLinux
CONSTANT
)
Q_PROPERTY
(
bool
isWindows
READ
isWindows
CONSTANT
)
Q_PROPERTY
(
bool
isSerialAvailable
READ
isSerialAvailable
CONSTANT
)
Q_PROPERTY
(
bool
hasTouch
READ
hasTouch
CONSTANT
)
Q_PROPERTY
(
QString
iOSDevice
READ
iOSDevice
CONSTANT
)
Q_PROPERTY
(
QString
fixedFontFamily
READ
fixedFontFamily
CONSTANT
)
Q_PROPERTY
(
QString
normalFontFamily
READ
normalFontFamily
CONSTANT
)
...
...
@@ -47,9 +48,9 @@ public:
Q_INVOKABLE
int
mouseY
(
void
)
{
return
QCursor
::
pos
().
y
();
}
#if defined(__mobile__)
bool
isMobile
()
{
return
true
;
}
bool
isMobile
()
const
{
return
true
;
}
#else
bool
isMobile
()
{
return
qgcApp
()
->
fakeMobile
();
}
bool
isMobile
()
const
{
return
qgcApp
()
->
fakeMobile
();
}
#endif
#if defined (Q_OS_ANDROID)
...
...
@@ -102,6 +103,8 @@ public:
bool
isDebug
()
{
return
false
;
}
#endif
bool
hasTouch
()
const
;
QString
iOSDevice
()
const
;
QString
fixedFontFamily
()
const
;
QString
normalFontFamily
()
const
;
...
...
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