Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions QCodeEditor/src/internal/QCodeEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ void QCodeEditor::proceedCompleterEnd(QKeyEvent *e)
}

auto isShortcut = ((e->modifiers() & Qt::ControlModifier) && e->key() == Qt::Key_Space);
auto isDot = charUnderCursor(-1) == ".";
auto isMinus = charUnderCursor(-1) == "-";
auto isSpace = charUnderCursor(-1) == " " || charUnderCursor(-1) == "\t";
auto isDot = charUnderCursor(-1) == '.';
auto isMinus = charUnderCursor(-1) == '-';
auto isSpace = charUnderCursor(-1) == ' ' || charUnderCursor(-1) == '\t';

if (isSpace || (word.isEmpty() && !isDot && !(!m_separateMinus && isMinus))) {
m_completer->popup()->hide();
Expand Down Expand Up @@ -584,7 +584,7 @@ void QCodeEditor::keyPressEvent(QKeyEvent* e) {
int charPos = -1;

for (int i = 0;i < line.length();i++) {
if (line.at(i) != " " && line.at(i) != "\t") {
if (line.at(i) != ' ' && line.at(i) != '\t') {
charPos = i;
break;
}
Expand All @@ -597,8 +597,8 @@ void QCodeEditor::keyPressEvent(QKeyEvent* e) {

if (commentPos >= 0) {
if (line.length() <= (commentPos + m_commentStr.length()) ||
line.at(commentPos + m_commentStr.length()) == " " ||
line.at(commentPos + m_commentStr.length()) == "\t") {
line.at(commentPos + m_commentStr.length()) == ' ' ||
line.at(commentPos + m_commentStr.length()) == '\t') {
commentPos = -1;
charPos = -1;
}
Expand Down Expand Up @@ -829,7 +829,7 @@ void QCodeEditor::keyPressEvent(QKeyEvent* e) {

// Shortcut for moving line to left
if (m_replaceTab && e->key() == Qt::Key_Backtab) {
indentationLevel = std::min(indentationLevel, m_tabReplace.size());
indentationLevel = std::min((qsizetype)indentationLevel, m_tabReplace.size());

auto cursor = textCursor();

Expand Down
4 changes: 2 additions & 2 deletions QCodeEditor/src/internal/QLanguage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bool QLanguage::load(QIODevice* device)

if (type == QXmlStreamReader::TokenType::StartElement)
{
if (reader.name() == "section")
if (reader.name() == QString("section"))
{
if (!list.empty())
{
Expand All @@ -42,7 +42,7 @@ bool QLanguage::load(QIODevice* device)

name = reader.attributes().value("name").toString();
}
else if (reader.name() == "name")
else if (reader.name() == QString("name"))
{
readText = true;
}
Expand Down
22 changes: 11 additions & 11 deletions QCodeEditor/src/internal/QSyntaxStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ bool QSyntaxStyle::load(QString fl)

if(token == QXmlStreamReader::StartElement)
{
if (reader.name() == "style-scheme")
if (reader.name() == QString("style-scheme"))
{
if (reader.attributes().hasAttribute("name"))
{
m_name = reader.attributes().value("name").toString();
}
}
else if (reader.name() == "style")
else if (reader.name() == QString("style"))
{
auto attributes = reader.attributes();

Expand All @@ -51,13 +51,13 @@ bool QSyntaxStyle::load(QString fl)
}

if (attributes.hasAttribute("bold") &&
attributes.value("bold") == "true")
attributes.value("bold") == QString("true"))
{
format.setFontWeight(QFont::Weight::Bold);
}

if (attributes.hasAttribute("italic") &&
attributes.value("italic") == "true")
attributes.value("italic") == QString("true"))
{
format.setFontItalic(true);
}
Expand All @@ -68,31 +68,31 @@ bool QSyntaxStyle::load(QString fl)

auto s = QTextCharFormat::UnderlineStyle::NoUnderline;

if (underline == "SingleUnderline")
if (underline == QString("SingleUnderline"))
{
s = QTextCharFormat::UnderlineStyle::SingleUnderline;
}
else if (underline == "DashUnderline")
else if (underline == QString("DashUnderline"))
{
s = QTextCharFormat::UnderlineStyle::DashUnderline;
}
else if (underline == "DotLine")
else if (underline == QString("DotLine"))
{
s = QTextCharFormat::UnderlineStyle::DotLine;
}
else if (underline == "DashDotLine")
else if (underline == QString("DashDotLine"))
{
s = QTextCharFormat::DashDotLine;
}
else if (underline == "DashDotDotLine")
else if (underline == QString("DashDotDotLine"))
{
s = QTextCharFormat::DashDotDotLine;
}
else if (underline == "WaveUnderline")
else if (underline == QString("WaveUnderline"))
{
s = QTextCharFormat::WaveUnderline;
}
else if (underline == "SpellCheckUnderline")
else if (underline == QString("SpellCheckUnderline"))
{
s = QTextCharFormat::SpellCheckUnderline;
}
Expand Down
14 changes: 10 additions & 4 deletions bleuart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,20 @@ void BleUart::startConnect(QString addr)
mUartServiceFound = false;
mConnectDone = false;

#if defined(Q_OS_MACOS) || defined(Q_OS_IOS)

//#if defined(Q_OS_MACOS) || defined(Q_OS_IOS)
#if 0
// Create BT Controller from unique device UUID stored as addr. Creating
// a controller using a devices address is not supported on macOS or iOS.
QBluetoothDeviceInfo deviceInfo = QBluetoothDeviceInfo();
deviceInfo.setDeviceUuid(QBluetoothUuid(addr));
mControl = new QLowEnergyController(deviceInfo);
mControl = QLowEnergyController::createPeripheral(&deviceInfo);

//mControl = new QLowEnergyController(const_cast<QBluetoothDeviceInfo*>(&deviceInfo));

#else
mControl = new QLowEnergyController(QBluetoothAddress(addr));
//mControl = new QLowEnergyController(QBluetoothAddress(addr));
mControl = QLowEnergyController::createPeripheral(QBluetoothAddress(addr));

#endif

Expand Down Expand Up @@ -305,7 +310,8 @@ void BleUart::serviceStateChanged(QLowEnergyService::ServiceState s)
// Bluetooth LE spec Where a characteristic can be notified, a Client Characteristic Configuration descriptor
// shall be included in that characteristic as required by the Bluetooth Core Specification
// Tx notify is enabled
mNotificationDescTx = txChar.descriptor(QBluetoothUuid::ClientCharacteristicConfiguration);
mNotificationDescTx = txChar.descriptor(QBluetoothUuid::DescriptorType::ClientCharacteristicConfiguration);
//mNotificationDescTx = txChar.descriptor(QBluetoothUuid::ClientCharacteristicConfiguration);

if (mNotificationDescTx.isValid()) {
// enable notification
Expand Down
9 changes: 5 additions & 4 deletions configparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,8 @@ bool ConfigParams::saveXml(QString fileName, QString configName)
emit savingXml();

QXmlStreamWriter stream(&file);
stream.setCodec("UTF-8");
//QT 6 always uses UTF-8 and this call is deprecated
//stream.setCodec("UTF-8");
stream.setAutoFormatting(true);
getXML(stream, configName);

Expand Down Expand Up @@ -1174,7 +1175,7 @@ QString ConfigParams::saveCompressed(QString configName)

QByteArray data;
QXmlStreamWriter stream(&data);
stream.setCodec("UTF-8");
//stream.setCodec("UTF-8");
stream.setAutoFormatting(true);
getXML(stream, configName);

Expand Down Expand Up @@ -1480,7 +1481,7 @@ bool ConfigParams::saveParamsXml(QString fileName)
}

QXmlStreamWriter stream(&file);
stream.setCodec("UTF-8");
//stream.setCodec("UTF-8");
stream.setAutoFormatting(true);

getParamsXML(stream);
Expand Down Expand Up @@ -1512,7 +1513,7 @@ QByteArray ConfigParams::getCompressedParamsXml()
{
QByteArray res;
QXmlStreamWriter stream(&res);
stream.setCodec("UTF-8");
//stream.setCodec("UTF-8");
stream.setAutoFormatting(true);
getParamsXML(stream);
return qCompress(res, 9);
Expand Down
2 changes: 1 addition & 1 deletion display_tool/dispeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ void DispEditor::updatePalette()
QGridLayout *l = new QGridLayout;
l->setVerticalSpacing(1);
l->setHorizontalSpacing(1);
l->setMargin(1);
//l->setMargin(1);

int colors = 0;
if (ui->formatBox->currentIndex() == 0) {
Expand Down
1 change: 0 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <QApplication>
#include <QStyleFactory>
#include <QSettings>
#include <QDesktopWidget>
#include <QFontDatabase>
#include <QPixmapCache>

Expand Down
3 changes: 2 additions & 1 deletion map/mapwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,8 @@ void MapWidget::paint(QPainter &painter, int width, int height, bool highQuality
const QColor zeroAxisColor = QColor(200,52,52);
const QColor firstAxisColor = Qt::gray;
const QColor secondAxisColor = Qt::blue;
const QColor textColor = QPalette::Foreground;
//const QColor textColor = QPalette::Foreground;
const QColor textColor = QPalette::Window;

// Grid boundries in mm
const double xStart = -ceil(width / stepGrid / mScaleFactor) * stepGrid - ceil(mXOffset / stepGrid / mScaleFactor) * stepGrid;
Expand Down
2 changes: 1 addition & 1 deletion pages/pageappsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void PageAppSettings::reloadParams()
ConfigParam *p = mVesc->infoConfig()->getParam("app_setting_description");
if (p != nullptr) {
QRegExp rx("(<img src=)|( width=)");
QStringList htmls = p->description.split(rx);
QStringList htmls = p->description.split(rx.cap());
QStringList imgs = {"app_up", "app_default" , "app_down","Upload-96","Data Backup-96","Help-96"};
QString theme = "<img src=\"" + Utility::getThemePath() + "icons/";
QString out;
Expand Down
1 change: 1 addition & 0 deletions pages/pageappsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define PAGEAPPSETTINGS_H

#include <QWidget>
#include <QRegExp>
#include "vescinterface.h"

namespace Ui {
Expand Down
2 changes: 1 addition & 1 deletion pages/pagedataanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void PageDataAnalysis::setVesc(VescInterface *vesc)
ConfigParam *p = mVesc->infoConfig()->getParam("data_analysis_description");
if (p != nullptr) {
QRegExp rx("(<img src=)|( width=)");
QStringList htmls = p->description.split(rx);
QStringList htmls = p->description.split(rx.cap());
QStringList imgs = {"expand_off","expand_on","expand_v_off","expand_v_on","size_off", "size_on","size_off","rt_on","Upload-96","motor"};
QString theme = "<img src=\"" + Utility::getThemePath() + "icons/";
QString out;
Expand Down
1 change: 1 addition & 0 deletions pages/pagedataanalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define PAGEDATAANALYSIS_H

#include <QWidget>
#include <QRegExp>
#include "vescinterface.h"

namespace Ui {
Expand Down
2 changes: 1 addition & 1 deletion pages/pageexperiments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ void PageExperiments::on_saveCsvButton_clicked()
}

QTextStream stream(&file);
stream.setCodec("UTF-8");
//stream.setCodec("UTF-8");

for (int i = 0;i < mTimeVec.size();i++) {
stream << mTimeVec.at(i) << ";";
Expand Down
2 changes: 1 addition & 1 deletion pages/pagelisp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ void PageLisp::setEditorClean(ScriptEditor *editor)
QString tabText = ui->fileTabs->tabText(tabIdx);

// Check if the final character is a `*`, which indicated it was a dirty file
if (tabText.back() == "*") {
if (tabText.back() == '*') {
// Remove the terminal `*`
tabText.chop(1);
ui->fileTabs->setTabText(tabIdx, tabText);
Expand Down
3 changes: 2 additions & 1 deletion pages/pagemotorsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ void PageMotorSettings::reloadParams()
ConfigParam *p = mVesc->infoConfig()->getParam("motor_setting_description");
if (p != nullptr) {
QRegExp rx("(<img src=)|( width=)");
QStringList htmls = p->description.split(rx);
QStringList htmls = p->description.split(rx.cap()); // grab the zeroth one?
// TODO check this out
QStringList imgs = {"motor_up", "motor_default" , "motor_down","Upload-96","Data Backup-96","Help-96"};
QString theme = "<img src=\"" + Utility::getThemePath() + "icons/";
QString out;
Expand Down
1 change: 1 addition & 0 deletions pages/pagemotorsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define PAGEMOTORSETTINGS_H

#include <QWidget>
#include <QRegExp>
#include "vescinterface.h"

namespace Ui {
Expand Down
2 changes: 1 addition & 1 deletion pages/pagesampleddata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ void PageSampledData::on_saveDataButton_clicked()
QFileInfo(fileName).absolutePath());

QTextStream stream(&file);
stream.setCodec("UTF-8");
//stream.setCodec("UTF-8");

// Generate Time axis
QVector<double> timeVec;
Expand Down
2 changes: 1 addition & 1 deletion pages/pagescripting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ void PageScripting::setEditorClean(ScriptEditor *editor)
QString tabText = ui->fileTabs->tabText(tabIdx);

// Check if the final character is a `*`, which indicated it was a dirty file
if (tabText.back() == "*") {
if (tabText.back() == '*') {
// Remove the terminal `*`
tabText.chop(1);
ui->fileTabs->setTabText(tabIdx, tabText);
Expand Down
10 changes: 7 additions & 3 deletions vesc_tool.pro
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ios: {
#CONFIG += build_mobile

# Exclude built-in firmwares
#CONFIG += exclude_fw
CONFIG += exclude_fw

ios: {
CONFIG += build_mobile
Expand Down Expand Up @@ -78,8 +78,10 @@ DEFINES += HAS_POS
!android: {
# Serial port available
DEFINES += HAS_SERIALPORT
DEFINES += HAS_GAMEPAD
}
!macos: {
DEFINES += HAS_GAMEPAD
}
}
}

win32: {
Expand Down Expand Up @@ -109,6 +111,8 @@ QT += quickcontrols2
QT += quickwidgets
QT += svg
QT += gui-private
QT += openglwidgets
QT += core5compat

contains(DEFINES, HAS_SERIALPORT) {
QT += serialport
Expand Down
Loading
Loading