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
d85733f9
Commit
d85733f9
authored
Jun 26, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #722 from Susurrus/qt5_fixes
Qt5 fixes
parents
2e4ac6be
f7a8627f
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
42 additions
and
42 deletions
+42
-42
GAudioOutput.cc
src/GAudioOutput.cc
+1
-1
QGCVideoWidget.cc
src/apps/qgcvideo/QGCVideoWidget.cc
+2
-2
QGCFlightGearLink.cc
src/comm/QGCFlightGearLink.cc
+1
-1
QGCJSBSimLink.cc
src/comm/QGCJSBSimLink.cc
+1
-1
QGCParamID.h
src/comm/QGCParamID.h
+1
-1
QGCXPlaneLink.cc
src/comm/QGCXPlaneLink.cc
+2
-3
XbeeLink.cpp
src/comm/XbeeLink.cpp
+1
-1
UAS.cc
src/uas/UAS.cc
+3
-3
CameraView.cc
src/ui/CameraView.cc
+3
-3
HUD.cc
src/ui/HUD.cc
+2
-2
MainWindow.cc
src/ui/MainWindow.cc
+19
-18
QGCSettingsWidget.cc
src/ui/QGCSettingsWidget.cc
+1
-1
Q3DWidget.cc
src/ui/map3D/Q3DWidget.cc
+2
-2
QGCMAVLinkMessageSender.cc
src/ui/mavlink/QGCMAVLinkMessageSender.cc
+3
-3
No files found.
src/GAudioOutput.cc
View file @
d85733f9
...
...
@@ -223,7 +223,7 @@ bool GAudioOutput::say(QString text, int severity)
text
=
"
\\
"
+
text
;
QStdWString
str
=
text
.
toStdWString
();
unsigned
char
str2
[
1024
]
=
{};
memcpy
(
str2
,
text
.
to
Ascii
().
data
(),
str
.
length
());
memcpy
(
str2
,
text
.
to
Latin1
().
data
(),
str
.
length
());
SpeakString
(
str2
);
res
=
true
;
#endif // Q_OS_MAC
...
...
src/apps/qgcvideo/QGCVideoWidget.cc
View file @
d85733f9
...
...
@@ -151,7 +151,7 @@ QGCVideoWidget::QGCVideoWidget(QWidget* parent)
// Fill with black background
QImage
fill
=
QImage
(
640
,
480
,
QImage
::
Format_Indexed8
);
fill
.
set
NumColors
(
3
);
fill
.
set
ColorCount
(
3
);
fill
.
setColor
(
0
,
qRgb
(
0
,
0
,
0
));
fill
.
setColor
(
1
,
qRgb
(
0
,
0
,
0
));
fill
.
setColor
(
2
,
qRgb
(
0
,
0
,
0
));
...
...
@@ -1136,7 +1136,7 @@ void QGCVideoWidget::commitRawDataToGL()
QImage
*
newImage
=
new
QImage
(
rawImage
,
receivedWidth
,
receivedHeight
,
format
);
if
(
format
==
QImage
::
Format_Indexed8
)
{
// Create matching color table
newImage
->
set
NumColors
(
256
);
newImage
->
set
ColorCount
(
256
);
for
(
int
i
=
0
;
i
<
256
;
i
++
)
{
newImage
->
setColor
(
i
,
qRgb
(
i
,
i
,
i
));
//qDebug() << __FILE__ << __LINE__ << std::hex << i;
...
...
src/comm/QGCFlightGearLink.cc
View file @
d85733f9
...
...
@@ -236,7 +236,7 @@ void QGCFlightGearLink::updateControls(quint64 time, float rollAilerons, float p
{
QString
state
(
"%1
\t
%2
\t
%3
\t
%4
\t
%5
\n
"
);
state
=
state
.
arg
(
rollAilerons
).
arg
(
pitchElevator
).
arg
(
yawRudder
).
arg
(
true
).
arg
(
throttle
);
writeBytes
(
state
.
to
Ascii
().
constData
(),
state
.
length
());
writeBytes
(
state
.
to
Latin1
().
constData
(),
state
.
length
());
//qDebug() << "Updated controls" << rollAilerons << pitchElevator << yawRudder << throttle;
//qDebug() << "Updated controls" << state;
}
...
...
src/comm/QGCJSBSimLink.cc
View file @
d85733f9
...
...
@@ -257,7 +257,7 @@ void QGCJSBSimLink::updateControls(quint64 time, float rollAilerons, float pitch
{
QString
state
(
"%1
\t
%2
\t
%3
\t
%4
\t
%5
\n
"
);
state
=
state
.
arg
(
rollAilerons
).
arg
(
pitchElevator
).
arg
(
yawRudder
).
arg
(
true
).
arg
(
throttle
);
writeBytes
(
state
.
to
Ascii
().
constData
(),
state
.
length
());
writeBytes
(
state
.
to
Latin1
().
constData
(),
state
.
length
());
}
else
{
...
...
src/comm/QGCParamID.h
View file @
d85733f9
...
...
@@ -72,7 +72,7 @@ public:
return
static_cast
<
const
QString
>
(
data
);
}
int8_t
*
toInt8_t
()
const
{
return
(
int8_t
*
)
data
.
to
Ascii
().
data
();
return
(
int8_t
*
)
data
.
to
Latin1
().
data
();
}
protected:
...
...
src/comm/QGCXPlaneLink.cc
View file @
d85733f9
...
...
@@ -226,8 +226,8 @@ void QGCXPlaneLink::run()
}
ip
.
index
=
0
;
strncpy
(
ip
.
str_ipad_them
,
localAddrStr
.
to
Ascii
(),
qMin
((
int
)
sizeof
(
ip
.
str_ipad_them
),
16
));
strncpy
(
ip
.
str_port_them
,
localPortStr
.
to
Ascii
(),
qMin
((
int
)
sizeof
(
ip
.
str_port_them
),
6
));
strncpy
(
ip
.
str_ipad_them
,
localAddrStr
.
to
Latin1
(),
qMin
((
int
)
sizeof
(
ip
.
str_ipad_them
),
16
));
strncpy
(
ip
.
str_port_them
,
localPortStr
.
to
Latin1
(),
qMin
((
int
)
sizeof
(
ip
.
str_port_them
),
6
));
ip
.
use_ip
=
1
;
writeBytes
((
const
char
*
)
&
ip
,
sizeof
(
ip
));
...
...
@@ -261,7 +261,6 @@ void QGCXPlaneLink::run()
emit
simulationDisconnected
();
emit
simulationConnected
(
false
);
emit
finished
();
}
void
QGCXPlaneLink
::
setPort
(
int
localPort
)
...
...
src/comm/XbeeLink.cpp
View file @
d85733f9
...
...
@@ -73,7 +73,7 @@ bool XbeeLink::setPortName(QString portName)
m_portName
=
new
char
[
this
->
m_portNameLength
];
for
(
int
i
=
0
;
i
<
list
[
0
].
size
();
i
++
)
{
this
->
m_portName
[
i
]
=
list
[
0
][
i
].
to
Ascii
();
this
->
m_portName
[
i
]
=
list
[
0
][
i
].
to
Latin1
();
}
this
->
m_portName
[
list
[
0
].
size
()]
=
'\0'
;
}
...
...
src/uas/UAS.cc
View file @
d85733f9
...
...
@@ -2563,7 +2563,7 @@ void UAS::setParameter(const int compId, const QString& paramId, const QVariant&
switch
((
int
)
value
.
type
())
{
case
QVariant
:
:
Char
:
union_value
.
param_float
=
(
unsigned
char
)
value
.
toChar
().
to
Ascii
();
union_value
.
param_float
=
(
unsigned
char
)
value
.
toChar
().
to
Latin1
();
p
.
param_type
=
MAV_PARAM_TYPE_INT8
;
break
;
case
QVariant
:
:
Int
:
...
...
@@ -2588,7 +2588,7 @@ void UAS::setParameter(const int compId, const QString& paramId, const QVariant&
switch
((
int
)
value
.
type
())
{
case
QVariant
:
:
Char
:
union_value
.
param_int8
=
(
unsigned
char
)
value
.
toChar
().
to
Ascii
();
union_value
.
param_int8
=
(
unsigned
char
)
value
.
toChar
().
to
Latin1
();
p
.
param_type
=
MAV_PARAM_TYPE_INT8
;
break
;
case
QVariant
:
:
Int
:
...
...
@@ -2621,7 +2621,7 @@ void UAS::setParameter(const int compId, const QString& paramId, const QVariant&
// String characters
if
((
int
)
i
<
paramId
.
length
())
{
p
.
param_id
[
i
]
=
paramId
.
to
Ascii
()[
i
];
p
.
param_id
[
i
]
=
paramId
.
to
Latin1
()[
i
];
}
else
{
...
...
src/ui/CameraView.cc
View file @
d85733f9
...
...
@@ -49,7 +49,7 @@ CameraView::CameraView(int width, int height, int depth, int channels, QWidget*
// Fill with black background
QImage
fill
=
QImage
(
width
,
height
,
QImage
::
Format_Indexed8
);
fill
.
set
NumColors
(
1
);
fill
.
set
ColorCount
(
1
);
fill
.
setColor
(
0
,
qRgb
(
70
,
200
,
70
));
fill
.
fill
(
CameraView
::
initialColor
);
glImage
=
QGLWidget
::
convertToGLFormat
(
fill
);
...
...
@@ -104,7 +104,7 @@ void CameraView::setImageSize(int width, int height, int depth, int channels)
if
(
depth
<=
8
&&
channels
==
1
)
{
image
=
new
QImage
(
receivedWidth
,
receivedHeight
,
QImage
::
Format_Indexed8
);
// Create matching color table
image
->
set
NumColors
(
256
);
image
->
set
ColorCount
(
256
);
for
(
int
i
=
0
;
i
<
256
;
i
++
)
{
image
->
setColor
(
i
,
qRgb
(
i
,
i
,
i
));
//qDebug() << __FILE__ << __LINE__ << std::hex << i;
...
...
@@ -162,7 +162,7 @@ void CameraView::commitRawDataToGL()
QImage
*
newImage
=
new
QImage
(
rawImage
,
receivedWidth
,
receivedHeight
,
format
);
if
(
format
==
QImage
::
Format_Indexed8
)
{
// Create matching color table
newImage
->
set
NumColors
(
256
);
newImage
->
set
ColorCount
(
256
);
for
(
int
i
=
0
;
i
<
256
;
i
++
)
{
newImage
->
setColor
(
i
,
qRgb
(
i
,
i
,
i
));
//qDebug() << __FILE__ << __LINE__ << std::hex << i;
...
...
src/ui/HUD.cc
View file @
d85733f9
...
...
@@ -1212,7 +1212,7 @@ void HUD::setImageSize(int width, int height, int depth, int channels)
if
(
depth
<=
8
&&
channels
==
1
)
{
image
=
new
QImage
(
receivedWidth
,
receivedHeight
,
QImage
::
Format_Indexed8
);
// Create matching color table
image
->
set
NumColors
(
256
);
image
->
set
ColorCount
(
256
);
for
(
int
i
=
0
;
i
<
256
;
i
++
)
{
image
->
setColor
(
i
,
qRgb
(
i
,
i
,
i
));
//qDebug() << __FILE__ << __LINE__ << std::hex << i;
...
...
@@ -1277,7 +1277,7 @@ void HUD::commitRawDataToGL()
QImage
*
newImage
=
new
QImage
(
rawImage
,
receivedWidth
,
receivedHeight
,
format
);
if
(
format
==
QImage
::
Format_Indexed8
)
{
// Create matching color table
newImage
->
set
NumColors
(
256
);
newImage
->
set
ColorCount
(
256
);
for
(
int
i
=
0
;
i
<
256
;
i
++
)
{
newImage
->
setColor
(
i
,
qRgb
(
i
,
i
,
i
));
//qDebug() << __FILE__ << __LINE__ << std::hex << i;
...
...
src/ui/MainWindow.cc
View file @
d85733f9
...
...
@@ -71,6 +71,7 @@ This file is part of the QGROUNDCONTROL project
#include "SerialSettingsDialog.h"
#include "terminalconsole.h"
#include "menuactionhelper.h"
#include <QDesktopWidget>
// Add support for the MAVLink generator UI if it's been requested.
#ifdef QGC_MAVGEN_ENABLED
...
...
@@ -366,23 +367,23 @@ void MainWindow::init()
// Set OS dependent keyboard shortcuts for the main window, non OS dependent shortcuts are set in MainWindow.ui
#ifdef Q_OS_MACX
ui
.
actionFlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionMissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionHardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionSimulationView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+4"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+5"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionMavlinkView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+M"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionUnconnectedView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+U"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+Return"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionFlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
));
ui
.
actionMissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
ui
.
actionHardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
ui
.
actionSimulationView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+4"
,
0
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+5"
,
0
));
ui
.
actionMavlinkView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+M"
,
0
));
ui
.
actionUnconnectedView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+U"
,
0
));
ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+Return"
,
0
));
#else
ui
.
actionFlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+1"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionMissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+2"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionHardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+3"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionSimulationView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+4"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+5"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionMavlinkView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+M"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionUnconnectedView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+U"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+Return"
,
0
,
QApplication
::
UnicodeUTF8
));
ui
.
actionFlightView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+1"
,
0
));
ui
.
actionMissionView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+2"
,
0
));
ui
.
actionHardwareConfig
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+3"
,
0
));
ui
.
actionSimulationView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+4"
,
0
));
ui
.
actionEngineersView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+5"
,
0
));
ui
.
actionMavlinkView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+M"
,
0
));
ui
.
actionUnconnectedView
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+U"
,
0
));
ui
.
actionFullscreen
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Ctrl+Return"
,
0
));
#endif
connect
(
&
windowNameUpdateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
configureWindowName
()));
...
...
@@ -899,7 +900,7 @@ void MainWindow::addToCentralStackedWidget(QWidget* widget, VIEW_SECTIONS viewSe
void
MainWindow
::
showCentralWidget
()
{
QAction
*
act
=
qobject_cast
<
QAction
*>
(
sender
());
QWidget
*
widget
=
qVariantValue
<
QWidget
*>
(
act
->
data
()
);
QWidget
*
widget
=
act
->
data
().
value
<
QWidget
*>
(
);
centerStack
->
setCurrentWidget
(
widget
);
}
...
...
@@ -1185,7 +1186,7 @@ void MainWindow::saveScreen()
if
(
!
screenFileName
.
isEmpty
())
{
window
.
save
(
screenFileName
,
format
.
to
Ascii
());
window
.
save
(
screenFileName
,
format
.
to
Latin1
());
}
}
void
MainWindow
::
enableDockWidgetTitleBars
(
bool
enabled
)
...
...
src/ui/QGCSettingsWidget.cc
View file @
d85733f9
...
...
@@ -20,7 +20,7 @@ QGCSettingsWidget::QGCSettingsWidget(QWidget *parent, Qt::WindowFlags flags) :
// Center the window on the screen.
QRect
position
=
frameGeometry
();
position
.
moveCenter
(
Q
DesktopWidget
().
availableGeometry
().
center
());
position
.
moveCenter
(
Q
Application
::
desktop
()
->
availableGeometry
().
center
());
move
(
position
.
topLeft
());
// Add all protocols
...
...
src/ui/map3D/Q3DWidget.cc
View file @
d85733f9
...
...
@@ -254,7 +254,7 @@ Q3DWidget::handleKeyPressEvent(QKeyEvent* event)
{
mOsgGW
->
getEventQueue
()
->
keyPress
(
static_cast
<
osgGA
::
GUIEventAdapter
::
KeySymbol
>
(
*
(
event
->
text
().
to
Ascii
().
data
())));
*
(
event
->
text
().
to
Latin1
().
data
())));
}
}
...
...
@@ -274,7 +274,7 @@ Q3DWidget::handleKeyReleaseEvent(QKeyEvent* event)
{
mOsgGW
->
getEventQueue
()
->
keyRelease
(
static_cast
<
osgGA
::
GUIEventAdapter
::
KeySymbol
>
(
*
(
event
->
text
().
to
Ascii
().
data
())));
*
(
event
->
text
().
to
Latin1
().
data
())));
}
}
...
...
src/ui/mavlink/QGCMAVLinkMessageSender.cc
View file @
d85733f9
...
...
@@ -81,7 +81,7 @@ bool QGCMAVLinkMessageSender::sendMessage(unsigned int msgid)
{
// Single char
char
*
b
=
((
char
*
)(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
));
*
b
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toChar
().
to
Ascii
();
*
b
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toChar
().
to
Latin1
();
}
break
;
case
MAVLINK_TYPE_UINT8_T
:
...
...
@@ -100,7 +100,7 @@ bool QGCMAVLinkMessageSender::sendMessage(unsigned int msgid)
{
// Single value
uint8_t
*
u
=
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toChar
().
to
Ascii
();
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toChar
().
to
Latin1
();
}
break
;
case
MAVLINK_TYPE_INT8_T
:
...
...
@@ -119,7 +119,7 @@ bool QGCMAVLinkMessageSender::sendMessage(unsigned int msgid)
{
// Single value
int8_t
*
u
=
reinterpret_cast
<
int8_t
*>
(
m
+
messageInfo
[
msgid
].
fields
[
fieldid
].
wire_offset
);
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toChar
().
to
Ascii
();
*
u
=
field
->
data
(
1
,
Qt
::
DisplayRole
).
toChar
().
to
Latin1
();
}
break
;
case
MAVLINK_TYPE_INT16_T
:
...
...
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