Skip to content

Commit

Permalink
Improvements (#67)
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
  • Loading branch information
EddyTheCo authored Jan 31, 2024
1 parent b0293ff commit 1ca5b31
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 24 deletions.
7 changes: 3 additions & 4 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')) }}
permissions:
pages: write
id-token: write
13 changes: 9 additions & 4 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,8 +23,12 @@ 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)

Expand Down
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 1ca5b31

Please sign in to comment.