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
8b0b8906
Commit
8b0b8906
authored
Oct 28, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2140 from dogmaphobic/debugWindow
Debug window to help define device sizing issues.
parents
cd6a0a28
5c3a79b9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
177 additions
and
11 deletions
+177
-11
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
ScreenTools.qml
src/QmlControls/ScreenTools.qml
+1
-0
ScreenToolsController.h
src/QmlControls/ScreenToolsController.h
+14
-11
DebugWindow.qml
src/VehicleSetup/DebugWindow.qml
+145
-0
SetupView.qml
src/VehicleSetup/SetupView.qml
+16
-0
No files found.
qgroundcontrol.qrc
View file @
8b0b8906
...
...
@@ -60,6 +60,7 @@
<file alias="FirmwareUpgrade.qml">src/VehicleSetup/FirmwareUpgrade.qml</file>
<file alias="JoystickConfig.qml">src/VehicleSetup/JoystickConfig.qml</file>
<file alias="SetupParameterEditor.qml">src/VehicleSetup/SetupParameterEditor.qml</file>
<file alias="DebugWindow.qml">src/VehicleSetup/DebugWindow.qml</file>
<file alias="CustomCommandWidget.qml">src/ViewWidgets/CustomCommandWidget.qml</file>
<file alias="SafetyComponent.qml">src/AutoPilotPlugins/PX4/SafetyComponent.qml</file>
...
...
src/QmlControls/ScreenTools.qml
View file @
8b0b8906
...
...
@@ -21,6 +21,7 @@ Item {
property
bool
isAndroid
:
ScreenToolsController
.
isAndroid
property
bool
isiOS
:
ScreenToolsController
.
isiOS
property
bool
isMobile
:
ScreenToolsController
.
isMobile
property
bool
isDebug
:
ScreenToolsController
.
isDebug
function
mouseX
()
{
return
ScreenToolsController
.
mouseX
()
...
...
src/QmlControls/ScreenToolsController.h
View file @
8b0b8906
...
...
@@ -36,7 +36,7 @@
@brief Screen helper tools for QML widgets
To use its functions, you need to import the module with the following line:
@code
@endcode
*/
...
...
@@ -51,6 +51,7 @@ public:
Q_PROPERTY
(
bool
isiOS
READ
isiOS
CONSTANT
)
Q_PROPERTY
(
bool
isMobile
READ
isMobile
CONSTANT
)
Q_PROPERTY
(
bool
testHighDPI
READ
testHighDPI
CONSTANT
)
Q_PROPERTY
(
bool
isDebug
READ
isDebug
CONSTANT
)
//! Used to trigger a \c Canvas element repaint.
/*!
...
...
@@ -82,15 +83,15 @@ public:
// Returns current mouse position
Q_INVOKABLE
int
mouseX
(
void
)
{
return
QCursor
::
pos
().
x
();
}
Q_INVOKABLE
int
mouseY
(
void
)
{
return
QCursor
::
pos
().
y
();
}
// Used to adjust default font size on an OS basis
Q_PROPERTY
(
double
defaultFontPixelSizeRatio
MEMBER
_defaultFontPixelSizeRatio
CONSTANT
)
// Used to calculate font sizes based on default font size
// Used to adjust default font size on an OS basis
Q_PROPERTY
(
double
defaultFontPixelSizeRatio
MEMBER
_defaultFontPixelSizeRatio
CONSTANT
)
// Used to calculate font sizes based on default font size
Q_PROPERTY
(
double
smallFontPixelSizeRatio
MEMBER
_smallFontPixelSizeRatio
CONSTANT
)
Q_PROPERTY
(
double
mediumFontPixelSizeRatio
MEMBER
_mediumFontPixelSizeRatio
CONSTANT
)
Q_PROPERTY
(
double
largeFontPixelSizeRatio
MEMBER
_largeFontPixelSizeRatio
CONSTANT
)
#if defined (__android__)
bool
isAndroid
()
{
return
true
;
}
bool
isiOS
()
{
return
false
;
}
...
...
@@ -104,11 +105,13 @@ public:
bool
isiOS
()
{
return
false
;
}
bool
isMobile
()
{
return
qgcApp
()
->
fakeMobile
();
}
#endif
#ifdef QT_DEBUG
bool
testHighDPI
(
void
)
{
return
qgcApp
()
->
testHighDPI
();
}
bool
testHighDPI
()
{
return
qgcApp
()
->
testHighDPI
();
}
bool
isDebug
()
{
return
true
;
}
#else
bool
testHighDPI
(
void
)
{
return
false
;
}
bool
isDebug
()
{
return
false
;
}
bool
testHighDPI
()
{
return
false
;
}
#endif
signals:
...
...
@@ -118,8 +121,8 @@ private slots:
void
_updateCanvas
();
private:
static
const
double
_defaultFontPixelSizeRatio
;
static
const
double
_smallFontPixelSizeRatio
;
static
const
double
_defaultFontPixelSizeRatio
;
static
const
double
_smallFontPixelSizeRatio
;
static
const
double
_mediumFontPixelSizeRatio
;
static
const
double
_largeFontPixelSizeRatio
;
};
...
...
src/VehicleSetup/DebugWindow.qml
0 → 100644
View file @
8b0b8906
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.2
import
QtQuick
.
Dialogs
1.2
import
QtQuick
.
Layouts
1.2
import
QtQuick
.
Window
2.2
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controllers
1.0
import
QGroundControl
.
ScreenTools
1.0
QGCView
{
id
:
qgcView
viewPanel
:
panel
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
panel
.
enabled
}
QGCViewPanel
{
id
:
panel
anchors.fill
:
parent
Text
{
id
:
_textMeasure
text
:
"
X
"
color
:
qgcPal
.
window
}
GridLayout
{
anchors.margins
:
20
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
columns
:
2
Text
{
text
:
"
Qt Platform:
"
color
:
qgcPal
.
text
}
Text
{
text
:
Qt
.
platform
.
os
color
:
qgcPal
.
text
}
Text
{
text
:
"
Default font width:
"
color
:
qgcPal
.
text
}
Text
{
text
:
_textMeasure
.
contentWidth
color
:
qgcPal
.
text
}
Text
{
text
:
"
Default font height:
"
color
:
qgcPal
.
text
}
Text
{
text
:
_textMeasure
.
contentHeight
color
:
qgcPal
.
text
}
Text
{
text
:
"
Default font pixel size:
"
color
:
qgcPal
.
text
}
Text
{
text
:
_textMeasure
.
font
.
pixelSize
color
:
qgcPal
.
text
}
Text
{
text
:
"
Default font point size:
"
color
:
qgcPal
.
text
}
Text
{
text
:
_textMeasure
.
font
.
pointSize
color
:
qgcPal
.
text
}
Text
{
text
:
"
QML Screen Desktop:
"
color
:
qgcPal
.
text
}
Text
{
text
:
Screen
.
desktopAvailableWidth
+
"
x
"
+
Screen
.
desktopAvailableHeight
color
:
qgcPal
.
text
}
Text
{
text
:
"
QML Screen Size:
"
color
:
qgcPal
.
text
}
Text
{
text
:
Screen
.
width
+
"
x
"
+
Screen
.
height
color
:
qgcPal
.
text
}
Text
{
text
:
"
QML Pixel Density:
"
color
:
qgcPal
.
text
}
Text
{
text
:
Screen
.
pixelDensity
color
:
qgcPal
.
text
}
Text
{
text
:
"
QML Pixel Ratio:
"
color
:
qgcPal
.
text
}
Text
{
text
:
Screen
.
devicePixelRatio
color
:
qgcPal
.
text
}
}
Rectangle
{
width
:
100
height
:
100
color
:
qgcPal
.
text
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
anchors.margins
:
10
Text
{
text
:
"
100x100
"
anchors.centerIn
:
parent
color
:
qgcPal
.
window
}
}
}
}
src/VehicleSetup/SetupView.qml
View file @
8b0b8906
...
...
@@ -110,6 +110,11 @@ Rectangle {
}
}
function
showDebugPanel
()
{
panelLoader
.
source
=
"
DebugWindow.qml
"
;
}
Component.onCompleted
:
showSummaryPanel
()
Connections
{
...
...
@@ -297,6 +302,17 @@ Rectangle {
onClicked
:
showParametersPanel
()
}
SubMenuButton
{
width
:
_buttonWidth
setupIndicator
:
false
exclusiveGroup
:
setupButtonGroup
visible
:
ScreenTools
.
isDebug
text
:
"
DEBUG
"
onClicked
:
showDebugPanel
()
}
}
// Column
}
// Flickable
...
...
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