mirror of
https://github.com/status-im/qzxing.git
synced 2025-02-19 14:24:28 +00:00
Update BarcodeEncoder to make use of Image Provider in order to display the image of the generated barcode to the QML viewe.
This commit is contained in:
parent
81b63588ae
commit
916903ed83
@ -6,7 +6,7 @@ DEPLOYMENTFOLDERS = folder_01
|
|||||||
# Additional import path used to resolve QML modules in Creator's code model
|
# Additional import path used to resolve QML modules in Creator's code model
|
||||||
QML_IMPORT_PATH =
|
QML_IMPORT_PATH =
|
||||||
|
|
||||||
CONFIG += gnu++11
|
#CONFIG += gnu++11
|
||||||
QMAKE_CXXFLAGS += -std=gnu++11
|
QMAKE_CXXFLAGS += -std=gnu++11
|
||||||
|
|
||||||
# The .cpp file which was generated for your project. Feel free to hack it.
|
# The .cpp file which was generated for your project. Feel free to hack it.
|
||||||
|
@ -9,6 +9,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QZXing::registerQMLTypes();
|
QZXing::registerQMLTypes();
|
||||||
QtQuick2ApplicationViewer viewer;
|
QtQuick2ApplicationViewer viewer;
|
||||||
|
|
||||||
|
QZXing::registerQMLImageProvider(viewer);
|
||||||
viewer.setMainQmlFile(QStringLiteral("qml/BarcodeEncoder/main.qml"));
|
viewer.setMainQmlFile(QStringLiteral("qml/BarcodeEncoder/main.qml"));
|
||||||
|
|
||||||
viewer.showExpanded();
|
viewer.showExpanded();
|
||||||
|
@ -23,6 +23,7 @@ Rectangle {
|
|||||||
onClicked: {
|
onClicked: {
|
||||||
qzxing.encodeData(inputField.text)
|
qzxing.encodeData(inputField.text)
|
||||||
inputField.text = '';
|
inputField.text = '';
|
||||||
|
resultImage.source = "image://QZXing/latestEncoded";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user