From a6d0d800da4d2209b571287808004fcbaba05941 Mon Sep 17 00:00:00 2001 From: Mike Rivnak Date: Wed, 20 May 2026 17:36:39 -0400 Subject: [PATCH] Update to Qt6 --- .gitignore | 5 ++++- README.txt | 9 ++++----- SASM.pro | 4 +--- assembler.h | 2 +- codeeditor.cpp | 3 ++- debugger.cpp | 20 ++++++++++---------- debugtablewidget.h | 1 - fasm.cpp | 10 ++++------ gas.cpp | 20 ++++++++------------ main.cpp | 8 -------- mainwindow.cpp | 11 +++++------ masm.cpp | 10 +++++----- nasm.cpp | 18 ++++++++---------- ruqplaintextedit.cpp | 3 ++- singleapplication/qtlocalpeer.cpp | 3 ++- tab.cpp | 2 -- watchsettingswidget.cpp | 2 +- 17 files changed, 57 insertions(+), 74 deletions(-) diff --git a/.gitignore b/.gitignore index e9d0e7e1..f725b8a4 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,9 @@ Makefile ehthumbs.db Thumbs.db +# clangd +.cache/ + doc/* .qmake.stash sasm.app @@ -24,4 +27,4 @@ sasm.app *.o sasm ui_settings.h -moc_predefs.h \ No newline at end of file +moc_predefs.h diff --git a/README.txt b/README.txt index 37ddd2e2..26235de3 100644 --- a/README.txt +++ b/README.txt @@ -13,17 +13,16 @@ On Windows: For building: C++ compiler (e.g. gcc from MinGW) make (e.g. mingw32-make from MinGW) - Qt 5 (>= 5.11) + Qt6 For running: Everything needed is included. On Linux: For building: build-essential - qtbase5-dev - qtbase5-dev-tools - qt5-qmake - qtchooser + qt6-base-dev + qt6-base-dev-tools + qt6-5compat-dev For running: gcc-multilib (x64 OS) or gcc (x86 OS) gdb diff --git a/SASM.pro b/SASM.pro index 4c0b585a..d6619527 100644 --- a/SASM.pro +++ b/SASM.pro @@ -4,9 +4,7 @@ # #------------------------------------------------- -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +QT += core gui core5compat widgets TARGET = sasm TEMPLATE = app diff --git a/assembler.h b/assembler.h index 88389673..1c696282 100644 --- a/assembler.h +++ b/assembler.h @@ -79,7 +79,7 @@ class Assembler : public QObject quint64 numInCode; //! Address of instruction on this line in memory quint64 numInMem; - bool operator ==(const LineNum& ln) + bool operator ==(const LineNum& ln) const { return ln.numInCode == numInCode; } diff --git a/codeeditor.cpp b/codeeditor.cpp index 2b79a061..6f414864 100644 --- a/codeeditor.cpp +++ b/codeeditor.cpp @@ -38,6 +38,7 @@ ** ****************************************************************************/ +#include #include "codeeditor.h" /** @@ -455,7 +456,7 @@ bool CodeEditor::isMacroOnCurrentDebugLine() "\\bGET_STRING\\b" << "\\bCMAIN\\b" << "\\bCEXTERN\\b"; foreach (const QString &pattern, macrosPatterns) { QRegExp regExp(pattern, Qt::CaseSensitive); - if (text.indexOf(regExp) != -1) + if (regExp.indexIn(text) != -1) return true; } } diff --git a/debugger.cpp b/debugger.cpp index f1a15651..a8c10442 100644 --- a/debugger.cpp +++ b/debugger.cpp @@ -294,11 +294,11 @@ void Debugger::processMessage(QString output, QString error) if (!pid) { QRegExp r("Num +Description +(Connection +)?Executable"); - int index = output.indexOf(r); + int index = r.indexIn(output); if (index != -1) { QString processString("process "); r = QRegExp(processString + "[0-9]+"); - index = output.indexOf(r); + index = r.indexIn(output); output = output.mid(index + processString.length()); output = output.split(QChar(' ')).at(0); pid = output.toULongLong(0, 10); @@ -314,12 +314,12 @@ void Debugger::processMessage(QString output, QString error) void Debugger::processAction(QString output, QString error) { - bool backtrace = (output.indexOf(QRegExp("#\\d+ 0x[0-9a-fA-F]{8,16} in .* ()")) != -1); + bool backtrace = (QRegExp("#\\d+ 0x[0-9a-fA-F]{8,16} in .* ()").indexIn(output) != -1); if (output.indexOf(exitMessage) != -1 && !backtrace) { doInput("c\n", none); return; } - if (output.indexOf(QRegExp(cExitMessage)) != -1) { //if debug finished + if (QRegExp(cExitMessage).indexIn(output) != -1) { //if debug finished //print output - message like bottom /*Breakpoint 1, 0x08048510 in sasmStartL () " @@ -385,15 +385,15 @@ void Debugger::processAction(QString output, QString error) QRegExp breakpointMsg("\r?\nBreakpoint \\d+, "); QRegExp threadMsg("\\[Switching to Thread [^\\]]*\\]\r?\n"); QRegExp signalMsg("\r?\n(Program received signal.*)"); - msg.remove(continuingMsg); - msg.remove(breakpointMsg); - msg.remove(threadMsg); + msg = continuingMsg.removeIn(msg); + msg = breakpointMsg.removeIn(msg); + msg = threadMsg.removeIn(msg); if (signalMsg.indexIn(msg) != -1) { QString recievedSignal = signalMsg.cap(1); if (QRegExp("SIG(TRAP|INT)").indexIn(recievedSignal) == -1) { emit printLog(recievedSignal, Qt::red); } - msg.remove(signalMsg); + msg = signalMsg.removeIn(msg); } emit printOutput(msg); } @@ -436,7 +436,7 @@ void Debugger::processAction(QString output, QString error) if (output[output.length() - 1] != '\n') output += QChar('\n'); //process as ni or si - if (output.indexOf(QRegExp("0x[0-9a-fA-F]{8,16} in ")) != -1 + if (QRegExp("0x[0-9a-fA-F]{8,16} in ").indexIn(output) != -1 && !backtrace) { actionTypeQueue.enqueue(showLine); processAction(output); @@ -455,7 +455,7 @@ void Debugger::processAction(QString output, QString error) output.indexOf(QString("no debug info")) == -1 && output != QString(" ")) { //if variable exists (isValid = true) isValid = true; - int index = output.indexOf(QRegExp("\\$\\d+ = .*")); + int index = QRegExp("\\$\\d+ = .*").indexIn(output); if (index == -1) isValid = false; else { diff --git a/debugtablewidget.h b/debugtablewidget.h index 0a042def..3127b49e 100644 --- a/debugtablewidget.h +++ b/debugtablewidget.h @@ -2,7 +2,6 @@ #define DEBUGTABLEWIDGET_H #include -#include #include #include #include diff --git a/fasm.cpp b/fasm.cpp index 67a2cb24..dd79626d 100644 --- a/fasm.cpp +++ b/fasm.cpp @@ -92,7 +92,7 @@ quint64 FASM::getMainOffset(QFile &lstOut, QString entryLabel) lst.close(); return line.toULongLong(0, 16); } else { - if (line.indexOf(mainLabel) != -1) + if (mainLabel.indexIn(line) != -1) flag = true; } } @@ -171,20 +171,18 @@ QString FASM::getStartText() void FASM::putDebugString(CodeEditor *code) { //add : mov ebp, esp for making frame for correct debugging if this code has not been added yet - int index = code->toPlainText().indexOf(QRegExp("main:")); + int index = QRegExp("main:").indexIn(code->toPlainText()); if (index != -1) { index = code->toPlainText().indexOf(QChar(':'), index); if (isx86()) { - if (code->toPlainText().indexOf( - QRegExp("\\s+([Pp][Uu][Ss][Hh] +[Ee][Bb][Pp]\\s+)?[Mm][Oo][Vv] +[Ee][Bb][Pp] *, *[Ee][Ss][Pp]"), index + 1) != index + 1) { + if (QRegExp("\\s+([Pp][Uu][Ss][Hh] +[Ee][Bb][Pp]\\s+)?[Mm][Oo][Vv] +[Ee][Bb][Pp] *, *[Ee][Ss][Pp]").indexIn(code->toPlainText(), index + 1) != index + 1) { QTextCursor cursor = code->textCursor(); cursor.movePosition(QTextCursor::Start); cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, index + 1); cursor.insertText(QString("\n mov ebp, esp; for correct debugging")); } } else { - if (code->toPlainText().indexOf( - QRegExp("\\s+([Pp][Uu][Ss][Hh] +[Rr][Bb][Pp]\\s+)?[Mm][Oo][Vv] +[Rr][Bb][Pp] *, *[Rr][Ss][Pp]"), index + 1) != index + 1) { + if (QRegExp("\\s+([Pp][Uu][Ss][Hh] +[Rr][Bb][Pp]\\s+)?[Mm][Oo][Vv] +[Rr][Bb][Pp] *, *[Rr][Ss][Pp]").indexIn(code->toPlainText(), index + 1) != index + 1) { QTextCursor cursor = code->textCursor(); cursor.movePosition(QTextCursor::Start); cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, index + 1); diff --git a/gas.cpp b/gas.cpp index a73dfdcf..8aa27e68 100644 --- a/gas.cpp +++ b/gas.cpp @@ -86,7 +86,7 @@ quint64 GAS::getMainOffset(QFile &lst, QString entryLabel) } } } else { - if (line.indexOf(mainLabel) != -1) + if (mainLabel.indexIn(line) != -1) flag = true; } } @@ -103,9 +103,9 @@ void GAS::parseLstFile(QFile &lst, QVector &lines, quint64 o QTextStream lstStream(&lst); while (!lstStream.atEnd()) { QString line = lstStream.readLine(); - if (line.indexOf(sectionTextRegExp) != -1) { + if (sectionTextRegExp.indexIn(line) != -1) { inTextSection = true; - } else if (line.indexOf(sectionDataRegExp) != -1 || line.indexOf(sectionBssRegExp) != -1) { + } else if (sectionDataRegExp.indexIn(line) != -1 || sectionBssRegExp.indexIn(line) != -1) { inTextSection = false; } if (line.length() <= 19) { //omit strings with data only @@ -145,23 +145,21 @@ QString GAS::getStartText() void GAS::putDebugString(CodeEditor *code) { //add : mov ebp, esp for making frame for correct debugging if this code has not been added yet - int index = code->toPlainText().indexOf(QRegExp("CMAIN:|main:")); + int index = QRegExp("CMAIN:|main:").indexIn(code->toPlainText()); if (index != -1) { index = code->toPlainText().indexOf(QChar(':'), index); int intelIndex = code->toPlainText().lastIndexOf("intel_syntax", index + 1); int attIndex = code->toPlainText().lastIndexOf("att_syntax", index + 1); if (intelIndex == -1 || attIndex > intelIndex) { //AT&T syntax if (isx86()) { - if (code->toPlainText().indexOf( - QRegExp("\\s+([Pp][Uu][Ss][Hh][Ll]? +%?[Ee][Bb][Pp]\\s+)?[Mm][Oo][Vv][Ll] +%?[Ee][Ss][Pp] *, *%?[Ee][Bb][Pp]"), index + 1) != index + 1) { + if (QRegExp("\\s+([Pp][Uu][Ss][Hh][Ll]? +%?[Ee][Bb][Pp]\\s+)?[Mm][Oo][Vv][Ll] +%?[Ee][Ss][Pp] *, *%?[Ee][Bb][Pp]").indexIn(code->toPlainText() , index + 1) != index + 1) { QTextCursor cursor = code->textCursor(); cursor.movePosition(QTextCursor::Start); cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, index + 1); cursor.insertText(QString("\n movl %esp, %ebp #for correct debugging")); } } else { - if (code->toPlainText().indexOf( - QRegExp("\\s+([Pp][Uu][Ss][Hh][Qq]? +%?[Rr][Bb][Pp]\\s+)?[Mm][Oo][Vv][Qq] +%?[Rr][Ss][Pp] *, *%?[Rr][Bb][Pp]"), index + 1) != index + 1) { + if (QRegExp("\\s+([Pp][Uu][Ss][Hh][Qq]? +%?[Rr][Bb][Pp]\\s+)?[Mm][Oo][Vv][Qq] +%?[Rr][Ss][Pp] *, *%?[Rr][Bb][Pp]").indexIn(code->toPlainText(), index + 1) != index + 1) { QTextCursor cursor = code->textCursor(); cursor.movePosition(QTextCursor::Start); cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, index + 1); @@ -170,16 +168,14 @@ void GAS::putDebugString(CodeEditor *code) } } else { //Intel syntax if (isx86()) { - if (code->toPlainText().indexOf( - QRegExp("\\s+([Pp][Uu][Ss][Hh][Ll]? +%?[Ee][Bb][Pp]\\s+)?[Mm][Oo][Vv] +%?[Ee][Bb][Pp] *, *%?[Ee][Ss][Pp]"), index + 1) != index + 1) { + if (QRegExp("\\s+([Pp][Uu][Ss][Hh][Ll]? +%?[Ee][Bb][Pp]\\s+)?[Mm][Oo][Vv] +%?[Ee][Bb][Pp] *, *%?[Ee][Ss][Pp]").indexIn(code->toPlainText(), index + 1) != index + 1) { QTextCursor cursor = code->textCursor(); cursor.movePosition(QTextCursor::Start); cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, index + 1); cursor.insertText(QString("\n mov %ebp, %esp #for correct debugging")); } } else { - if (code->toPlainText().indexOf( - QRegExp("\\s+([Pp][Uu][Ss][Hh][Qq]? +%?[Rr][Bb][Pp]\\s+)?[Mm][Oo][Vv] +%?[Rr][Bb][Pp] *, *%?[Rr][Ss][Pp]"), index + 1) != index + 1) { + if (QRegExp("\\s+([Pp][Uu][Ss][Hh][Qq]? +%?[Rr][Bb][Pp]\\s+)?[Mm][Oo][Vv] +%?[Rr][Bb][Pp] *, *%?[Rr][Ss][Pp]").indexIn(code->toPlainText(), index + 1) != index + 1) { QTextCursor cursor = code->textCursor(); cursor.movePosition(QTextCursor::Start); cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, index + 1); diff --git a/main.cpp b/main.cpp index b3367ac0..62a27996 100644 --- a/main.cpp +++ b/main.cpp @@ -55,10 +55,6 @@ int main(int argc, char *argv[]) { - QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) - QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); - #endif QtSingleApplication a(argc, argv); QSettings settings("SASM Project", "SASM"); QPalette palette; @@ -89,10 +85,6 @@ int main(int argc, char *argv[]) return 0; } QTranslator translator, qtTranslator, addTranslator; - #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) - QTextCodec *codec = QTextCodec::codecForName("UTF-8"); - QTextCodec::setCodecForCStrings(codec); - #endif if (!settings.contains("language")) { //language choosing QStringList items; items << QString("Русский") << QString("English") << QString("Türk") << diff --git a/mainwindow.cpp b/mainwindow.cpp index 27b6de5d..7613a69b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -131,7 +131,7 @@ void MainWindow::initUi() splitter->setOrientation(Qt::Vertical); workLayout = new QVBoxLayout; workLayout->addWidget(splitter); - workLayout->setMargin(0); + workLayout->setContentsMargins(QMargins()); workLayout->setSpacing(0); workWidget = new QWidget; workWidget->setLayout(workLayout); @@ -947,7 +947,7 @@ void MainWindow::buildProgram(bool debugMode) QTextStream log(&logFile); QString logText = log.readAll(); if (settings.value("assembler", QString("NASM")).toString() == "FASM" && logText.count(QChar('\n')) == 2 - && logText.contains(QRegExp(" bytes\\."))) + && QRegExp(" bytes\\.").indexIn(logText) != -1) logText.clear(); if (settings.value("assembler", QString("NASM")).toString() == "MASM") { if (logText.count(QChar('\n')) == 1 && logText.startsWith(" Assembling:")) @@ -1577,7 +1577,7 @@ void MainWindow::findNext(const QString &pattern, Qt::CaseSensitivity cs, bool a if (cs == Qt::CaseSensitive) newCursor = document->find(pattern, newCursor, QTextDocument::FindCaseSensitively); else - newCursor = document->find(pattern, newCursor, 0); + newCursor = document->find(pattern, newCursor); //! Replace mode if (replace && i == tabs->currentIndex()) { newCursor.removeSelectedText(); @@ -1609,13 +1609,13 @@ void MainWindow::findNext(const QString &pattern, Qt::CaseSensitivity cs, bool a if (cs == Qt::CaseSensitive) newCursor = document->find(pattern, newCursor, QTextDocument::FindCaseSensitively); else - newCursor = document->find(pattern, newCursor, 0); + newCursor = document->find(pattern, newCursor); //! Continue from start if (newCursor.isNull()) { if (cs == Qt::CaseSensitive) newCursor = document->find(pattern, newCursor, QTextDocument::FindCaseSensitively); else - newCursor = document->find(pattern, newCursor, 0); + newCursor = document->find(pattern, newCursor); } if (!newCursor.isNull()) { selection.cursor = newCursor; @@ -2291,7 +2291,6 @@ void MainWindow::openHelp() helpFile.open(QFile::ReadOnly); QTextStream helpText(&helpFile); - helpText.setCodec("utf-8"); help->setHtml(helpText.readAll()); helpFile.close(); help->setWindowState(Qt::WindowMaximized); diff --git a/masm.cpp b/masm.cpp index f7d34e32..f54a995e 100644 --- a/masm.cpp +++ b/masm.cpp @@ -118,9 +118,9 @@ void MASM::parseLstFile(QFile &lst, QVector &lines, quint64 continue; if (empty2.exactMatch(line)) continue; - if (line.indexOf(sectionTextRegExp) != -1) { + if (sectionTextRegExp.indexIn(line)!= -1) { inTextSection = true; - } else if (line.indexOf(sectionDataRegExp) != -1) { + } else if (sectionDataRegExp.indexIn(line) != -1) { inTextSection = false; } if (inTextSection) { @@ -139,7 +139,7 @@ void MASM::parseLstFile(QFile &lst, QVector &lines, quint64 macroInstruction.remove(0, k); if (macroInstruction[0] == '=') continue; - macroInstruction.remove(QRegExp("^[0-9a-fA-F]{8,16}[ \t]+")); //if label + macroInstruction = QRegExp("^[0-9a-fA-F]{8,16}[ \t]+").removeIn(macroInstruction); //if label while (!stringWithAddress.exactMatch(line) && !lstStream.atEnd()) line = lstStream.readLine(); lineArr = line.toLocal8Bit(); @@ -160,7 +160,7 @@ void MASM::parseLstFile(QFile &lst, QVector &lines, quint64 while (k < macroInstruction.length() && macroInstruction[k].isSpace()) k++; macroInstruction.remove(0, k); - macroInstruction.remove(QRegExp("^[0-9a-fA-F]{8,16}[ \t]+")); //if label + macroInstruction = QRegExp("^[0-9a-fA-F]{8,16}[ \t]+").removeIn(macroInstruction); //if label while (!stringWithAddress.exactMatch(line) && !lstStream.atEnd()) line = lstStream.readLine(); lineArr = line.toLocal8Bit(); @@ -200,7 +200,7 @@ void MASM::parseLstFile(QFile &lst, QVector &lines, quint64 //! Check if instruction if (!stringWithCode.exactMatch(line) || macro.exactMatch(line) || sscanf(s, "%llx", &a) != 1) continue; - int index = line.indexOf(QRegExp("[RE\t]\t")); + int index = QRegExp("[RE\t]\t").indexIn(line); if (index == -1) continue; line = line.mid(index + 2); diff --git a/nasm.cpp b/nasm.cpp index 7779cdff..edb6eb2f 100644 --- a/nasm.cpp +++ b/nasm.cpp @@ -87,7 +87,7 @@ quint64 NASM::getMainOffset(QFile &lst, QString entryLabel) } } } else { - if (line.indexOf(mainLabel) != -1) + if (mainLabel.indexIn(line) != -1) flag = true; } } @@ -109,18 +109,18 @@ void NASM::parseLstFile(QFile &lst, QVector &lines, quint64 lstStream.seek(0); while (!lstStream.atEnd()) { QString line = lstStream.readLine(); - if (line.indexOf(QRegExp("^ +[0-9]+ +<[0-9]+>")) != -1) { //macro + if (QRegExp("^ +[0-9]+ +<[0-9]+>").indexIn(line) != -1) { //macro continue; } - if (line.indexOf(sectionTextRegExp) != -1) { + if (sectionTextRegExp.indexIn(line) != -1) { inTextSection = true; - } else if (line.indexOf(sectionRegExp) != -1) { + } else if (sectionRegExp.indexIn(line) != -1) { inTextSection = false; } //! omit strings with data only //! if in list : line number, address, data and it is all (without instruction) - //! omit this string and subtract 1 from offset - if (line.indexOf(QRegExp("^(\\s+[^\\s]+){4}")) == -1) { + if (QRegExp("^(\\s+[^\\s]+){4}").indexIn(line) == -1) { continue; } if (inTextSection) { @@ -172,20 +172,18 @@ QString NASM::getStartText() void NASM::putDebugString(CodeEditor *code) { //! add : mov ebp, esp for making frame for correct debugging if this code has not been added yet - int index = code->toPlainText().indexOf(QRegExp("CMAIN:|main:")); + int index = QRegExp("CMAIN:|main:").indexIn(code->toPlainText()); if (index != -1) { index = code->toPlainText().indexOf(QChar(':'), index); if (isx86()) { - if (code->toPlainText().indexOf( - QRegExp("\\s+([Pp][Uu][Ss][Hh] +[Ee][Bb][Pp]\\s+)?[Mm][Oo][Vv] +[Ee][Bb][Pp] *, *[Ee][Ss][Pp]"), index + 1) != index + 1) { + if (QRegExp("\\s+([Pp][Uu][Ss][Hh] +[Ee][Bb][Pp]\\s+)?[Mm][Oo][Vv] +[Ee][Bb][Pp] *, *[Ee][Ss][Pp]").indexIn(code->toPlainText(), index + 1) != index + 1) { QTextCursor cursor = code->textCursor(); cursor.movePosition(QTextCursor::Start); cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, index + 1); cursor.insertText(QString("\n mov ebp, esp; for correct debugging")); } } else { - if (code->toPlainText().indexOf( - QRegExp("\\s+([Pp][Uu][Ss][Hh] +[Rr][Bb][Pp]\\s+)?[Mm][Oo][Vv] +[Rr][Bb][Pp] *, *[Rr][Ss][Pp]"), index + 1) != index + 1) { + if (QRegExp("\\s+([Pp][Uu][Ss][Hh] +[Rr][Bb][Pp]\\s+)?[Mm][Oo][Vv] +[Rr][Bb][Pp] *, *[Rr][Ss][Pp]").indexIn(code->toPlainText(), index + 1) != index + 1) { QTextCursor cursor = code->textCursor(); cursor.movePosition(QTextCursor::Start); cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, index + 1); diff --git a/ruqplaintextedit.cpp b/ruqplaintextedit.cpp index 2bcd9253..8ee0cf72 100644 --- a/ruqplaintextedit.cpp +++ b/ruqplaintextedit.cpp @@ -38,6 +38,7 @@ ** ****************************************************************************/ +#include #include "ruqplaintextedit.h" /** @@ -222,7 +223,7 @@ RuQPlainTextEdit::Watch RuQPlainTextEdit::variableOnCurrentLine() "\\bdy\\b" << "\\bequ\\b"; bool isVariableLine = false; foreach (const QString &pattern, memoryPatterns) - if (text.indexOf(QRegExp(pattern)) != -1) { + if (QRegExp(pattern).indexIn(text) != -1) { isVariableLine = true; break; } diff --git a/singleapplication/qtlocalpeer.cpp b/singleapplication/qtlocalpeer.cpp index c7ce5276..8e8ea58f 100644 --- a/singleapplication/qtlocalpeer.cpp +++ b/singleapplication/qtlocalpeer.cpp @@ -42,6 +42,7 @@ #include "qtlocalpeer.h" #include #include +#include #include #if defined(Q_OS_WIN) @@ -78,7 +79,7 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId) #endif prefix = id.section(QLatin1Char('/'), -1); } - prefix.remove(QRegExp("[^a-zA-Z]")); + prefix.remove(QRegularExpression("[^a-zA-Z]")); prefix.truncate(6); QByteArray idc = id.toUtf8(); diff --git a/tab.cpp b/tab.cpp index 47ae700a..2f1f544a 100644 --- a/tab.cpp +++ b/tab.cpp @@ -143,7 +143,6 @@ void Tab::saveCodeToFile(const QString &filePath, Assembler *assembler, bool cha outfile.setFileName(filePath); outfile.open(QIODevice::WriteOnly | QIODevice::Text); QTextStream out(&outfile); - out.setCodec("UTF-8"); if (debugMode) { assembler->putDebugString(code); } @@ -165,7 +164,6 @@ void Tab::loadCodeFromFile(const QString &filePath) file.setFileName(filePath); file.open(QIODevice::ReadOnly); QTextStream text(&file); - text.setCodec("UTF-8"); QString source = text.readAll(); code->setPlainText(source); currentFilePath = filePath; diff --git a/watchsettingswidget.cpp b/watchsettingswidget.cpp index 8556a941..d855b27c 100644 --- a/watchsettingswidget.cpp +++ b/watchsettingswidget.cpp @@ -80,7 +80,7 @@ WatchSettingsWidget::WatchSettingsWidget(QWidget *parent) : addressCheckbox->setChecked(false); layout->setSpacing(0); - layout->setMargin(0); + layout->setContentsMargins(QMargins()); connect(typeComboBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(settingsChanged())); connect(sizeComboBox, SIGNAL(currentIndexChanged(int)), this, SIGNAL(settingsChanged()));