Skip to content

Commit

Permalink
Develop (#71)
Browse files Browse the repository at this point in the history
* add option to build or not encoding and decoding

* passed qmllint

* look for cmake 3.24

* build doc on tags

* fix exporting targets for findpackage (#69)

* used latest actions (#70)
  • Loading branch information
EddyTheCo authored Feb 8, 2024
1 parent b0293ff commit 4e96a58
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 37 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: build-docs
run-name: ${{ github.actor }} ${{ github.event_name }} to ${{ github.base_ref }}
on:
pull_request_target:
types: [closed]
branches: [main]
push:
tags:
- 'v*'
jobs:
build_doxygen:
uses: EddyTheCo/Common/.github/workflows/build-docs.yml@v0.1.1
if: ${{ (github.event.pull_request.merged == true) && (startsWith(github.base_ref, 'main')) }}
uses: EddyTheCo/Common/.github/workflows/build-docs.yml@v0.1.2
permissions:
pages: write
id-token: write
10 changes: 3 additions & 7 deletions .github/workflows/build-test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ jobs:
matrix:
os: [ubuntu-latest,macos-latest,windows-latest]

uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@v0.1.1
uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@v0.1.2
permissions:
contents: write
with:
os: ${{ matrix.os }}
sharedLib: true
qtVersion: '6.6.0'
qtModules: 'qtshadertools qtmultimedia'
test: false
Expand All @@ -32,14 +31,11 @@ jobs:

steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R

- name: Releases
uses: softprops/action-gh-release@v1
with:
Expand Down
20 changes: 12 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.11 FATAL_ERROR)

cmake_minimum_required(VERSION 3.24)
option(BUILD_QRDEC "Build Decoding part" ON)
option(BUILD_QRENC "Build Encoding part" ON)
include(${CMAKE_CURRENT_BINARY_DIR}/local_conf.cmake OPTIONAL)

include(FetchContent)
Expand All @@ -22,23 +23,26 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
include(GNUInstallDirs)

add_subdirectory(QrDec)
add_subdirectory(QrGen)
if(BUILD_QRDEC)
add_subdirectory(QrDec)
endif(BUILD_QRDEC)
if(BUILD_QRENC)
add_subdirectory(QrGen)
endif(BUILD_QRENC)
add_subdirectory(QtQrDec)
add_subdirectory(QtQrGen)



install(EXPORT ${PROJECT_NAME}-config
FILE ${PROJECT_NAME}-config.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Esterv
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
NAMESPACE ${PROJECT_NAME}::
COMPONENT ${PROJECT_NAME}
)
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Esterv
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
Expand All @@ -48,7 +52,7 @@ write_basic_package_version_file(
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Esterv
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
export(EXPORT ${PROJECT_NAME}-config
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
Expand Down
2 changes: 1 addition & 1 deletion Config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Svg OPTIONAL_COMPONENTS Multimedia )
find_dependency(OpenCV REQUIRED COMPONENTS core objdetect imgproc flann features2d calib3d )
find_dependency(OpenCV COMPONENTS core objdetect imgproc flann features2d calib3d )
find_dependency(EstervDesigns 1.1 COMPONENTS SimpleStyle CustomControls CONFIG)
include ( "${CMAKE_CURRENT_LIST_DIR}/qrCode-config.cmake" )
2 changes: 1 addition & 1 deletion QrDec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if(NOT OpenCV_FOUND AND OpenCV_DOWNLOAD)
if(OpenCV_FOUND AND NOT ANDROID AND NOT EMSCRIPTEN)
install(IMPORTED_RUNTIME_ARTIFACTS ${OpenCV_LIBS}
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT Qr
COMPONENT QrDec
)
endif()
endif()
Expand Down
3 changes: 0 additions & 3 deletions QtQrDec/qml/QrCam.qml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import QtQuick 2.0
import QtQuick.Controls
import QtQuick.Layouts
import Esterv.Styles.Simple

import Esterv.CustomControls.QrDec
Image
{
Expand Down
1 change: 0 additions & 1 deletion QtQrDec/qml/QrDecPop.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import QtQuick 2.0
import QtQuick.Controls
import Esterv.Styles.Simple
import Esterv.CustomControls.QrDec
import Esterv.CustomControls

Expand Down
3 changes: 1 addition & 2 deletions QtQrDec/qml/QrTextField.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import QtQuick 2.0
import QtQuick.Controls
import QtQuick.Layouts
import Esterv.Styles.Simple
import Esterv.CustomControls.QrDec

Expand All @@ -24,7 +23,7 @@ TextField

Rectangle {
id:qricon
height:Math.min(parent.height,font.pixelSize)
height:Math.min(parent.height,control.font.pixelSize)
width:height
anchors.right: parent.right
anchors.verticalCenter: control.verticalCenter
Expand Down
4 changes: 2 additions & 2 deletions QtQrGen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
find_package(Qt6 COMPONENTS Core Gui Qml Quick OPTIONAL_COMPONENTS Svg)

if (Qt6_FOUND)
if (Qt6_FOUND AND TARGET QrGen)
qt_standard_project_setup()
qt6_add_qml_module(QtQrGen
URI Esterv.CustomControls.QrGen
Expand Down Expand Up @@ -73,4 +73,4 @@ install(TARGETS QtQrGenplugin
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
add_subdirectory(examples)
endif(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
endif(Qt6_FOUND)
endif(Qt6_FOUND AND TARGET QrGen)
8 changes: 3 additions & 5 deletions QtQrGen/qml/QrGenImage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ Control
required property string textData
implicitWidth: 100
implicitHeight: 100
background: Rectangle {
radius: Math.min(width,height)*0.8*Style.roundedScale/Style.Scale.Full
color:Style.backColor3
}


Image {
id:img
anchors.centerIn:parent
sourceSize.width: Math.min(control.width,control.height)-control.background.radius-10
sourceSize.width: Math.min(control.width,control.height)-30
source: "image://qrcode/"+Style.frontColor1+"/"+control.textData
}
}
4 changes: 3 additions & 1 deletion QtQrGen/qml/QrGenPop.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Esterv.Styles.Simple
Popup {
id: control
required property string textData;
property bool showClose:true;
property bool showClose:false;

ColumnLayout
{
Expand Down Expand Up @@ -57,13 +57,15 @@ Popup {
}
visible:showdata.checked
}

QrGenImage
{
id:qrgenimage
textData:control.textData
visible:!tex.visible
Layout.fillHeight: true
Layout.fillWidth: true
Layout.margins: 0
}

}
Expand Down
2 changes: 1 addition & 1 deletion QtQrGen/qml/QrText.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Text

Rectangle {
id:qricon
height:Math.min(parent.height,font.pixelSize)
height:Math.min(parent.height,control.font.pixelSize)
width:height
x: parent.contentWidth
color: "transparent"
Expand Down

0 comments on commit 4e96a58

Please sign in to comment.