diff --git a/.github/workflows/linux-release.yml b/.github/workflows/linux-release.yml index 790bb8738..9dc902e5c 100644 --- a/.github/workflows/linux-release.yml +++ b/.github/workflows/linux-release.yml @@ -1,4 +1,4 @@ -name: Ubuntu 18.04 / Qt 5.15 +name: Ubuntu 20.04 / Qt 6.5.0 on: workflow_run: workflows: ["Release setup"] @@ -6,12 +6,12 @@ on: jobs: buildUbuntuXenial: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 env: CC: gcc-9 CXX: g++-9 - strategy: + strateg matrix: build-type: [Release, Debug] @@ -33,22 +33,18 @@ jobs: libxcb-xinerama0 libxcb-composite0 libxcb-cursor0 libxcb-damage0 \ libxcb-dpms0 libxcb-dri2-0 libxcb-dri3-0 libxcb-ewmh2 libxcb-glx0 \ libxcb-present0 libxcb-randr0 libxcb-record0 libxcb-render0 libxcb-res0 \ - libxcb-screensaver0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 + libxcb-screensaver0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libegl1 - - name: Cache Qt - id: cache-qt - uses: actions/cache@v1 + - name: Install Qt + uses: jurplel/install-qt-action@v3 with: - path: ../Qt - key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }} - - - name: install Qt - uses: jurplel/install-qt-action@v2 - with: - version: '5.15.2' - modules: 'qtcharts qtsvg' - install-deps: false - cached: ${{ steps.cache-qt.outputs.cache-hit }} + aqtversion: '==3.1.*' + py7zrversion: '>=0.20.2' + version: '6.5.0' + host: 'linux' + target: 'desktop' + arch: 'gcc_64' + modules: 'qtcharts' - name: checkout sources uses: actions/checkout@v2 diff --git a/.github/workflows/mac-release.yml b/.github/workflows/mac-release.yml index 12fbefe80..c5962845e 100644 --- a/.github/workflows/mac-release.yml +++ b/.github/workflows/mac-release.yml @@ -1,4 +1,4 @@ -name: Mac / Qt 5.15 +name: Mac / Qt 6.5.0 on: workflow_run: workflows: ["Release setup"] @@ -22,20 +22,16 @@ jobs: - name: setup Homebrew run: brew install autoconf automake libtool xz pkg-config libgit2 libjpg libpng libmtp svg2png - - name: Cache Qt - id: cache-qt - uses: actions/cache@v1 + - name: Install Qt + uses: jurplel/install-qt-action@v3 with: - path: ../Qt - key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }} - - - name: install Qt - uses: jurplel/install-qt-action@v2 - with: - version: '5.15.2' - modules: 'qtcharts qtsvg' - install-deps: false - cached: ${{ steps.cache-qt.outputs.cache-hit }} + aqtversion: '==3.1.*' + py7zrversion: '>=0.20.2' + version: '6.5.0' + host: 'mac' + target: 'desktop' + arch: 'clang_64' + modules: 'qtcharts' - name: build Ripes run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4a5a04020..a8fed57b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-18.04] + os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-20.04] steps: - uses: actions/checkout@v2 @@ -57,18 +57,18 @@ jobs: # Qt installation - if: "!contains(matrix.os, 'windows')" name: install Qt - uses: jurplel/install-qt-action@v2 + uses: jurplel/install-qt-action@v3 with: - version: '5.15.2' - modules: 'qtcharts qtsvg' + version: '6.5.0' + modules: 'qtcharts' install-deps: false - if: contains( matrix.os, 'windows') name: install Qt (Windows) - uses: jurplel/install-qt-action@v2 + uses: jurplel/install-qt-action@v3 with: - version: '5.15.2' - modules: 'qtcharts qtsvg' + version: '6.5.0' + modules: 'qtcharts' install-deps: false arch: win64_msvc2019_64 diff --git a/.github/workflows/wasm-release.yml b/.github/workflows/wasm-release.yml new file mode 100644 index 000000000..3cf14392b --- /dev/null +++ b/.github/workflows/wasm-release.yml @@ -0,0 +1,107 @@ +name: WASM / Qt 6.5.0 +on: + push: + branches: + - '*' + +jobs: + buildUbuntuXenial: + runs-on: ubuntu-20.04 + env: + CC: emcc + CXX: em++ + + strategy: + matrix: + build-type: [Release] + + steps: + + - name: Job info + run: | + echo "GitHub Ref: ${{ github.ref }}" + echo "Event: ${{ github.event }}" + + - name: get container ready for build + run: | + sudo apt-get update + sudo apt-get upgrade -y + DEBIAN_FRONTEND=noninteractive sudo apt-get install -y -q --force-yes \ + automake cmake git wget libfuse2 desktop-file-utils tree \ + build-essential libgl1-mesa-dev libxkbcommon-x11-0 libpulse-dev \ + libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 \ + libxcb-xinerama0 libxcb-composite0 libxcb-cursor0 libxcb-damage0 \ + libxcb-dpms0 libxcb-dri2-0 libxcb-dri3-0 libxcb-ewmh2 libxcb-glx0 \ + libxcb-present0 libxcb-randr0 libxcb-record0 libxcb-render0 libxcb-res0 \ + libxcb-screensaver0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libegl1 libegl1-mesa-dev + + - name: checkout sources + uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + + - name: Install Qt (Host) + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==3.1.*' + py7zrversion: '>=0.20.2' + version: '6.5.0' + host: 'linux' + target: 'desktop' + arch: 'gcc_64' + cache: 'true' + cache-key-prefix: 'install-qt-host-6.5.0' + modules: 'qtcharts' + + - name: Install Qt (Emscripten) + uses: jurplel/install-qt-action@v3 + with: + aqtversion: '==3.1.*' + py7zrversion: '>=0.20.2' + version: '6.5.0' + host: 'linux' + target: 'desktop' + arch: 'wasm_multithread' + modules: 'qtcharts' + cache: 'true' + cache-key-prefix: 'install-qt-emscripten-6.5.0' + + - name: install Emscripten + run: | + git clone https://github.com/emscripten-core/emsdk.git + cd emsdk + ./emsdk install latest 3.1.25 + ./emsdk activate 3.1.25 + + - name: build Ripes + run: | + echo "building desktop" + source emsdk/emsdk_env.sh + export QT_HOST_PATH=$(pwd)/../Qt/6.5.0/gcc_64/ + find ${QT_HOST_PATH} + cmake \ + -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \ + -DRIPES_WITH_QPROCESS=OFF \ + -DEMSCRIPTEN=1 \ + -DQT_HOST_PATH="${QT_HOST_PATH}" \ + -DCMAKE_TOOLCHAIN_FILE=$(pwd)/../Qt/6.5.0/wasm_multithread/lib/cmake/Qt6/qt.toolchain.cmake \ + -DCMAKE_PREFIX_PATH=$(pwd)/../Qt/6.5.0/wasm_multithread/ \ + -DEMSCRIPTEN_FORCE_COMPILERS=ON \ + . + make -j $(nproc) + + - uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.build-type }}_wasm + path: | + Ripes.wasm + Ripes.js + Ripes.worker.js + qtloader.js + + # Dispatch the publish.yml workflow over at mortbopet.github.io + - run: | + gh workflow run publish.yml -R mortbopet/mortbopet.github.io --ref master + env: + GH_TOKEN: ${{ secrets.MORTBOPET_GITHUB_IO_TOKEN }} diff --git a/.github/workflows/windows-release.yml b/.github/workflows/windows-release.yml index ba08e0118..0748ff593 100644 --- a/.github/workflows/windows-release.yml +++ b/.github/workflows/windows-release.yml @@ -1,4 +1,4 @@ -name: Windows / Qt 5.15 +name: Windows / Qt 6.5.0 on: workflow_run: workflows: ["Release setup"] @@ -17,21 +17,16 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 - uses: seanmiddleditch/gha-setup-ninja@master - - name: Cache Qt - id: cache-qt - uses: actions/cache@v1 + - name: Install Qt + uses: jurplel/install-qt-action@v3 with: - path: ../Qt - key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }} - - - name: install Qt - uses: jurplel/install-qt-action@v2 - with: - version: '5.15.2' - modules: 'qtcharts qtsvg' - install-deps: false - arch: win64_msvc2019_64 - cached: ${{ steps.cache-qt.outputs.cache-hit }} + aqtversion: '==3.1.*' + py7zrversion: '>=0.20.2' + version: '6.5.0' + host: 'windows' + target: 'desktop' + arch: 'win64_msvc2019_64' + modules: 'qtcharts' - name: checkout sources uses: actions/checkout@v2 diff --git a/CMakeLists.txt b/CMakeLists.txt index a06e9df4c..bb7c512bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.13) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +message(status "QT_HOST_PATH = ${QT_HOST_PATH}") + find_program(CCACHE_PROGRAM ccache) if(CCACHE_PROGRAM) @@ -42,24 +46,27 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) +set(RIPES_WITH_QPROCESS ON CACHE BOOL "Build with QProcess-related utilities") +# Add as a C++ definition +if(RIPES_WITH_QPROCESS) + add_definitions(-DRIPES_WITH_QPROCESS) +endif() + # Find required Qt packages -find_package(Qt5Core REQUIRED) -find_package(Qt5Widgets CONFIG REQUIRED) -find_package(Qt5Svg REQUIRED) -find_package(Qt5Charts CONFIG REQUIRED) +find_package(Qt6 COMPONENTS Core Widgets Svg Charts REQUIRED) # Finding Qt includes -include_directories(${Qt5Widgets_INCLUDE_DIRS}) -include_directories(${Qt5Core_INCLUDE_DIRS}) -include_directories(${Qt5Charts_INCLUDE_DIRS}) +include_directories(${Qt6Widgets_INCLUDE_DIRS}) +include_directories(${Qt6Core_INCLUDE_DIRS}) +include_directories(${Qt6Charts_INCLUDE_DIRS}) ###################################################################### ## Resources setup ###################################################################### -qt5_add_resources(ICONS_SRC ${CMAKE_SOURCE_DIR}/resources/icons/icons.qrc) -qt5_add_resources(EXAMPLES_SRC ${CMAKE_SOURCE_DIR}/examples/examples.qrc) -qt5_add_resources(LAYOUTS_SRC ${CMAKE_SOURCE_DIR}/src/processors/layouts.qrc) -qt5_add_resources(FONTS_SRC ${CMAKE_SOURCE_DIR}/resources/fonts/fonts.qrc) +qt6_add_resources(ICONS_SRC ${CMAKE_SOURCE_DIR}/resources/icons/icons.qrc) +qt6_add_resources(EXAMPLES_SRC ${CMAKE_SOURCE_DIR}/examples/examples.qrc) +qt6_add_resources(LAYOUTS_SRC ${CMAKE_SOURCE_DIR}/src/processors/layouts.qrc) +qt6_add_resources(FONTS_SRC ${CMAKE_SOURCE_DIR}/resources/fonts/fonts.qrc) ###################################################################### ## Library setup @@ -109,12 +116,19 @@ if(RIPES_BUILD_TESTS) endif() set(APP_NAME Ripes) -add_executable(${APP_NAME} ${SYSTEM_FLAGS} ${ICONS_SRC} ${EXAMPLES_SRC} ${LAYOUTS_SRC} ${FONTS_SRC} main.cpp) +qt_add_executable(${APP_NAME} ${SYSTEM_FLAGS} ${ICONS_SRC} ${EXAMPLES_SRC} ${LAYOUTS_SRC} ${FONTS_SRC} main.cpp) # Link Qt libraries -target_link_libraries(${APP_NAME} Qt5::Core Qt5::Widgets) +target_link_libraries(${APP_NAME} PUBLIC Qt6::Core Qt6::Widgets) # Link Ripes library -target_link_libraries(${APP_NAME} ${RIPES_LIB}) +target_link_libraries(${APP_NAME} PUBLIC ${RIPES_LIB}) + +if(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten") + # https://doc.qt.io/qt-6/wasm.html#asyncify + target_link_options(${RIPES_LIB} PUBLIC -sASYNCIFY -Os) + target_link_options(${APP_NAME} PUBLIC -sASYNCIFY -Os) +endif() + if(UNIX AND NOT APPLE) #Define the LINUX variable before testing it set(LINUX TRUE) diff --git a/README.md b/README.md index 36495f503..8ebd234cb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Ripes -[![Windows / Qt 5.15](https://github.com/mortbopet/Ripes/actions/workflows/windows-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/windows-release.yml) -[![Mac release / Qt 5.15](https://github.com/mortbopet/Ripes/actions/workflows/mac-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/mac-release.yml) -[![Ubuntu release 16.04 / Qt 5.15](https://github.com/mortbopet/Ripes/actions/workflows/linux-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/linux-release.yml) +[![Windows / Qt 6.5.0](https://github.com/mortbopet/Ripes/actions/workflows/windows-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/windows-release.yml) +[![Mac release / Qt 6.5.0](https://github.com/mortbopet/Ripes/actions/workflows/mac-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/mac-release.yml) +[![Ubuntu release 16.04 / Qt 6.5.0](https://github.com/mortbopet/Ripes/actions/workflows/linux-release.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/linux-release.yml) [![Ripes CI tests](https://github.com/mortbopet/Ripes/actions/workflows/test.yml/badge.svg)](https://github.com/mortbopet/Ripes/actions/workflows/test.yml) [![Gitter](https://badges.gitter.im/Ripes-VSRTL/Ripes.svg)](https://gitter.im/Ripes-VSRTL/) @@ -40,8 +40,9 @@ For Windows, the C++ runtime library must be available (if not, a msvcp140.dll e ## Building Initially, the following dependencies must be made available: -- A recent (>=5.15) version of [Qt](https://www.qt.io/download) + Qt Charts (**not** bundled with Qt by default, but can be selected during Qt installation) +- A recent (>=6.5.0) version of [Qt](https://www.qt.io/download) + Qt Charts (**not** bundled with Qt by default, but can be selected during Qt installation) - [CMake](https://cmake.org/) +- `sudo apt-get install libegl1-mesa-dev` Then, Ripes can be checked out and built as a standard CMake project: ``` diff --git a/docker/ripes.dockerfile b/docker/ripes.dockerfile index 815c67ff0..0de19291a 100644 --- a/docker/ripes.dockerfile +++ b/docker/ripes.dockerfile @@ -1,6 +1,7 @@ -FROM debian:bookworm-backports +FROM ubuntu ARG DEBIAN_FRONTEND=noninteractive + RUN apt-get update -q \ && apt-get install -qy --no-install-recommends \ build-essential \ @@ -8,20 +9,37 @@ RUN apt-get update -q \ gcc-riscv64-unknown-elf \ git \ libpthread-stubs0-dev \ - libqt5charts5-dev \ - libqt5svg5-dev \ python3 \ + python3-pip \ + libegl1 libegl1-mesa-dev \ + libgl1-mesa-dev libglib2.0-dev \ + libxkbcommon-x11-0 libpulse-dev libfontconfig1-dev libfreetype6-dev \ + libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-render-util0 \ + libxcb-xinerama0 libxcb-composite0 libxcb-cursor0 libxcb-damage0 \ + libxcb-dpms0 libxcb-dri2-0 libxcb-dri3-0 libxcb-ewmh2 libxcb-glx0 \ + libxcb-present0 libxcb-randr0 libxcb-record0 libxcb-render0 libxcb-res0 \ + libxcb-screensaver0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 \ && apt-get -y autoremove \ && apt-get -y autoclean \ && rm -rf /var/lib/apt/lists/* +RUN python3 -m pip install aqtinstall + +# from https://ddalcino.github.io/aqt-list-server/ +RUN aqt install-qt linux desktop 6.5.0 gcc_64 -m qtcharts + ARG GIT_SSL_NO_VERIFY=true ENV LC_ALL=C.UTF-8 SHELL=/bin/bash ARG BRANCH=master RUN git clone --recursive --branch ${BRANCH} https://github.com/mortbopet/Ripes.git /tmp/ripes \ - && cmake -S /tmp/ripes/ -B /tmp/ripes/build \ - -Wno-dev -DRIPES_BUILD_TESTS=ON -DVSRTL_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release \ + && cmake -S /tmp/ripes/ \ + -B /tmp/ripes/build \ + -Wno-dev \ + -DRIPES_BUILD_TESTS=ON \ + -DVSRTL_BUILD_TESTS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH=$(pwd)/6.5.0/gcc_64/ \ && cmake --build /tmp/ripes/build \ && cd /tmp/ripes/build/test \ && ./tst_assembler && ./tst_expreval && ./tst_riscv \ diff --git a/external/VSRTL b/external/VSRTL index 8fd0bce6f..a7f17baf2 160000 --- a/external/VSRTL +++ b/external/VSRTL @@ -1 +1 @@ -Subproject commit 8fd0bce6f5fcf27b89b33cf995b0428b8436ccdf +Subproject commit a7f17baf2f5cee4a9946d987a74348ab75375d25 diff --git a/external/fancytabbar/CMakeLists.txt b/external/fancytabbar/CMakeLists.txt index 1916995c9..4d350f82a 100644 --- a/external/fancytabbar/CMakeLists.txt +++ b/external/fancytabbar/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.9) -# Find Qt5Core and Qt5Widgets -find_package(Qt5Core REQUIRED) -find_package(Qt5Widgets CONFIG REQUIRED) +# Find Qt6 Core and Widgets +find_package(Qt6 COMPONENTS Core Widgets REQUIRED) set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -15,4 +14,4 @@ file(GLOB LIB_UIS *.ui) set(FANCYTABBAR_LIB fancytabbar_lib) add_library(${FANCYTABBAR_LIB} STATIC ${LIB_SOURCES} ${LIB_HEADERS} ${LIB_UIS}) -target_link_libraries(${FANCYTABBAR_LIB} Qt5::Core Qt5::Widgets) +target_link_libraries(${FANCYTABBAR_LIB} Qt6::Core Qt6::Widgets) diff --git a/external/fancytabbar/fancytab.h b/external/fancytabbar/fancytab.h index 0679ed434..a2c2f95fa 100644 --- a/external/fancytabbar/fancytab.h +++ b/external/fancytabbar/fancytab.h @@ -11,10 +11,10 @@ */ class FancyTab { public: - FancyTab(const QIcon& icon, QString text); + FancyTab(const QIcon &icon, QString text); - QString m_text; - QIcon m_icon; + QString m_text; + QIcon m_icon; }; -#endif // FANCYTAB_H +#endif // FANCYTAB_H diff --git a/external/fancytabbar/fancytabbar.cpp b/external/fancytabbar/fancytabbar.cpp index c6cb0846c..8687e1a00 100644 --- a/external/fancytabbar/fancytabbar.cpp +++ b/external/fancytabbar/fancytabbar.cpp @@ -205,7 +205,7 @@ void FancyTabBar::mouseMoveEvent(QMouseEvent *event) { * cursor enter FancyTabBar area. * \param event see qt documentation for more details about this parameter. */ -void FancyTabBar::enterEvent(QEvent *event) { +void FancyTabBar::enterEvent(QEnterEvent *event) { QEnterEvent *enterEvent = static_cast(event); hower = getTabIndexByPoint(enterEvent->x(), enterEvent->y()); update(); diff --git a/external/fancytabbar/fancytabbar.h b/external/fancytabbar/fancytabbar.h index e2c367e88..fce34d1a1 100644 --- a/external/fancytabbar/fancytabbar.h +++ b/external/fancytabbar/fancytabbar.h @@ -30,7 +30,7 @@ class FancyTabBar : public QWidget { void paintEvent(QPaintEvent *event); void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); - void enterEvent(QEvent *event); + void enterEvent(QEnterEvent *event); void leaveEvent(QEvent *event); QRect getTabRect(qint32 index); diff --git a/external/libelfin b/external/libelfin index 49d16531a..93a424940 160000 --- a/external/libelfin +++ b/external/libelfin @@ -1 +1 @@ -Subproject commit 49d16531a11f5f288e77795a5c6bdd75b46657f7 +Subproject commit 93a424940dc6e721818c5634b1876c8800e3f980 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bc984f116..6bb9800ef 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,7 +32,7 @@ function(create_ripes_lib NAME) ${CMAKE_CURRENT_SOURCE_DIR} ) - target_link_libraries(${LIB_NAME} PUBLIC Qt5::Gui) + target_link_libraries(${LIB_NAME} PUBLIC Qt6::Gui) if(NOT OPTIONS_EXCLUDE_SRC_INC) target_include_directories(${LIB_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/src) endif() @@ -71,6 +71,6 @@ add_subdirectory(cli) target_link_libraries(${RIPES_LIB} PUBLIC fancytabbar_lib ${VSRTL_GRAPHICS_LIB} - Qt5::Charts + Qt6::Charts dwarf++) diff --git a/src/STLExtras.h b/src/STLExtras.h index beb7c42b2..f75705066 100644 --- a/src/STLExtras.h +++ b/src/STLExtras.h @@ -216,8 +216,8 @@ template using IterOfRange = decltype(std::begin(std::declval())); template -using ValueOfRange = typename std::remove_reference()))>::type; +using ValueOfRange = typename std::remove_reference()))>::type; template class enumerator_iter; diff --git a/src/addressdialog.cpp b/src/addressdialog.cpp index 9cdd84e9a..e200f6587 100644 --- a/src/addressdialog.cpp +++ b/src/addressdialog.cpp @@ -2,7 +2,7 @@ #include "ui_addressdialog.h" #include -#include +#include #include "processorhandler.h" #include "radix.h" @@ -13,7 +13,8 @@ AddressDialog::AddressDialog(QWidget *parent) : QDialog(parent), m_ui(new Ui::AddressDialog) { m_ui->setupUi(this); - QRegExpValidator *validator = new QRegExpValidator(this); + QRegularExpressionValidator *validator = + new QRegularExpressionValidator(this); setISADepRegex(validator); m_ui->address->setValidator(validator); m_ui->address->setText( diff --git a/src/assembler/assemblerbase.cpp b/src/assembler/assemblerbase.cpp index 8cf4dd621..bf6f67bb8 100644 --- a/src/assembler/assemblerbase.cpp +++ b/src/assembler/assemblerbase.cpp @@ -31,7 +31,7 @@ void AssemblerBase::setSegmentBase(Section seg, AInt base) { AssembleResult AssemblerBase::assembleRaw(const QString &program, const SymbolMap *symbols) const { - const auto programLines = program.split(QRegExp("[\r\n]")); + const auto programLines = program.split(QRegularExpression("[\r\n]")); return assemble(programLines, symbols, Program::calculateHash(program.toUtf8())); } diff --git a/src/assembler/parserutilities.cpp b/src/assembler/parserutilities.cpp index afe86d905..657d0f002 100644 --- a/src/assembler/parserutilities.cpp +++ b/src/assembler/parserutilities.cpp @@ -169,12 +169,12 @@ Result tokenizeQuotes(const Location &location, escape = false; substr.push_back(ch); } else { - if (ch == " " || ch == "," || ch == "\t") { + if (ch == ' ' || ch == ',' || ch == '\t') { if (!substr.isEmpty()) pushSubstr(); } else substr.push_back(ch); - if (ch == "\"") + if (ch == '\"') inQuotes = true; } } diff --git a/src/cachesim/cachegraphic.cpp b/src/cachesim/cachegraphic.cpp index f36cfa52a..f5b4ffac6 100644 --- a/src/cachesim/cachegraphic.cpp +++ b/src/cachesim/cachegraphic.cpp @@ -114,7 +114,8 @@ void CacheGraphic::updateLineReplFields(unsigned lineIdx) { // LRU text might have changed; update LRU field position to center in // column const qreal y = lineIdx * m_lineHeight + way.first * m_setHeight; - const qreal x = m_widthBeforeLRU + m_lruWidth / 2 - m_fm.width(lruText) / 2; + const qreal x = + m_widthBeforeLRU + m_lruWidth / 2 - m_fm.horizontalAdvance(lruText) / 2; way.second.lru->setPos(x, y); } @@ -149,8 +150,9 @@ void CacheGraphic::updateWay(unsigned lineIdx, unsigned wayIdx) { QGraphicsSimpleTextItem *blockTextItem = nullptr; if (way.blocks.count(i) == 0) { // Block text item has not yet been created - const qreal x = m_widthBeforeBlocks + i * m_blockWidth + - (m_blockWidth / 2 - m_fm.width(addressString()) / 2); + const qreal x = + m_widthBeforeBlocks + i * m_blockWidth + + (m_blockWidth / 2 - m_fm.horizontalAdvance(addressString()) / 2); const qreal y = lineIdx * m_lineHeight + wayIdx * m_setHeight; way.blocks[i] = createGraphicsTextItemSP(x, y); @@ -200,7 +202,8 @@ void CacheGraphic::updateWay(unsigned lineIdx, unsigned wayIdx) { QGraphicsSimpleTextItem *tagTextItem = way.tag.get(); if (tagTextItem == nullptr) { const qreal x = - m_widthBeforeTag + (m_tagWidth / 2 - m_fm.width(addressString()) / 2); + m_widthBeforeTag + + (m_tagWidth / 2 - m_fm.horizontalAdvance(addressString()) / 2); const qreal y = lineIdx * m_lineHeight + wayIdx * m_setHeight; way.tag = createGraphicsTextItemSP(x, y); tagTextItem = way.tag.get(); @@ -325,12 +328,14 @@ void CacheGraphic::drawIndexingItems() { &smallerFont); const QString topBits = "31"; drawText(topBits, - m_addressTextItem->pos().x() - smallerFontMetric.width(topBits), + m_addressTextItem->pos().x() - + smallerFontMetric.horizontalAdvance(topBits), m_addressTextItem->pos().y() - m_setHeight, &smallerFont); unsigned bitIdx = 0; auto drawNextBitPos = [&](unsigned additionalOffset) { - nextBitsPos -= {m_fm.width(QString("-").repeated(additionalOffset)), 0}; + nextBitsPos -= + {m_fm.horizontalAdvance(QString("-").repeated(additionalOffset)), 0}; bitIdx += additionalOffset; auto line = new QGraphicsLineItem( QLineF{nextBitsPos, nextBitsPos + QPointF{0, m_setHeight}}, this); @@ -342,8 +347,8 @@ void CacheGraphic::drawIndexingItems() { drawText(thisBitText, nextBitsPos - QPointF{0, smallerFontMetric.height()}, &smallerFont); drawText(nextBitText, - nextBitsPos - - QPointF{m_fm.width(nextBitText), smallerFontMetric.height()}, + nextBitsPos - QPointF{m_fm.horizontalAdvance(nextBitText), + smallerFontMetric.height()}, &smallerFont); }; @@ -382,7 +387,7 @@ void CacheGraphic::drawIndexingItems() { // Draw top header const QString addrStr = "Access address"; QPointF addrStrPos = m_addressTextItem->pos(); - addrStrPos.rx() -= m_fm.width(addrStr) * 1.1; + addrStrPos.rx() -= m_fm.horizontalAdvance(addrStr) * 1.1; // addrStrPos.ry() += m_setHeight; drawText(addrStr, addrStrPos); } @@ -401,9 +406,9 @@ void CacheGraphic::cacheInvalidated() { // Determine cell dimensions m_setHeight = m_fm.height(); m_lineHeight = m_setHeight * m_cache.getWays(); - m_blockWidth = m_fm.width(" " + addressString() + " "); - m_bitWidth = m_fm.width("00"); - m_lruWidth = m_fm.width(QString::number(m_cache.getWays()) + " "); + m_blockWidth = m_fm.horizontalAdvance(" " + addressString() + " "); + m_bitWidth = m_fm.horizontalAdvance("00"); + m_lruWidth = m_fm.horizontalAdvance(QString::number(m_cache.getWays()) + " "); m_cacheHeight = m_lineHeight * m_cache.getLines(); m_tagWidth = m_blockWidth; @@ -438,9 +443,10 @@ void CacheGraphic::cacheInvalidated() { new QGraphicsLineItem(width + m_lruWidth, 0, width + m_lruWidth, m_cacheHeight, this); const QString LRUBitText = "LRU"; - auto *textItem = drawText( - LRUBitText, width + m_lruWidth / 2 - m_fm.width(LRUBitText) / 2, - -m_fm.height()); + auto *textItem = drawText(LRUBitText, + width + m_lruWidth / 2 - + m_fm.horizontalAdvance(LRUBitText) / 2, + -m_fm.height()); textItem->setToolTip("Least Recently Used bits"); width += m_lruWidth; } @@ -451,7 +457,8 @@ void CacheGraphic::cacheInvalidated() { new QGraphicsLineItem(m_tagWidth + width, 0, m_tagWidth + width, m_cacheHeight, this); const QString tagText = "Tag"; - drawText(tagText, width + m_tagWidth / 2 - m_fm.width(tagText) / 2, + drawText(tagText, + width + m_tagWidth / 2 - m_fm.horizontalAdvance(tagText) / 2, -m_fm.height()); width += m_tagWidth; @@ -460,7 +467,8 @@ void CacheGraphic::cacheInvalidated() { // Draw horizontal lines between cache blocks for (int i = 0; i < m_cache.getBlocks(); ++i) { const QString blockText = "Word " + QString::number(i); - drawText(blockText, width + m_tagWidth / 2 - m_fm.width(blockText) / 2, + drawText(blockText, + width + m_tagWidth / 2 - m_fm.horizontalAdvance(blockText) / 2, -m_fm.height()); width += m_blockWidth; new QGraphicsLineItem(width, 0, width, m_cacheHeight, this); @@ -492,13 +500,13 @@ void CacheGraphic::cacheInvalidated() { const QString text = QString::number(i); const qreal y = i * m_lineHeight + m_lineHeight / 2 - m_setHeight / 2; - const qreal x = -m_fm.width(text) * 1.2; + const qreal x = -m_fm.horizontalAdvance(text) * 1.2; drawText(text, x, y); } // Draw index column text const QString indexText = "Index"; - const qreal x = -m_fm.width(indexText) * 1.2; + const qreal x = -m_fm.horizontalAdvance(indexText) * 1.2; drawText(indexText, x, -m_fm.height()); // Draw indexing - this does not change the 'width' advancement, and is purely @@ -555,7 +563,7 @@ void CacheGraphic::updateAddressing( (transaction.index.line + 0.5) * m_lineHeight}; lineIndexingPoly << QPointF{ - -m_fm.width(QString::number(m_cache.getLines())) * 1.25, + -m_fm.horizontalAdvance(QString::number(m_cache.getLines())) * 1.25, lineIndexingPoly.last().y()}; m_lineIndexingLine->setPolygon(lineIndexingPoly); @@ -679,12 +687,13 @@ void CacheGraphic::initializeControlBits() { qreal x; // Create valid field - x = m_bitWidth / 2 - m_fm.width("0") / 2; + x = m_bitWidth / 2 - m_fm.horizontalAdvance("0") / 2; line[setIdx].valid = drawText("0", x, y); if (m_cache.getWritePolicy() == WritePolicy::WriteBack) { // Create dirty bit field - x = m_widthBeforeDirty + m_bitWidth / 2 - m_fm.width("0") / 2; + x = m_widthBeforeDirty + m_bitWidth / 2 - + m_fm.horizontalAdvance("0") / 2; line[setIdx].dirty = drawText("0", x, y); } @@ -692,7 +701,8 @@ void CacheGraphic::initializeControlBits() { m_cache.getWays() > 1) { // Create LRU field const QString lruText = QString::number(m_cache.getWays() - 1); - x = m_widthBeforeLRU + m_lruWidth / 2 - m_fm.width(lruText) / 2; + x = m_widthBeforeLRU + m_lruWidth / 2 - + m_fm.horizontalAdvance(lruText) / 2; line[setIdx].lru = drawText(lruText, x, y); } } diff --git a/src/cachesim/cacheplotview.cpp b/src/cachesim/cacheplotview.cpp index 590e6e093..c424ad91e 100644 --- a/src/cachesim/cacheplotview.cpp +++ b/src/cachesim/cacheplotview.cpp @@ -68,7 +68,7 @@ CachePlotView::CachePlotView(QWidget *parent) : QGraphicsView(parent) { setMouseTracking(true); } -void CachePlotView::enterEvent(QEvent *event) { +void CachePlotView::enterEvent(QEnterEvent *event) { m_mouseInView = true; for (const auto &marker : m_markers) { marker->marker->show(); diff --git a/src/cachesim/cacheplotview.h b/src/cachesim/cacheplotview.h index 3b03b0a89..aa8817a13 100644 --- a/src/cachesim/cacheplotview.h +++ b/src/cachesim/cacheplotview.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -10,15 +11,11 @@ class QMouseEvent; class QResizeEvent; QT_END_NAMESPACE -QT_CHARTS_BEGIN_NAMESPACE class QChart; class QLineSeries; -QT_CHARTS_END_NAMESPACE class Callout; -QT_CHARTS_USE_NAMESPACE - namespace Ripes { class ChartLineMarker; @@ -54,15 +51,15 @@ class CachePlotView : public QGraphicsView { protected: void resizeEvent(QResizeEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override; - void enterEvent(QEvent *event) override; + void enterEvent(QEnterEvent *event) override; void leaveEvent(QEvent *event) override; public slots: void keepCallout(); void deleteCallout(Callout *callout); void tooltip(QPointF point, bool state); - void hideSeriesMarker(QtCharts::QLineSeries *series); - void showSeriesMarker(QtCharts::QLineSeries *series, const QString &name); + void hideSeriesMarker(QLineSeries *series); + void showSeriesMarker(QLineSeries *series, const QString &name); private: void resizeObjects(const QSizeF &size); diff --git a/src/cachesim/cacheplotwidget.h b/src/cachesim/cacheplotwidget.h index 980a84df0..babba1539 100644 --- a/src/cachesim/cacheplotwidget.h +++ b/src/cachesim/cacheplotwidget.h @@ -11,13 +11,9 @@ QT_FORWARD_DECLARE_CLASS(QToolBar); QT_FORWARD_DECLARE_CLASS(QAction); -QT_CHARTS_BEGIN_NAMESPACE class QChartView; class QChart; class QLineSeries; -QT_CHARTS_END_NAMESPACE - -QT_CHARTS_USE_NAMESPACE template class FixedQueue : public std::deque { diff --git a/src/cachesim/callout.h b/src/cachesim/callout.h index 961d315a1..5db479fa5 100644 --- a/src/cachesim/callout.h +++ b/src/cachesim/callout.h @@ -38,11 +38,7 @@ QT_BEGIN_NAMESPACE class QGraphicsSceneMouseEvent; QT_END_NAMESPACE -QT_CHARTS_BEGIN_NAMESPACE class QChart; -QT_CHARTS_END_NAMESPACE - -QT_CHARTS_USE_NAMESPACE namespace Ripes { class CachePlotView; diff --git a/src/cachesim/chartlinemarker.h b/src/cachesim/chartlinemarker.h index 9c54545f8..b71e9e267 100644 --- a/src/cachesim/chartlinemarker.h +++ b/src/cachesim/chartlinemarker.h @@ -5,8 +5,6 @@ #include -QT_CHARTS_USE_NAMESPACE - namespace Ripes { class ChartLineMarker : public QGraphicsObject { diff --git a/src/ccmanager.cpp b/src/ccmanager.cpp index 7dfcdc6c2..c852f2cf1 100644 --- a/src/ccmanager.cpp +++ b/src/ccmanager.cpp @@ -120,6 +120,7 @@ CCManager::CCRes CCManager::compile(const QTextDocument *source, CCManager::CCRes CCManager::compile(const QStringList &files, QString outname, bool showProgressdiag) { +#ifdef RIPES_WITH_QPROCESS CCRes res; if (outname.isEmpty()) { outname = QDir::tempPath() + QDir::separator() + @@ -181,9 +182,20 @@ CCManager::CCRes CCManager::compile(const QStringList &files, QString outname, res.aborted = m_aborted; return res; +#else + CCRes res; + res.success = false; + return res; +#endif } -QString CCManager::getError() { return get().m_process.readAllStandardError(); } +QString CCManager::getError() { +#ifdef RIPES_WITH_QPROCESS + return get().m_process.readAllStandardError(); +#else + return QString(); +#endif +} static QStringList sanitizedArguments(const QString &args) { QStringList arglist = args.split(" "); @@ -241,6 +253,7 @@ CCManager::createCompileCommand(const QStringList &files, } CCManager::CCRes CCManager::verifyCC(const QString &CCPath) { +#ifdef RIPES_WITH_QPROCESS // Try to set CCPath as current compiler, and compile test program m_currentCC = CCPath; @@ -271,6 +284,11 @@ CCManager::CCRes CCManager::verifyCC(const QString &CCPath) { verifyCC_end: return res; +#else + CCRes res; + res.success = false; + return res; +#endif } } // namespace Ripes diff --git a/src/ccmanager.h b/src/ccmanager.h index b7f4bb862..77ef2bfc1 100644 --- a/src/ccmanager.h +++ b/src/ccmanager.h @@ -105,7 +105,9 @@ public slots: CCManager(); QString m_currentCC; +#ifdef RIPES_WITH_QPROCESS QProcess m_process; +#endif bool m_errored = false; bool m_aborted = false; std::unique_ptr m_tmpSrcFile; diff --git a/src/editor/codeeditor.cpp b/src/editor/codeeditor.cpp index 10ef67a36..0d50e87c1 100644 --- a/src/editor/codeeditor.cpp +++ b/src/editor/codeeditor.cpp @@ -43,7 +43,7 @@ CodeEditor::CodeEditor(QWidget *parent) : HighlightableTextEdit(parent) { m_font = QFont(Fonts::monospace, 11); setFont(m_font); m_fontTimer.setSingleShot(true); - setTabStopDistance(QFontMetricsF(m_font).width(' ') * 4); + setTabStopDistance(QFontMetricsF(m_font).horizontalAdvance(' ') * 4); // set event filter for catching scroll events installEventFilter(this); @@ -184,7 +184,7 @@ void CodeEditor::updateSidebarWidth(int /* newBlockCount */) { static int indentationOf(const QString &text) { int indent = 0; for (const auto &ch : text) { - if (ch == " ") { + if (ch == ' ') { indent++; } else { break; diff --git a/src/io/ioswitches.cpp b/src/io/ioswitches.cpp index 26dd95e86..128990203 100644 --- a/src/io/ioswitches.cpp +++ b/src/io/ioswitches.cpp @@ -127,7 +127,7 @@ void ToggleButton::mouseReleaseEvent(QMouseEvent *e) { } } -void ToggleButton::enterEvent(QEvent *event) { +void ToggleButton::enterEvent(QEnterEvent *event) { setCursor(Qt::PointingHandCursor); QAbstractButton::enterEvent(event); } diff --git a/src/io/ioswitches.h b/src/io/ioswitches.h index 79a04c0bb..61f7f4c2e 100644 --- a/src/io/ioswitches.h +++ b/src/io/ioswitches.h @@ -35,7 +35,7 @@ class ToggleButton : public QAbstractButton { void paintEvent(QPaintEvent *) override; void resizeEvent(QResizeEvent *) override; void mouseReleaseEvent(QMouseEvent *) override; - void enterEvent(QEvent *event) override; + void enterEvent(QEnterEvent *event) override; void setChecked(bool checked); int offset(); diff --git a/src/isa/isainfo.h b/src/isa/isainfo.h index 202a9dc71..1bf811ac1 100644 --- a/src/isa/isainfo.h +++ b/src/isa/isainfo.h @@ -1,5 +1,6 @@ #pragma once +#include "limits.h" #include #include #include diff --git a/src/loaddialog.cpp b/src/loaddialog.cpp index a6c27e057..e282518ab 100644 --- a/src/loaddialog.cpp +++ b/src/loaddialog.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include namespace Ripes { @@ -45,7 +45,8 @@ LoadDialog::LoadDialog(QWidget *parent) // -- nothing to do/verify // Binary page - QRegExpValidator *validator = new QRegExpValidator(this); + QRegularExpressionValidator *validator = + new QRegularExpressionValidator(this); setISADepRegex(validator); m_ui->binaryLoadAt->setValidator(validator); m_ui->binaryLoadAt->setText( diff --git a/src/processmanager.h b/src/processmanager.h index 57c4133e6..129026443 100644 --- a/src/processmanager.h +++ b/src/processmanager.h @@ -10,6 +10,8 @@ namespace Ripes { +#ifdef RIPES_WITH_QPROCESS + // A process manager is responsible for managing the autodetection and execution // of processes. A program manager is a singleton for each specialization of the // template. This is done through static polymorphism. @@ -135,4 +137,40 @@ class ProcessManager { } }; +#else + +template +class ProcessManager { + // A dummy version of the above which does nothing, but preserves the + // interface. +public: + struct ProcessResult { + QString stdOut; + QString stdErr; + }; + ProcessManager() = default; + virtual ~ProcessManager() = default; + + static bool hasValidProgram() { return false; } + static const QString &program() { return get().m_programPath; } + static QString getError() { return QString(); } + static ProcessResult run(const QStringList &args, + bool showProgressDialog = false) { + return ProcessResult(); + } + + static ProcessManager &get() { + static ProcessManager instance; + return instance; + } +signals: + + bool trySetProgram(const QString &path) { return false; } + +private: + QString m_programPath; +}; + +#endif + } // namespace Ripes diff --git a/src/programviewer.cpp b/src/programviewer.cpp index e66173c41..e46e0c66c 100644 --- a/src/programviewer.cpp +++ b/src/programviewer.cpp @@ -28,7 +28,7 @@ ProgramViewer::ProgramViewer(QWidget *parent) : HighlightableTextEdit(parent) { setFont(m_font); m_fontTimer.setSingleShot(true); - setTabStopDistance(QFontMetricsF(m_font).width(' ') * 4); + setTabStopDistance(QFontMetricsF(m_font).horizontalAdvance(' ') * 4); setLineWrapMode(QPlainTextEdit::NoWrap); } diff --git a/src/radix.cpp b/src/radix.cpp index 97057891a..7329a53cb 100644 --- a/src/radix.cpp +++ b/src/radix.cpp @@ -4,14 +4,14 @@ namespace Ripes { -void setISADepRegex(QRegExpValidator *validator) { +void setISADepRegex(QRegularExpressionValidator *validator) { const auto isaBytes = ProcessorHandler::currentISA()->bytes(); if (isaBytes == 2) { - validator->setRegExp(hexRegex16); + validator->setRegularExpression(hexRegex16); } else if (isaBytes == 4) { - validator->setRegExp(hexRegex32); + validator->setRegularExpression(hexRegex32); } else if (isaBytes == 8) { - validator->setRegExp(hexRegex64); + validator->setRegularExpression(hexRegex64); } else { Q_UNREACHABLE(); } diff --git a/src/radix.h b/src/radix.h index 914052cc5..39629c095 100644 --- a/src/radix.h +++ b/src/radix.h @@ -1,8 +1,8 @@ #pragma once #include -#include -#include +#include +#include #include #include @@ -18,15 +18,15 @@ const static std::map s_radixName = { {Radix::Unsigned, "Unsigned"}, {Radix::Signed, "Signed"}, {Radix::ASCII, "ASCII"}, {Radix::Float, "Float"}}; -static const auto hexRegex = QRegExp("0[xX][0-9a-fA-F]+"); -static const auto hexRegex16 = QRegExp("0[xX][0-9a-fA-F]{0,4}"); -static const auto hexRegex32 = QRegExp("0[xX][0-9a-fA-F]{0,8}"); -static const auto hexRegex64 = QRegExp("0[xX][0-9a-fA-F]{0,16}"); -static const auto binRegex = QRegExp("0[bB][0-1]+"); -static const auto unsignedRegex = QRegExp("[0-9]+"); -static const auto signedRegex = QRegExp("[-]*[0-9]+"); +static const auto hexRegex = QRegularExpression("0[xX][0-9a-fA-F]+"); +static const auto hexRegex16 = QRegularExpression("0[xX][0-9a-fA-F]{0,4}"); +static const auto hexRegex32 = QRegularExpression("0[xX][0-9a-fA-F]{0,8}"); +static const auto hexRegex64 = QRegularExpression("0[xX][0-9a-fA-F]{0,16}"); +static const auto binRegex = QRegularExpression("0[bB][0-1]+"); +static const auto unsignedRegex = QRegularExpression("[0-9]+"); +static const auto signedRegex = QRegularExpression("[-]*[0-9]+"); -void setISADepRegex(QRegExpValidator *validator); +void setISADepRegex(QRegularExpressionValidator *validator); QString encodeRadixValue(VInt value, const Radix type, unsigned byteWidth); VInt decodeRadixValue(QString value, const Radix type, bool *ok = nullptr); diff --git a/src/registerinitializationwidget.cpp b/src/registerinitializationwidget.cpp index 1e602581c..eaa3bc4de 100644 --- a/src/registerinitializationwidget.cpp +++ b/src/registerinitializationwidget.cpp @@ -51,8 +51,8 @@ RegisterInitializationWidget::RegisterInitializationWidget(QWidget *parent) : QWidget(parent), m_ui(new Ui::RegisterInitializationWidget) { m_ui->setupUi(this); - m_hexValidator = new QRegExpValidator(this); - m_hexValidator->setRegExp(hexRegex32); + m_hexValidator = new QRegularExpressionValidator(this); + m_hexValidator->setRegularExpression(hexRegex32); const QIcon addIcon = QIcon(":/icons/plus.svg"); m_ui->addInitButton->setIcon(addIcon); diff --git a/src/registerinitializationwidget.h b/src/registerinitializationwidget.h index 14ce3e697..cbeb3070f 100644 --- a/src/registerinitializationwidget.h +++ b/src/registerinitializationwidget.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include "processorregistry.h" @@ -51,7 +51,7 @@ private slots: static std::map m_initializations; ProcessorID m_currentID; - QRegExpValidator *m_hexValidator; + QRegularExpressionValidator *m_hexValidator; std::vector> m_currentRegInitWidgets; }; diff --git a/src/ripessettings.cpp b/src/ripessettings.cpp index c817bbff0..723728255 100644 --- a/src/ripessettings.cpp +++ b/src/ripessettings.cpp @@ -93,10 +93,6 @@ RipesSettings::RipesSettings() { QCoreApplication::setOrganizationDomain("https://github.com/mortbopet/Ripes"); QCoreApplication::setApplicationName("Ripes"); - // Serializer registrations - qRegisterMetaTypeStreamOperators("cachePreset"); - qRegisterMetaTypeStreamOperators>("cachePresetList"); - // Populate settings with default values if settings value is not found QSettings settings; for (const auto &setting : s_defaultSettings) { diff --git a/src/serializers.h b/src/serializers.h index fd2600692..fc9455f9e 100644 --- a/src/serializers.h +++ b/src/serializers.h @@ -3,6 +3,7 @@ #include "VSRTL/external/cereal/include/cereal/cereal.hpp" #include +#include #include template diff --git a/src/syscall/systemio.h b/src/syscall/systemio.h index 2f3bce422..aefa9d439 100644 --- a/src/syscall/systemio.h +++ b/src/syscall/systemio.h @@ -231,7 +231,7 @@ class SystemIO : public QObject { { s_fileErrorString = "File name " + filename + " exceeds maximum open file limit of " + - SYSCALL_MAXFILES; + QString::number(SYSCALL_MAXFILES); return -1; } diff --git a/src/utilities/systemutils.cpp b/src/utilities/systemutils.cpp index 5da963195..95bdc02cc 100644 --- a/src/utilities/systemutils.cpp +++ b/src/utilities/systemutils.cpp @@ -3,10 +3,14 @@ #include namespace Ripes { bool isExecutable(const QString &path, const QStringList &dummyArgs) { +#ifdef RIPES_WITH_QPROCESS QProcess process; process.start(path, dummyArgs); process.waitForFinished(); return (process.error() != QProcess::FailedToStart); +#else + return false; +#endif } } // namespace Ripes diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1f71a0732..4f2c85aff 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.9) -find_package(Qt5Test REQUIRED) +find_package(Qt6 COMPONENTS Test REQUIRED) # Point to bundled tests within source directory set(RISCV32_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/riscv-tests) @@ -16,7 +16,7 @@ macro(create_qtest name) add_executable(${name} ${name}.cpp programloader.h) add_test(${name} ${name}) target_include_directories (${name} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) - target_link_libraries(${name} Qt5::Core Qt5::Widgets Qt5::Test) + target_link_libraries(${name} Qt6::Core Qt6::Widgets Qt6::Test) target_link_libraries(${name} ripes_lib) endmacro()