Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 24 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,18 @@ Above blog posts contains step by step tutorial on how to do that for Qt5 versio
### qmake
All you need to do is to follow these steps.

1. Add SCodes as submodule, by typing `git submodule add git@github.com:scytheStudio/SCodes.git`
1. Add SCodes as submodule, by typing `git submodule add git@github.com:somcosoftware/SCodes.git`
2. Update submodule `git submodule update --recursive --init` (you can also put wrapper files to your project manually without adding submodule)
3. Add `include(scodes/src/SCodes.pri)` to your .pro file
4. If you want to use barcode reader functionality you need to register `SBarcodeFilter` class for Qt5 or `SBarcodeScanner` class for Qt6. For both version, separate them with if directive to register as we did in barcode reader example([how to register reader class](#register-reader)). As for barcode generator functionality you just need to register `SBarcodeGenerator` class([how to register generator class](#register-generator)).
5. Import SCodes in your Qml file `import com.scythestudio.scodes 1.0`
5. Import SCodes in your Qml file `import com.somcosoftware.scodes 1.0`
6. Import multimedia module `import QtMultimedia 5.15` for Qt5 or `import QtMultimedia` for Qt6.
7. If build fails, try to add `CONFIG += c++17` to your .pro file
8. You are done. Get inspired by [Qt5 QML Barcode Reader demo](https://github.com/scytheStudio/SCodes/blob/master/examples/QmlBarcodeReader/qml/Qt5ScannerPage.qml) or [Qt6 QML Barcode Reader demo](https://github.com/scytheStudio/SCodes/blob/master/examples/QmlBarcodeReader/qml/Qt6ScannerPage.qml) to test wrapper.
8. You are done. Get inspired by [Qt5 QML Barcode Reader demo](https://github.com/somcosoftware/SCodes/blob/master/examples/QmlBarcodeApp/qml/Qt5ScannerPage.qml) or [Qt6 QML Barcode Reader demo](https://github.com/somcosoftware/SCodes/blob/master/examples/QmlBarcodeApp/qml/Qt6ScannerPage.qml) to test wrapper.

### CMake

1. Add SCodes as submodule, by typing `git submodule add git@gitlab.com:scythestudio/scodes.git`
1. Add SCodes as submodule, by typing `git submodule add git@gitlab.com:somcosoftware/scodes.git`
2. Update submodule `git submodule update --recursive --init` (you can also put wrapper files to your project manually without adding submodule)
3. Add to your project SCodes library

Expand All @@ -88,27 +88,27 @@ All you need to do is to follow these steps.
5. Import SCodes in your Qml file

```qml
import com.scythestudio.scodes 1.0
import com.somcosoftware.scodes 1.0
```

6. You are done. Get inspired by [QML Barcode Reader demo](https://github.com/scytheStudio/SCodes/blob/master/examples/QmlBarcodeReader/qml/ScannerPage.qml) to test wrapper.
6. You are done. Get inspired by [QML Barcode Reader demo](https://github.com/somcosoftware/SCodes/blob/master/examples/QmlBarcodeApp/qml/ScannerPage.qml) to test wrapper.

<a name="register-reader"></a>
### How to do
Registering the barcode reader classes with if directive:

```c++
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qmlRegisterType<SBarcodeFilter>("com.scythestudio.scodes", 1, 0, "SBarcodeScanner");
qmlRegisterType<SBarcodeFilter>("com.somcosoftware.scodes", 1, 0, "SBarcodeScanner");
#else
qmlRegisterType<SBarcodeScanner>("com.scythestudio.scodes", 1, 0, "SBarcodeScanner");
qmlRegisterType<SBarcodeScanner>("com.somcosoftware.scodes", 1, 0, "SBarcodeScanner");
#endif
```
<a name="register-generator"></a>
Registering the barcode generator class with associated enum:
```c++
qmlRegisterType<SBarcodeGenerator>("com.scythestudio.scodes", 1, 0, "SBarcodeGenerator");
qmlRegisterUncreatableMetaObject(SCodes::staticMetaObject, "com.scythestudio.scodes", 1, 0, "SCodes", "Error: only enums");
qmlRegisterType<SBarcodeGenerator>("com.somcosoftware.scodes", 1, 0, "SBarcodeGenerator");
qmlRegisterUncreatableMetaObject(SCodes::staticMetaObject, "com.somcosoftware.scodes", 1, 0, "SCodes", "Error: only enums");
```

<a name="porting"></a>
Expand All @@ -118,7 +118,7 @@ Qt's multimedia library has major changes. The most importants are, changes in Q

SCodes library is using `SBarcodeFilter` class for Qt5 and `SBarcodesScanner` class for Qt6 version.

If you want to read more about implementation details of the library in Qt6 read the document: [Implementation Details in Qt6](https://github.com/scytheStudio/SCodes/blob/master/doc/detailsQt6.md)
If you want to read more about implementation details of the library in Qt6 read the document: [Implementation Details in Qt6](https://github.com/somcosoftware/SCodes/blob/master/doc/detailsQt6.md)


### Trying various formats
Expand All @@ -131,7 +131,7 @@ Component.onCompleted: {
barcodeFilter.format = SCodes.OneDCodes
}
```
See the enumeration values that represent supported formats in [SBarcodeFormat.h](https://github.com/scytheStudio/SCodes/blob/master/src/SBarcodeFormat.h)
See the enumeration values that represent supported formats in [SBarcodeFormat.h](https://github.com/somcosoftware/SCodes/blob/master/src/SBarcodeFormat.h)
To accept all supported formats use `SCodes.Any`.

## Note
Expand All @@ -145,63 +145,56 @@ Both build systems have their examples located in same directory. All you need t

| PROJECT | BUILD SYSTEM | WINDOWS-MinGW | WINDOWS-MSVC | LINUX-GCC | ANDROID |
| ------ | ------ | ------ | ------ | ------ | ------ |
| QmlBarcodeReader | qmake |<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|
| QmlBarcodeGenerator | qmake |<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|
| QmlBarcodeReader | CMake |<center>❌</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|
| QmlBarcodeGenerator | CMake |<center>❌</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|
| QmlBarcodeApp | qmake |<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|
| QmlBarcodeApp | CMake |<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|

#### Qt6.3.0,

| PROJECT | BUILD SYSTEM | WINDOWS-MinGW | WINDOWS-MSVC | LINUX-GCC | ANDROID |
| ------ | ------ | ------ | ------ | ------ | ------ |
| QmlBarcodeReader | qmake |<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|
| QmlBarcodeGenerator | qmake |<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|
| QmlBarcodeReader | CMake |<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|
| QmlBarcodeGenerator | CMake |<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|
| QmlBarcodeApp | qmake |<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|
| QmlBarcodeApp | CMake |<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|<center>✔️</center>|

Please ensure that proper Java & NDK version installed on your system. This examples tested w/ Java 11 and 22.1.7171670 Android NDK version.

## About Somco Software (previously Scythe Studio)
We’re a team of **Qt and C++ enthusiasts** dedicated to helping businesses build great cross-platform applications. As an official Qt Service Partner, we’ve earned the trust of companies across various industries by delivering high-quality, reliable solutions. With years of experience in **Qt and QML development**, we know how to turn ambitious ideas into outstanding products.
## About Somco Software
[Somco Software](https://somcosoftware.com/en/) (previously Scythe Studio) is an embedded and cross-platform software development company with a strong focus on Qt and C++, delivering reliable, high-quality solutions for regulated industries, with particular expertise in medical devices. We are an ISO 9001 and ISO 13485 certified software house, specializing in GUI development, Linux-based systems, and advanced connectivity solutions. Somco Software is an official Qt Service Partner and a trusted partner of leading hardware manufacturers.

<table style="margin: 0 auto; border:0;">
<tr style="border:0">
<td style="border:0">
<a href="https://somcosoftware.com/">
<img width="340" height="150"
src="./assets/Qt-service-partner-badge.png">
<img src="./assets/Qt-service-partner-badge.png">
</a>
</td>
<td style="border:0">
<a href="https://clutch.co/profile/scythe-studio">
<a href="https://clutch.co/profile/somco-software">
<img height="150" width="150"
src="https://github.com/user-attachments/assets/023e102e-84c1-4e7e-b9de-cae476e681e7">
</a>
</td>
<td style="border:0">
<a href="https://somcosoftware.com/en/iso">
<img src="./assets/iso 13485.png">
<img src="./assets/iso 13485.png" style="background: #031813;">
</a>
</td>
<td style="border:0">
<a href="https://somcosoftware.com/en/iso">
<img src="./assets/iso 9001.png">
<img src="./assets/iso 9001.png" style="background: #031813;">
</a>
</td>
</tr>
</table>

We offer a wide range of services—from brainstorming ideas to delivering polished applications—always tailored to our clients’ needs. By combining deep knowledge of Qt modules and modern technologies with a practical, cost-effective approach, we create solutions that truly make a difference.
We support projects from design to delivery, offering UX/UI design, custom Yocto Linux images, and development in Qt as well as LVGL and TouchGFX. We also help with software modernization, training, and technical consulting. With a practical, developer-focused approach, we build efficient, reliable solutions that fit real project needs.

## Professional Support
Need help with anything? We’ve got you covered. Our professional support services are here to assist you with. For more details about support options and pricing, just drop us a line at https://somcosoftware.com/en/contact.

## Follow us

Check out those links if you want to see Somco Software in action and follow the newest trends saying about Qt Qml development.

* 🌐 [Somco Software Website](https://somcosoftware.com/en/)
* ✍️ [Somco Software Blog Website](https://somcosoftware.com/en/blog)
* 👔 [Somco Software LinkedIn Profile](https://www.linkedin.com/company/scythestudio/mycompany/)
* 👔 [Somco Software Facebook Page](https://www.facebook.com/ScytheStudiio)
* 👔 [Somco Software LinkedIn Profile](https://www.linkedin.com/company/somcosoftware)
* 🎥 [Somco Software Youtube Channel](https://www.youtube.com/channel/UCf4OHosddUYcfmLuGU9e-SQ/featured)
4 changes: 2 additions & 2 deletions doc/detailsQt6.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Implementation details in Qt 6
VideoOutput QML element has major changes and it is not possible to use same QML files for both version. If you want to implement barcode reader functionality for both version you need to create two separate QML file too(that's because of QML VideoOutput changes in multimedia module of Qt6). Check our [QmlBarcodeReader example](https://github.com/scytheStudio/SCodes/tree/master/examples/QmlBarcodeReader) for more details.
VideoOutput QML element has major changes and it is not possible to use same QML files for both version. If you want to implement barcode reader functionality for both version you need to create two separate QML file too(that's because of QML VideoOutput changes in multimedia module of Qt6). Check our [QmlBarcodeApp example](https://github.com/somcosoftware/SCodes/tree/master/examples/QmlBarcodeApp) for more details.

`SBarcodeFilter.cpp` and `SBarcodesScanner.cpp` files included/excluded according to the Qt version in the [SCodes CMakeLists file](https://github.com/scytheStudio/SCodes/blob/master/src/CMakeLists.txt). The idea of excluding the related class according to Qt version is prevent to get error from not existing libraries when you compile the project for Qt6(e.g. QVideoFilterRunnable, QAbstractVideoFilter). Likewise in Qt5 for QVideoSink.
`SBarcodeFilter.cpp` and `SBarcodesScanner.cpp` files included/excluded according to the Qt version in the [SCodes CMakeLists file](https://github.com/somcosoftware/SCodes/blob/master/src/CMakeLists.txt). The idea of excluding the related class according to Qt version is prevent to get error from not existing libraries when you compile the project for Qt6(e.g. QVideoFilterRunnable, QAbstractVideoFilter). Likewise in Qt5 for QVideoSink.

SBarcodeScanner class is inherited from QVideoSink class. It's initiated in 2 phases: First, the constructor sets up the connections to processing threads. Then, after QmlEngine sets up properties, `forwardVideoSink` and `camera`, a `componentComplete()` function is called that instantiates a default `QCamera` if none is set.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.16.3)

project(QmlBarcodeReader LANGUAGES CXX)
project(QmlBarcodeApp LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -13,6 +13,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
#Check this file for any *_DIR variable definitions and other
include("cmake/Locations.cmake")

set(SOURCES
ColorController.h
ColorController.cpp
VersionHelper.h
main.cpp
)

if(QT_VERSION_MAJOR EQUAL 5)
qt5_add_resources(RSCS Qt5qml.qrc)
else()
Expand All @@ -35,15 +42,15 @@ if(ANDROID)
${QT_ANDROID_PACKAGE_SOURCE_DIR}/gradlew
${QT_ANDROID_PACKAGE_SOURCE_DIR}/res/values/libs.xml
)
add_library(${PROJECT_NAME} SHARED main.cpp ${RSCS} ${ANDROID_SOURCES})
add_library(${PROJECT_NAME} SHARED ${SOURCES} ${RSCS} ${ANDROID_SOURCES})
else()
qt_add_executable(${PROJECT_NAME} MANUAL_FINALIZATION main.cpp ${RSCS})
qt_add_executable(${PROJECT_NAME} MANUAL_FINALIZATION ${SOURCES} ${RSCS})
set_target_properties(${PROJECT_NAME} PROPERTIES
QT_ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android"
)
endif()
else()
add_executable(${PROJECT_NAME} main.cpp ${RSCS})
add_executable(${PROJECT_NAME} ${SOURCES} ${RSCS})
endif()

target_link_libraries(${PROJECT_NAME} PRIVATE ${REQUIRED_QT_LIBS} SCodes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ CONFIG += c++17

DEFINES += QT_DEPRECATED_WARNINGS

HEADERS += \
ColorController.h \
VersionHelper.h

SOURCES += \
main.cpp
main.cpp \
ColorController.cpp

equals(QT_MAJOR_VERSION, 6) {
RESOURCES += Qt6qml.qrc
Expand Down
20 changes: 20 additions & 0 deletions examples/QmlBarcodeApp/Qt5qml.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<RCC>
<qresource prefix="/">
<file>qml/Qt5ScannerPage.qml</file>
<file>qml/ScannerOverlay.qml</file>
<file>qml/Theme.qml</file>
<file>qml/main.qml</file>
<file>qml/GeneratorPage.qml</file>
<file>qml/CButton.qml</file>
<file>qml/CTextField.qml</file>
<file>qml/CComboBox.qml</file>
<file>icons/logo.png</file>
<file>qml/CTabButton.qml</file>
<file>qml/Subtrack.qml</file>
<file>icons/close.svg</file>
<file>icons/download.svg</file>
<file>icons/obraz.png</file>
<file>icons/arrow_drop_down.svg</file>
<file>icons/check.svg</file>
</qresource>
</RCC>
20 changes: 20 additions & 0 deletions examples/QmlBarcodeApp/Qt6qml.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<RCC>
<qresource prefix="/">
<file>qml/Qt6ScannerPage.qml</file>
<file>qml/ScannerOverlay.qml</file>
<file>qml/Theme.qml</file>
<file>qml/GeneratorPage.qml</file>
<file>qml/CButton.qml</file>
<file>qml/CTextField.qml</file>
<file>qml/CComboBox.qml</file>
<file>icons/logo.png</file>
<file>icons/arrow_drop_down.svg</file>
<file>icons/check.svg</file>
<file>icons/close.svg</file>
<file>icons/download.svg</file>
<file>icons/obraz.png</file>
<file>qml/CTabButton.qml</file>
<file>qml/Subtrack.qml</file>
<file>qml/main.qml</file>
</qresource>
</RCC>
21 changes: 21 additions & 0 deletions examples/QmlBarcodeApp/VersionHelper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#include <QObject>
#include <QtGlobal>

class VersionHelper : public QObject
{
Q_OBJECT
Q_PROPERTY(bool isQt6 READ isQt6 CONSTANT)

public:
explicit VersionHelper(QObject *parent = nullptr) : QObject(parent) {}

inline bool isQt6() const {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return true;
#else
return false;
#endif
}
};
Loading