Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to Qt6 #110

Merged
merged 5 commits into from
Oct 10, 2024
Merged
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
31 changes: 18 additions & 13 deletions .github/workflows/laigter-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,28 @@ jobs:

steps:
- name: checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: add build dependencies
- name: Install Dependencies
shell: bash
run: |
apt update
apt install -y software-properties-common clang make wget libomp-dev
add-apt-repository ppa:beineri/opt-qt-5.15.2-focal
apt-get update
apt install -y qt515base qt515x11extras qt515tools libgl1-mesa-dev qt515imageformats

- name: build Laigter
apt-get update && apt-get install -y sudo p7zip-full wget file
sudo ln -fs /usr/share/zoneinfo/UTC /etc/localtime
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends software-properties-common

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.0'
arch: 'linux_gcc_64'
extra: '--external 7z'
modules: 'qtimageformats'

- name: Build Laigter
shell: bash
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
source /opt/qt*/bin/qt*-env.sh || true
export CXX=clang++
/opt/qt515/bin/qmake -spec linux-clang CONFIG+=release PREFIX=/usr
qmake CONFIG+=release PREFIX=/usr
make -j$(nproc)
make INSTALL_ROOT=appdir install
find appdir/
Expand All @@ -37,7 +42,7 @@ jobs:
./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -extra-plugins=imageformats -appimage -verbose=2

- name: upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-artifact
path: Laigter-x86_64.AppImage
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/laigter-mac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ jobs:
runs-on: macOS-latest
steps:
- name: checkout sources
uses: actions/checkout@v2
- name: setup Homebrew
shell: bash
run: |
rm /usr/local/bin/2to3*
export HOMEBREW_NO_AUTO_UPDATE=1 && export HOMEBREW_NO_INSTALL_CLEANUP=1 && brew update
HOMEBREW_VERBOSE_USING_DOTS=1 brew reinstall --verbose qt@5
brew link qt@5 --force
uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.8.0'
extra: '--external 7z'
arch: 'clang_64'
modules: 'qtimageformats'

- name: build Laigter
shell: bash
run: |
export PATH="/usr/local/opt/qt@5/bin:$PATH"
qmake CONFIG+=release PREFIX=/usr
make -j$(nproc)
make INSTALL_ROOT=appdir install
Expand All @@ -29,7 +30,7 @@ jobs:
zip -r laigter-mac.zip laigter.app

- name: upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: mac-artifacts
path: laigter-mac.zip
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/laigter-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ jobs:
steps:

- name: checkout sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install Qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
modules: 'imageformats'
arch: win64_mingw81
aqtversion: '==3.1.*'
version: '6.2.0'
arch: 'win64_mingw81'
extra: '--external 7z'
target: 'desktop'
host: 'windows'
modules: 'qtimageformats'

- name: Build Laigter
shell: cmd
Expand All @@ -30,7 +33,7 @@ jobs:
tar.exe -a -c -f laigter-windows.zip laigter-windows

- name: upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: mac-artifacts
path: laigter-windows.zip
Expand Down
4 changes: 2 additions & 2 deletions gui/language_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <QTextStream>
#include <QFile>
#include <QStandardPaths>
#include <QTextCodec>
#include <QStringConverter>

LanguageSelector::LanguageSelector(QWidget *parent)
: QDialog(parent), ui(new Ui::LanguageSelector)
Expand All @@ -14,7 +14,7 @@ LanguageSelector::LanguageSelector(QWidget *parent)
if (f.open(QIODevice::ReadOnly))
{
QTextStream in(&f);
in.setCodec( QTextCodec::codecForName( "UTF-8" ) );
in.setEncoding( QStringConverter::Utf8 );
while (!in.atEnd())
{
QStringList line = in.readLine().split("\t");
Expand Down
6 changes: 3 additions & 3 deletions gui/presets_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <QFileDialog>
#include <QMessageBox>
#include <QStandardPaths>
#include <QTextCodec>
#include <QStringConverter>
#include <QThread>

static QString presetCodes[30] = {"EnhanceHeight ",
Expand Down Expand Up @@ -161,7 +161,7 @@ void PresetsManager::on_pushButtonSavePreset_clicked()
if (preset.open(QIODevice::WriteOnly))
{
QTextStream in(&preset);
in.setCodec(QTextCodec::codecForName("UTF-8"));
in.setEncoding(QStringConverter::Utf8);
in << "[Laigter Preset]";
bool saveLights = false;
QTreeWidgetItemIterator it(ui->treeWidget);
Expand Down Expand Up @@ -519,7 +519,7 @@ void PresetsManager::SaveAllPresets(ImageProcessor *p, QString path)
{
QTextStream in(&preset);
in << "[Laigter Preset]";
in.setCodec(QTextCodec::codecForName("UTF-8"));
in.setEncoding(QStringConverter::Utf8);
for (int i = 0; i < 30; i++)
{
in << "\n"
Expand Down
Loading
Loading