Skip to content

Commit 55ef7cb

Browse files
authored
Merge pull request #911 from Swordfish90/feature/qt6
Migrate to Qt6
2 parents f157648 + 77434e4 commit 55ef7cb

230 files changed

Lines changed: 3762 additions & 2131 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/appimage.yml

Lines changed: 0 additions & 98 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build AppImage
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
jobs:
11+
build-appimage:
12+
name: Build (Linux, AppImage)
13+
runs-on: ubuntu-22.04
14+
permissions:
15+
contents: read
16+
id-token: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Install build deps
23+
run: |
24+
sudo apt update
25+
sudo apt install -y build-essential rsync wget
26+
27+
- name: Install Qt
28+
uses: jurplel/install-qt-action@v4
29+
with:
30+
version: 6.10.0
31+
dir: ..
32+
modules: qtshadertools
33+
setup-python: false
34+
cache: true
35+
36+
- name: Build AppImage
37+
run: |
38+
./scripts/build-appimage.sh
39+
40+
- name: Collect artifact
41+
run: |
42+
mkdir -p release
43+
mv ./*.AppImage release/
44+
45+
- name: Attestation
46+
uses: actions/attest-build-provenance@v1
47+
with:
48+
subject-path: ./release/*
49+
50+
- name: Upload artifact
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: cool-retro-term-appimage
54+
path: ./release/*

.github/workflows/build-dmg.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build DMG
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
jobs:
11+
build-dmg:
12+
name: Build (macOS, DMG)
13+
runs-on: macos-14
14+
permissions:
15+
contents: read
16+
id-token: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: recursive
21+
22+
- name: Install Qt
23+
uses: jurplel/install-qt-action@v4
24+
with:
25+
version: 6.10.*
26+
modules: qtshadertools
27+
setup-python: true
28+
python-version: '3.11'
29+
cache: true
30+
31+
- name: Build DMG
32+
run: |
33+
JOBS="$(sysctl -n hw.ncpu)"
34+
./scripts/build-dmg.sh
35+
36+
- name: Collect artifact
37+
run: |
38+
mkdir -p release
39+
mv ./*.dmg release/
40+
41+
- name: Attestation
42+
uses: actions/attest-build-provenance@v1
43+
with:
44+
subject-path: ./release/*
45+
46+
- name: Upload artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: cool-retro-term-dmg
50+
path: ./release/*

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,17 @@ Makefile*
4141
*.json
4242

4343
# Excludes compiled files
44+
4445
imports
4546
cool-retro-term
47+
build
48+
49+
# Linux
50+
51+
*.AppImage
4652

4753
# Mac OSX
4854

4955
.DS_Store
5056
*.app
57+
*.dmg

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
path = qmltermwidget
33
url = https://github.com/Swordfish90/qmltermwidget
44
branch = unstable
5+
[submodule "KDSingleApplication"]
6+
path = KDSingleApplication
7+
url = https://github.com/KDAB/KDSingleApplication.git

.travis.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

KDSingleApplication

Submodule KDSingleApplication added at 1848dd6

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ It has been designed to be eye-candy, customizable, and reasonably lightweight.
1010

1111
It uses the QML port of qtermwidget (Konsole): https://github.com/Swordfish90/qmltermwidget.
1212

13-
This terminal emulator works under Linux and macOS and requires Qt5. It's suggested that you stick to the latest LTS version.
13+
This terminal emulator works under Linux and macOS and requires Qt6.
1414

1515
Settings such as colors, fonts, and effects can be accessed via context menu.
1616

app/app.pro

Lines changed: 83 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,99 @@
11
QT += qml quick widgets sql quickcontrols2
2-
TARGET = cool-retro-term
2+
TARGET = cool-retro-term
3+
APP_VERSION = $$system(git -C $$PWD/.. describe --tags --always --dirty=-dirty)
4+
isEmpty(APP_VERSION): APP_VERSION = "unknown"
5+
DEFINES += APP_VERSION=\\\"$$APP_VERSION\\\"
6+
7+
# TODO: When migrating to CMake, use KDSingleApplication's CMakeLists.txt instead of these manual sources.
8+
INCLUDEPATH += $$PWD/../KDSingleApplication/src
9+
HEADERS += \
10+
$$PWD/../KDSingleApplication/src/kdsingleapplication.h \
11+
$$PWD/../KDSingleApplication/src/kdsingleapplication_lib.h \
12+
$$PWD/../KDSingleApplication/src/kdsingleapplication_localsocket_p.h
13+
SOURCES += \
14+
$$PWD/../KDSingleApplication/src/kdsingleapplication.cpp \
15+
$$PWD/../KDSingleApplication/src/kdsingleapplication_localsocket.cpp
16+
DEFINES += KDSINGLEAPPLICATION_STATIC_BUILD
317

418
DESTDIR = $$OUT_PWD/../
519

620
HEADERS += \
721
fileio.h \
8-
monospacefontmanager.h
22+
fontmanager.h \
23+
fontlistmodel.h
924

10-
SOURCES = main.cpp \
25+
SOURCES += main.cpp \
1126
fileio.cpp \
12-
monospacefontmanager.cpp
27+
fontmanager.cpp \
28+
fontlistmodel.cpp
1329

1430
macx:ICON = icons/crt.icns
1531

1632
RESOURCES += qml/resources.qrc
1733

34+
# Shader compilation (Qt Shader Baker)
35+
QSB_BIN = $$[QT_HOST_BINS]/qsb
36+
isEmpty(QSB_BIN): QSB_BIN = $$[QT_INSTALL_BINS]/qsb
37+
38+
SHADERS_DIR = $${_PRO_FILE_PWD_}/shaders
39+
SHADERS += $$files($$SHADERS_DIR/*.frag) $$files($$SHADERS_DIR/*.vert)
40+
SHADERS -= $$SHADERS_DIR/terminal_dynamic.frag
41+
SHADERS -= $$SHADERS_DIR/terminal_static.frag
42+
SHADERS -= $$SHADERS_DIR/passthrough.vert
43+
44+
qsb.input = SHADERS
45+
qsb.output = ../../app/shaders/${QMAKE_FILE_NAME}.qsb
46+
qsb.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
47+
qsb.clean = $$qsb.output
48+
qsb.name = qsb ${QMAKE_FILE_IN}
49+
qsb.variable_out = QSB_FILES
50+
QMAKE_EXTRA_COMPILERS += qsb
51+
PRE_TARGETDEPS += $$QSB_FILES
52+
OTHER_FILES += $$SHADERS $$QSB_FILES
53+
54+
DYNAMIC_SHADER = $$SHADERS_DIR/terminal_dynamic.frag
55+
STATIC_SHADER = $$SHADERS_DIR/terminal_static.frag
56+
57+
RASTER_MODES = 0 1 2 3 4
58+
BINARY_FLAGS = 0 1
59+
VARIANT_SHADER_DIR = $$relative_path($$PWD/shaders, $$OUT_PWD)
60+
VARIANT_OUTPUTS =
61+
62+
for(raster_mode, RASTER_MODES) {
63+
for(burn_in, BINARY_FLAGS) {
64+
for(display_frame, BINARY_FLAGS) {
65+
for(chroma_on, BINARY_FLAGS) {
66+
dynamic_variant = terminal_dynamic_raster$${raster_mode}_burn$${burn_in}_frame$${display_frame}_chroma$${chroma_on}
67+
dynamic_output = $${VARIANT_SHADER_DIR}/$${dynamic_variant}.frag.qsb
68+
dynamic_target = shader_variant_$${dynamic_variant}
69+
$${dynamic_target}.target = $${dynamic_output}
70+
$${dynamic_target}.depends = $$DYNAMIC_SHADER
71+
$${dynamic_target}.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -DCRT_RASTER_MODE=$${raster_mode} -DCRT_BURN_IN=$${burn_in} -DCRT_DISPLAY_FRAME=$${display_frame} -DCRT_CHROMA=$${chroma_on} -o $${dynamic_output} $$DYNAMIC_SHADER
72+
QMAKE_EXTRA_TARGETS += $${dynamic_target}
73+
VARIANT_OUTPUTS += $${dynamic_output}
74+
}
75+
}
76+
}
77+
}
78+
79+
for(rgb_shift, BINARY_FLAGS) {
80+
for(bloom_on, BINARY_FLAGS) {
81+
for(curve_on, BINARY_FLAGS) {
82+
for(shine_on, BINARY_FLAGS) {
83+
static_variant = terminal_static_rgb$${rgb_shift}_bloom$${bloom_on}_curve$${curve_on}_shine$${shine_on}
84+
static_output = $${VARIANT_SHADER_DIR}/$${static_variant}.frag.qsb
85+
static_target = shader_variant_$${static_variant}
86+
$${static_target}.target = $${static_output}
87+
$${static_target}.depends = $$STATIC_SHADER
88+
$${static_target}.commands = $$QSB_BIN --glsl \"100 es,120,150\" --hlsl 50 --msl 12 --qt6 -DCRT_RGB_SHIFT=$${rgb_shift} -DCRT_BLOOM=$${bloom_on} -DCRT_CURVATURE=$${curve_on} -DCRT_FRAME_SHININESS=$${shine_on} -o $${static_output} $$STATIC_SHADER
89+
QMAKE_EXTRA_TARGETS += $${static_target}
90+
VARIANT_OUTPUTS += $${static_output}
91+
}
92+
}
93+
}
94+
}
95+
PRE_TARGETDEPS += $${VARIANT_OUTPUTS}
96+
1897
#########################################
1998
## INTALLS
2099
#########################################

0 commit comments

Comments
 (0)