Merge branch 'master' into cmake

This commit is contained in:
Uwe Rathmann 2024-01-09 09:30:39 +01:00
commit 4b2f344531
19 changed files with 88 additions and 44 deletions

View File

@ -341,7 +341,7 @@ jobs:
version: "6.5.0" version: "6.5.0"
target: "desktop" target: "desktop"
install-deps: "true" install-deps: "true"
modules: "qtwebengine" modules: "qtwebengine qtshadertools"
cached: ${{ steps.cache-qt-6-2.outputs.cache-hit }} cached: ${{ steps.cache-qt-6-2.outputs.cache-hit }}
setup-python: "false" setup-python: "false"
tools: "" tools: ""
@ -432,22 +432,22 @@ jobs:
killall iotdashboard killall iotdashboard
killall Xvfb killall Xvfb
- name: Configure ( CMake Integration Test ) #- name: Configure ( CMake Integration Test )
shell: bash # shell: bash
run: | # run: |
mkdir qskinny_build_test # mkdir qskinny_build_test
cmake \ # cmake \
-S qskinny_source/examples/iotdashboard_smoketest \ # -S qskinny_source/examples/iotdashboard_smoketest \
-B qskinny_build_test \ # -B qskinny_build_test \
-G "${{ matrix.config.generators }}" \ # -G "${{ matrix.config.generators }}" \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ # -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DCMAKE_PREFIX_PATH:PATH="${{ matrix.config.cmake.qtprefixpath }}" \ # -DCMAKE_PREFIX_PATH:PATH="${{ matrix.config.cmake.qtprefixpath }}" \
-D${{ matrix.config.cmake.qtdirkey }}:PATH="${{ matrix.config.cmake.qtdirvalue }}" \ # -D${{ matrix.config.cmake.qtdirkey }}:PATH="${{ matrix.config.cmake.qtdirvalue }}" \
-DQSkinny_DIR:PATH=$GITHUB_WORKSPACE/qskinny_install/lib/cmake/QSkinny # -DQSkinny_DIR:PATH=$GITHUB_WORKSPACE/qskinny_install/lib/cmake/QSkinny
#
- name: Build ( CMake Integration Test ) #- name: Build ( CMake Integration Test )
shell: bash # shell: bash
run: cmake --build qskinny_build_test --config ${{ matrix.config.build_type }} # run: cmake --build qskinny_build_test --config ${{ matrix.config.build_type }}
# - name: Pack # - name: Pack
# shell: bash # shell: bash

View File

@ -35,9 +35,11 @@ It might support all versions Qt >= 5.15, but you can rely on:
- current long term supported ( LTS ) version of Qt ( at the moment Qt 6.5.x ) - current long term supported ( LTS ) version of Qt ( at the moment Qt 6.5.x )
- current version of Qt - current version of Qt
On debian bullseye these packages need to be installed for Qt5: `build-essential cmake On Debian these packages need to be installed for Qt6: `build-essential cmake
qtbase5-dev qtbase5-private-dev qtdeclarative5-dev qtdeclarative5-private-dev libqt5svg5-dev`. qtbase6-dev qtbase6-private-dev qtdeclarative6-dev qtdeclarative6-private-dev libqt6svg-dev qt6-shadertools`
For Qt6 you need the corresponding packages. For Qt5 you need: `build-essential cmake
qtbase5-dev qtbase5-private-dev qtdeclarative5-dev qtdeclarative5-private-dev libqt5svg-dev`.
> Optional: When enabling the `hunspell` feature the following package needs to be installed: `libhunspell-dev` > Optional: When enabling the `hunspell` feature the following package needs to be installed: `libhunspell-dev`

View File

@ -15,6 +15,11 @@ macro(qsk_setup_Qt)
endif() endif()
find_package(QT "5.15" NAMES ${QSK_QT_VERSION} REQUIRED COMPONENTS Quick) find_package(QT "5.15" NAMES ${QSK_QT_VERSION} REQUIRED COMPONENTS Quick)
if(QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)
# we need the qsb tool for Qt6
find_package(Qt6 REQUIRED COMPONENTS ShaderTools)
endif()
if ( QT_FOUND ) if ( QT_FOUND )
# Would like to have a status message about where the Qt installation # Would like to have a status message about where the Qt installation

View File

