Browse Source

QString::toAscii() doesn't exist in Qt5, using toLatin1() instead.

QGC4.4
Bryant Mairs 11 years ago
parent
commit
f96c178ca6
  1. 2
      src/GAudioOutput.cc
  2. 2
      src/comm/QGCFlightGearLink.cc
  3. 2
      src/comm/QGCJSBSimLink.cc
  4. 2
      src/comm/QGCParamID.h
  5. 4
      src/comm/QGCXPlaneLink.cc
  6. 2
      src/comm/XbeeLink.cpp
  7. 6
      src/uas/UAS.cc
  8. 2
      src/ui/MainWindow.cc
  9. 4
      src/ui/map3D/Q3DWidget.cc
  10. 6
      src/ui/mavlink/QGCMAVLinkMessageSender.cc

2
src/GAudioOutput.cc

@ -223,7 +223,7 @@ bool GAudioOutput::say(QString text, int severity) @@ -223,7 +223,7 @@ bool GAudioOutput::say(QString text, int severity)
text = "\\" + text;
QStdWString str = text.toStdWString();
unsigned char str2[1024] = {};
memcpy(str2, text.toAscii().data(), str.length());
memcpy(str2, text.toLatin1().data(), str.length());
SpeakString(str2);
res = true;
#endif // Q_OS_MAC

2
src/comm/QGCFlightGearLink.cc

@ -236,7 +236,7 @@ void QGCFlightGearLink::updateControls(quint64 time, float rollAilerons, float p @@ -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.toAscii().constData(), state.length());
writeBytes(state.toLatin1().constData(), state.length());
//qDebug() << "Updated controls" << rollAilerons << pitchElevator << yawRudder << throttle;
//qDebug() << "Updated controls" << state;
}

2
src/comm/QGCJSBSimLink.cc

@ -257,7 +257,7 @@ void QGCJSBSimLink::updateControls(quint64 time, float rollAilerons, float pitch @@ -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.toAscii().constData(), state.length());
writeBytes(state.toLatin1().constData(), state.length());
}
else
{

2
src/comm/QGCParamID.h

@ -72,7 +72,7 @@ public: @@ -72,7 +72,7 @@ public:
return static_cast<const QString>(data);
}
int8_t* toInt8_t() const {
return (int8_t*)data.toAscii().data();
return (int8_t*)data.toLatin1().data();
}
protected:

4
src/comm/QGCXPlaneLink.cc

@ -226,8 +226,8 @@ void QGCXPlaneLink::run() @@ -226,8 +226,8 @@ void QGCXPlaneLink::run()
}
ip.index = 0;
strncpy(ip.str_ipad_them, localAddrStr.toAscii(), qMin((int)sizeof(ip.str_ipad_them), 16));
strncpy(ip.str_port_them, localPortStr.toAscii(), qMin((int)sizeof(ip.str_port_them), 6));
strncpy(ip.str_ipad_them, localAddrStr.toLatin1(), qMin((int)sizeof(ip.str_ipad_them), 16));
strncpy(ip.str_port_them, localPortStr.toLatin1(), qMin((int)sizeof(ip.str_port_them), 6));
ip.use_ip = 1;
writeBytes((const char*)&ip, sizeof(ip));

2
src/comm/XbeeLink.cpp

@ -73,7 +73,7 @@ bool XbeeLink::setPortName(QString portName) @@ -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].toAscii();
this->m_portName[i]=list[0][i].toLatin1();
}
this->m_portName[list[0].size()] = '\0';
}

6
src/uas/UAS.cc

@ -2563,7 +2563,7 @@ void UAS::setParameter(const int compId, const QString& paramId, const QVariant& @@ -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().toAscii();
union_value.param_float = (unsigned char)value.toChar().toLatin1();
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& @@ -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().toAscii();
union_value.param_int8 = (unsigned char)value.toChar().toLatin1();
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& @@ -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.toAscii()[i];
p.param_id[i] = paramId.toLatin1()[i];
}
else
{

2
src/ui/MainWindow.cc

@ -1185,7 +1185,7 @@ void MainWindow::saveScreen() @@ -1185,7 +1185,7 @@ void MainWindow::saveScreen()
if (!screenFileName.isEmpty())
{
window.save(screenFileName, format.toAscii());
window.save(screenFileName, format.toLatin1());
}
}
void MainWindow::enableDockWidgetTitleBars(bool enabled)

4
src/ui/map3D/Q3DWidget.cc

@ -254,7 +254,7 @@ Q3DWidget::handleKeyPressEvent(QKeyEvent* event) @@ -254,7 +254,7 @@ Q3DWidget::handleKeyPressEvent(QKeyEvent* event)
{
mOsgGW->getEventQueue()->keyPress(
static_cast<osgGA::GUIEventAdapter::KeySymbol>(
*(event->text().toAscii().data())));
*(event->text().toLatin1().data())));
}
}
@ -274,7 +274,7 @@ Q3DWidget::handleKeyReleaseEvent(QKeyEvent* event) @@ -274,7 +274,7 @@ Q3DWidget::handleKeyReleaseEvent(QKeyEvent* event)
{
mOsgGW->getEventQueue()->keyRelease(
static_cast<osgGA::GUIEventAdapter::KeySymbol>(
*(event->text().toAscii().data())));
*(event->text().toLatin1().data())));
}
}

6
src/ui/mavlink/QGCMAVLinkMessageSender.cc

@ -81,7 +81,7 @@ bool QGCMAVLinkMessageSender::sendMessage(unsigned int msgid) @@ -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().toAscii();
*b = field->data(1, Qt::DisplayRole).toChar().toLatin1();
}
break;
case MAVLINK_TYPE_UINT8_T:
@ -100,7 +100,7 @@ bool QGCMAVLinkMessageSender::sendMessage(unsigned int msgid) @@ -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().toAscii();
*u = field->data(1, Qt::DisplayRole).toChar().toLatin1();
}
break;
case MAVLINK_TYPE_INT8_T:
@ -119,7 +119,7 @@ bool QGCMAVLinkMessageSender::sendMessage(unsigned int msgid) @@ -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().toAscii();
*u = field->data(1, Qt::DisplayRole).toChar().toLatin1();
}
break;
case MAVLINK_TYPE_INT16_T:

Loading…
Cancel
Save