Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
739c07bc
Commit
739c07bc
authored
May 26, 2015
by
Don Gagne
Browse files
No MainWindow possible when unit testing
parent
fc0bc98d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/QmlControls/ScreenTools.cc
View file @
739c07bc
...
...
@@ -36,9 +36,14 @@ const double ScreenTools::_largeFontPointSize = 20;
ScreenTools
::
ScreenTools
()
{
connect
(
MainWindow
::
instance
(),
&
MainWindow
::
repaintCanvas
,
this
,
&
ScreenTools
::
_updateCanvas
);
connect
(
MainWindow
::
instance
(),
&
MainWindow
::
pixelSizeChanged
,
this
,
&
ScreenTools
::
_updatePixelSize
);
connect
(
MainWindow
::
instance
(),
&
MainWindow
::
fontSizeChanged
,
this
,
&
ScreenTools
::
_updateFontSize
);
MainWindow
*
mainWindow
=
MainWindow
::
instance
();
// Unit tests can run Qml without MainWindow
if
(
mainWindow
)
{
connect
(
mainWindow
,
&
MainWindow
::
repaintCanvas
,
this
,
&
ScreenTools
::
_updateCanvas
);
connect
(
mainWindow
,
&
MainWindow
::
pixelSizeChanged
,
this
,
&
ScreenTools
::
_updatePixelSize
);
connect
(
mainWindow
,
&
MainWindow
::
fontSizeChanged
,
this
,
&
ScreenTools
::
_updateFontSize
);
}
}
qreal
ScreenTools
::
adjustFontPointSize
(
qreal
pointSize
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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