Skip to content

Commit

Permalink
CMake: Modify QRCode
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Oct 15, 2021
1 parent e5c4eb4 commit 36b31c5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 321 deletions.
10 changes: 0 additions & 10 deletions Plugin/App/QRCode/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
#QZXing库
OPTION(OPTION_RABBITIM_USE_QZXING "Use QZXing library" ON)
if(NOT OPTION_RABBITIM_USE_QZXING)
return()
endif()
FIND_PACKAGE(QZXing)
if(NOT QZXing_FOUND)
return()
endif()

PROJECT(QRCode)

SET(QT_COMPONENTS Multimedia Quick)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS ${QT_COMPONENTS})
if(Qt${QT_VERSION_MAJOR}_FOUND)
FOREACH(_COMPONENT ${QT_COMPONENTS})
list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::${_COMPONENT})
ENDFOREACH()
endif()

file(RELATIVE_PATH PLUGIN_RELATIVE_DIR ${CMAKE_SOURCE_DIR}/Plugin ${CMAKE_CURRENT_SOURCE_DIR})
if(NOT ANDROID)
set(PLUGIN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/plugins/${PLUGIN_RELATIVE_DIR})
Expand Down
245 changes: 0 additions & 245 deletions Plugin/App/QRCode/QRCode.cpp

This file was deleted.

64 changes: 0 additions & 64 deletions Plugin/App/QRCode/QRCode.h

This file was deleted.

12 changes: 11 additions & 1 deletion Src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif()

set(QT_COMPONENTS Multimedia)
set(QT_COMPONENTS Multimedia Quick)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS ${QT_COMPONENTS})
if(Qt${QT_VERSION_MAJOR}_FOUND)
FOREACH(_COMPONENT ${QT_COMPONENTS})
Expand All @@ -16,6 +16,16 @@ endif()

LIST(APPEND RABBITIM_LIBS RabbitCommon ${QT_LIBRARIES})

#QZXing库
OPTION(OPTION_RABBITIM_USE_QZXING "Use QZXing library" ON)
if(OPTION_RABBITIM_USE_QZXING)
FIND_PACKAGE(QZXing)
if(QZXing_FOUND)
LIST(APPEND RABBITIM_LIBS QZXing)
list(APPEND RABBITIM_DEFINES RABBITIM_USE_QZXING)
endif()
endif()

include(Files.cmake)

#资源
Expand Down
11 changes: 10 additions & 1 deletion Src/common/QRCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,18 @@ int CQRCode::ProcessQImage(QImage image, QString &szText)
QZXing::DecoderFormat_EAN_8 |
QZXing::DecoderFormat_EAN_13 |
QZXing::DecoderFormat_CODE_128 |
QZXing::DecoderFormat_CODE_93 |
QZXing::DecoderFormat_CODE_39 |
QZXing::DecoderFormat_ITF |
QZXing::DecoderFormat_Aztec);
QZXing::DecoderFormat_Aztec |
QZXing::DecoderFormat_CODABAR |
QZXing::DecoderFormat_MAXICODE |
QZXing::DecoderFormat_PDF_417 |
QZXing::DecoderFormat_RSS_14 |
QZXing::DecoderFormat_RSS_EXPANDED |
QZXing::DecoderFormat_UPC_EAN_EXTENSION |
QZXing::DecoderFormat_CODE_128_GS1
);
szMessage = decoder.decodeImage(image);
if(szMessage.isEmpty())
{
Expand Down

0 comments on commit 36b31c5

Please sign in to comment.