@ -173,7 +173,9 @@ list(APPEND SOURCES
nodes/QskVertex.cpp nodes/QskVertex.cpp
) )
qt_add_resources(SOURCES nodes/shaders.qrc) if (QT_VERSION_MAJOR VERSION_LESS 6)
qt_add_resources(SOURCES nodes/shaders.qrc)
endif()
list(APPEND HEADERS list(APPEND HEADERS
controls/QskAbstractButton.h controls/QskAbstractButton.h
@ -473,6 +475,49 @@ if(BUILD_QSKDLL)
set_target_properties(${target} PROPERTIES DEFINE_SYMBOL QSK_MAKEDLL) set_target_properties(${target} PROPERTIES DEFINE_SYMBOL QSK_MAKEDLL)
endif() endif()
if (QT_VERSION_MAJOR VERSION_GREATER_EQUAL 6)
qt6_add_shaders(${target} "qskshaders"
BATCHABLE
PRECOMPILE
#OPTIMIZED
QUIET
PREFIX
"/qskinny/shaders"
FILES
nodes/shaders/arcshadow-vulkan.vert
nodes/shaders/arcshadow-vulkan.frag
nodes/shaders/boxshadow-vulkan.vert
nodes/shaders/boxshadow-vulkan.frag
nodes/shaders/crisplines-vulkan.vert
nodes/shaders/crisplines-vulkan.frag
nodes/shaders/gradientconic-vulkan.vert
nodes/shaders/gradientconic-vulkan.frag
nodes/shaders/gradientlinear-vulkan.vert
nodes/shaders/gradientlinear-vulkan.frag
nodes/shaders/gradientradial-vulkan.vert
nodes/shaders/gradientradial-vulkan.frag
OUTPUTS
arcshadow.vert.qsb
arcshadow.frag.qsb
boxshadow.vert.qsb
boxshadow.frag.qsb
crisplines.vert.qsb
crisplines.frag.qsb
gradientconic.vert.qsb
gradientconic.frag.qsb
gradientlinear.vert.qsb
gradientlinear.frag.qsb
gradientradial.vert.qsb
gradientradial.frag.qsb
)
endif()
target_include_directories(${target} PUBLIC target_include_directories(${target} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/common> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/common>
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/controls> $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/controls>

View File

@ -416,6 +416,20 @@ void QskWindow::keyReleaseEvent( QKeyEvent* event )
void QskWindow::exposeEvent( QExposeEvent* event ) void QskWindow::exposeEvent( QExposeEvent* event )
{ {
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
if ( qskRenderingHardwareInterface( this ) )
{
/*
Actually our code supports Qt5 RHI ( f9c08c34fb2cc64546bbe6ce9d359f416e934961 ),
but Qt5 does not come with the qsb tool out of the box. Then we run into
problems with compiling the shader code from the makefiles.
But why should anyone use the experimental Qt5 RHI implementations
instead of using Qt6 ...
*/
qFatal( "the experimental Qt5 RHI implementation is not supported:\n"
"\tuse Qt6 or run the default OpenGL backend." );
}
#endif
ensureFocus( Qt::OtherFocusReason ); ensureFocus( Qt::OtherFocusReason );
layoutItems(); layoutItems();

View File

@ -2,33 +2,21 @@
<RCC version="1.0"> <RCC version="1.0">
<qresource prefix="/qskinny/"> <qresource prefix="/qskinny/">
<file>shaders/arcshadow.frag</file>
<file>shaders/arcshadow.vert</file> <file>shaders/arcshadow.vert</file>
<file>shaders/arcshadow.frag.qsb</file> <file>shaders/arcshadow.frag</file>
<file>shaders/arcshadow.vert.qsb</file>
<file>shaders/boxshadow.vert.qsb</file>
<file>shaders/boxshadow.frag.qsb</file>
<file>shaders/boxshadow.vert</file> <file>shaders/boxshadow.vert</file>
<file>shaders/boxshadow.frag</file> <file>shaders/boxshadow.frag</file>
<file>shaders/gradientconic.vert.qsb</file>
<file>shaders/gradientconic.frag.qsb</file>
<file>shaders/gradientconic.vert</file> <file>shaders/gradientconic.vert</file>
<file>shaders/gradientconic.frag</file> <file>shaders/gradientconic.frag</file>
<file>shaders/gradientradial.vert.qsb</file>
<file>shaders/gradientradial.frag.qsb</file>
<file>shaders/gradientradial.vert</file> <file>shaders/gradientradial.vert</file>
<file>shaders/gradientradial.frag</file> <file>shaders/gradientradial.frag</file>
<file>shaders/gradientlinear.vert.qsb</file>
<file>shaders/gradientlinear.frag.qsb</file>
<file>shaders/gradientlinear.vert</file> <file>shaders/gradientlinear.vert</file>
<file>shaders/gradientlinear.frag</file> <file>shaders/gradientlinear.frag</file>
<file>shaders/crisplines.vert.qsb</file>
<file>shaders/crisplines.frag.qsb</file>
<file>shaders/crisplines.vert</file> <file>shaders/crisplines.vert</file>
</qresource> </qresource>

Binary file not shown.

Binary file not shown.

View File

@ -1,10 +0,0 @@
#! /bin/sh
function qsbcompile {
qsbfile=`echo $1 | sed 's/-vulkan//'`
qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -o ${qsbfile}.qsb $1
# qsb --qt6 -b -o ${qsbfile}.qsb $1
}
qsbcompile arcshadow-vulkan.vert
qsbcompile arcshadow-vulkan.frag

Binary file not shown.

Binary file not shown.