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
f19c3cfc
Commit
f19c3cfc
authored
Sep 12, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1869 from DonLakeFlyer/TestHighDPI
Add --test-high-dpi command line option
parents
cd2d960a
ae7becb5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
8 deletions
+40
-8
QGCApplication.cc
src/QGCApplication.cc
+6
-0
QGCApplication.h
src/QGCApplication.h
+8
-0
ScreenTools.qml
src/QmlControls/ScreenTools.qml
+7
-4
ScreenToolsController.cc
src/QmlControls/ScreenToolsController.cc
+9
-1
ScreenToolsController.h
src/QmlControls/ScreenToolsController.h
+10
-3
No files found.
src/QGCApplication.cc
View file @
f19c3cfc
...
...
@@ -154,6 +154,9 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
,
_styleIsDark
(
true
)
,
_fakeMobile
(
false
)
,
_useNewMissionEditor
(
false
)
#ifdef QT_DEBUG
,
_testHighDPI
(
false
)
#endif
{
Q_ASSERT
(
_app
==
NULL
);
_app
=
this
;
...
...
@@ -172,6 +175,9 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
{
"--clear-settings"
,
&
fClearSettingsOptions
,
QString
()
},
{
"--full-logging"
,
&
fullLogging
,
QString
()
},
{
"--fake-mobile"
,
&
_fakeMobile
,
QString
()
},
#ifdef QT_DEBUG
{
"--test-high-dpi"
,
&
_testHighDPI
,
QString
()
},
#endif
// Add additional command line option flags here
};
...
...
src/QGCApplication.h
View file @
f19c3cfc
...
...
@@ -109,6 +109,10 @@ public:
bool
useNewMissionEditor
(
void
)
{
return
_useNewMissionEditor
;
}
void
setUseNewMissionEditor
(
bool
use
);
#ifdef QT_DEBUG
bool
testHighDPI
(
void
)
{
return
_testHighDPI
;
}
#endif
public
slots
:
/// You can connect to this slot to show an information message box from a different thread.
void
informationMessageBoxOnMainThread
(
const
QString
&
title
,
const
QString
&
msg
);
...
...
@@ -179,6 +183,10 @@ private:
bool
_fakeMobile
;
///< true: Fake ui into displaying mobile interface
bool
_useNewMissionEditor
;
///< true: Use new Mission Editor
#ifdef QT_DEBUG
bool
_testHighDPI
;
///< true: double fonts sizes for simulating high dpi devices
#endif
/// Unit Test have access to creating and destroying singletons
friend
class
UnitTest
;
...
...
src/QmlControls/ScreenTools.qml
View file @
f19c3cfc
...
...
@@ -8,9 +8,9 @@ import QGroundControl.ScreenToolsController 1.0
Item
{
signal
repaintRequested
readonly
property
real
defaultFontPixelSize
:
_textMeasure
.
conte
ntHeight
*
ScreenToolsController
.
defaultFontPixelSizeRatio
readonly
property
real
defaultFontPixelSize
:
_textMeasure
.
fo
ntHeight
*
ScreenToolsController
.
defaultFontPixelSizeRatio
readonly
property
real
defaultFontPixelHeight
:
defaultFontPixelSize
readonly
property
real
defaultFontPixelWidth
:
_textMeasure
.
conte
ntWidth
readonly
property
real
defaultFontPixelWidth
:
_textMeasure
.
fo
ntWidth
readonly
property
real
smallFontPixelSize
:
defaultFontPixelSize
*
ScreenToolsController
.
smallFontPixelSizeRatio
readonly
property
real
mediumFontPixelSize
:
defaultFontPixelSize
*
ScreenToolsController
.
mediumFontPixelSizeRatio
readonly
property
real
largeFontPixelSize
:
defaultFontPixelSize
*
ScreenToolsController
.
largeFontPixelSizeRatio
...
...
@@ -28,8 +28,11 @@ Item {
}
Text
{
id
:
_textMeasure
text
:
"
X
"
id
:
_textMeasure
text
:
"
X
"
property
real
fontWidth
:
contentWidth
*
(
ScreenToolsController
.
testHighDPI
?
2
:
1
)
property
real
fontHeight
:
contentHeight
*
(
ScreenToolsController
.
testHighDPI
?
2
:
1
)
}
Connections
{
...
...
src/QmlControls/ScreenToolsController.cc
View file @
f19c3cfc
...
...
@@ -59,6 +59,14 @@ double ScreenToolsController::getQmlDefaultFontPixelSize(void)
qmlWidgetHolder
.
setSource
(
QUrl
::
fromUserInput
(
"qrc:/qml/ScreenToolsFontQuery.qml"
));
}
double
qmlDefaultFontPixelSize
=
_qmlDefaultFontPixelSize
;
#ifdef QT_DEBUG
if
(
qgcApp
()
->
testHighDPI
())
{
qmlDefaultFontPixelSize
*=
2
;
}
#endif
return
_
qmlDefaultFontPixelSize
;
return
qmlDefaultFontPixelSize
;
}
src/QmlControls/ScreenToolsController.h
View file @
f19c3cfc
...
...
@@ -47,9 +47,10 @@ class ScreenToolsController : public QQuickItem
public:
ScreenToolsController
();
Q_PROPERTY
(
bool
isAndroid
READ
isAndroid
CONSTANT
)
Q_PROPERTY
(
bool
isiOS
READ
isiOS
CONSTANT
)
Q_PROPERTY
(
bool
isMobile
READ
isMobile
CONSTANT
)
Q_PROPERTY
(
bool
isAndroid
READ
isAndroid
CONSTANT
)
Q_PROPERTY
(
bool
isiOS
READ
isiOS
CONSTANT
)
Q_PROPERTY
(
bool
isMobile
READ
isMobile
CONSTANT
)
Q_PROPERTY
(
bool
testHighDPI
READ
testHighDPI
CONSTANT
)
//! Used to trigger a \c Canvas element repaint.
/*!
...
...
@@ -112,6 +113,12 @@ public:
bool
isiOS
()
{
return
false
;
}
bool
isMobile
()
{
return
qgcApp
()
->
fakeMobile
();
}
#endif
#ifdef QT_DEBUG
bool
testHighDPI
(
void
)
{
return
qgcApp
()
->
testHighDPI
();
}
#else
bool
testHighDPI
(
void
)
{
return
false
;
}
#endif
signals:
void
repaintRequested
(
void
);
...
...
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