mirror of
https://github.com/status-im/qzxing.git
synced 2025-02-15 04:16:23 +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
|
||||
QML_IMPORT_PATH =
|
||||
|
||||
CONFIG += gnu++11
|
||||
#CONFIG += gnu++11
|
||||
QMAKE_CXXFLAGS += -std=gnu++11
|
||||
|
||||
# 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();
|
||||
QtQuick2ApplicationViewer viewer;
|
||||
|
||||
QZXing::registerQMLImageProvider(viewer);
|
||||
viewer.setMainQmlFile(QStringLiteral("qml/BarcodeEncoder/main.qml"));
|
||||
|
||||
viewer.showExpanded();
|
||||
|
@ -23,6 +23,7 @@ Rectangle {
|
||||
onClicked: {
|
||||
qzxing.encodeData(inputField.text)
|
||||
inputField.text = '';
|
||||
resultImage.source = "image://QZXing/latestEncoded";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user