Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android Read Barcode
Forum Updated to NodeBB v4.3 + New Features

Android Read Barcode

Scheduled Pinned Locked Moved Solved Mobile and Embedded
7 Posts 3 Posters 876 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Nio74N Offline
    Nio74N Offline
    Nio74
    wrote on last edited by
    #1

    HI

    I tryed to use QZXing library bat not work good,when I go at declare in the my *.pro I have this problem

    D:\GoogleDrive\c++\QT\ProvaNegozioCodeBAr\main.cpp:13: error: 'registerQMLTypes' is not a member of 'QZXing'
         QZXing::registerQMLTypes();
                 ^~~~~~~~~~~~~~~~
    

    this is my file *.pro

    QT += quick
    
    include(QZXing/QZXing.pri)
    
    CONFIG += c++11  core qzxing_qml
    
    
    
    
    # The following define makes your compiler emit warnings if you use
    # any Qt feature that has been marked deprecated (the exact warnings
    # depend on your compiler). Refer to the documentation for the
    # deprecated API to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
            main.cpp
    
    RESOURCES += qml.qrc
    
    # Additional import path used to resolve QML modules in Qt Creator's code model
    QML_IMPORT_PATH =
    
    # Additional import path used to resolve QML modules just for Qt Quick Designer
    QML_DESIGNER_IMPORT_PATH =
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    

    Is there any native library running for android and IOS? I tried to look for some working projects but also those that are like an example are all with old QT version.

    J.HilkJ 1 Reply Last reply
    0
    • Nio74N Nio74

      HI

      I tryed to use QZXing library bat not work good,when I go at declare in the my *.pro I have this problem

      D:\GoogleDrive\c++\QT\ProvaNegozioCodeBAr\main.cpp:13: error: 'registerQMLTypes' is not a member of 'QZXing'
           QZXing::registerQMLTypes();
                   ^~~~~~~~~~~~~~~~
      

      this is my file *.pro

      QT += quick
      
      include(QZXing/QZXing.pri)
      
      CONFIG += c++11  core qzxing_qml
      
      
      
      
      # The following define makes your compiler emit warnings if you use
      # any Qt feature that has been marked deprecated (the exact warnings
      # depend on your compiler). Refer to the documentation for the
      # deprecated API to know how to port your code away from it.
      DEFINES += QT_DEPRECATED_WARNINGS
      
      # You can also make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      # You can also select to disable deprecated APIs only up to a certain version of Qt.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      SOURCES += \
              main.cpp
      
      RESOURCES += qml.qrc
      
      # Additional import path used to resolve QML modules in Qt Creator's code model
      QML_IMPORT_PATH =
      
      # Additional import path used to resolve QML modules just for Qt Quick Designer
      QML_DESIGNER_IMPORT_PATH =
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      

      Is there any native library running for android and IOS? I tried to look for some working projects but also those that are like an example are all with old QT version.

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @Nio74 QZXing is working fine, if you set it up correctly in your project.

      How did you include it? The pri file in your project or as precompiled lib ?

      Do you want to use the QML based imageFilter ? I assume so because your error message eis of missing regisetQMLTypes.

      My guess is you forget this define in your pro file

      DEFINES += QZXING_QML
      

      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      Nio74N 1 Reply Last reply
      0
      • J.HilkJ J.Hilk

        @Nio74 QZXing is working fine, if you set it up correctly in your project.

        How did you include it? The pri file in your project or as precompiled lib ?

        Do you want to use the QML based imageFilter ? I assume so because your error message eis of missing regisetQMLTypes.

        My guess is you forget this define in your pro file

        DEFINES += QZXING_QML
        
        Nio74N Offline
        Nio74N Offline
        Nio74
        wrote on last edited by
        #3

        @J.Hilk said in Android Read Barcode:

        @Nio74 QZXing is working fine, if you set it up correctly in your project.

        How did you include it? The pri file in your project or as precompiled lib ?

        Do you want to use the QML based imageFilter ? I assume so because your error message eis of missing regisetQMLTypes.

        My guess is you forget this define in your pro file

        DEFINES += QZXING_QML
        

        I have created new project and insert "Src" library in the my project directory renamed it in to QZXing, and this is my complete *.pro file.

        /QT += quick
        
        
        CONFIG += c++11
        include(QZXing/QZXing.pri)
        
        CONFIG += qzxing_qml
        
        
        # The following define makes your compiler emit warnings if you use
        # any Qt feature that has been marked deprecated (the exact warnings
        # depend on your compiler). Refer to the documentation for the
        # deprecated API to know how to port your code away from it.
        DEFINES += QT_DEPRECATED_WARNINGS QZXING_QML
        
        # You can also make your code fail to compile if it uses deprecated APIs.
        # In order to do so, uncomment the following line.
        # You can also select to disable deprecated APIs only up to a certain version of Qt.
        #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
        
        SOURCES += \
                main.cpp
        
        RESOURCES += qml.qrc
        
        # Additional import path used to resolve QML modules in Qt Creator's code model
        QML_IMPORT_PATH =
        
        # Additional import path used to resolve QML modules just for Qt Quick Designer
        QML_DESIGNER_IMPORT_PATH =
        
        # Default rules for deployment.
        qnx: target.path = /tmp/$${TARGET}/bin
        else: unix:!android: target.path = /opt/$${TARGET}/bin
        !isEmpty(target.path): INSTALLS += target
        
        

        in this image you to see my qml and the error
        0_1557145094538_Cattura.JPG ![alt text](image url)

        J.HilkJ 1 Reply Last reply
        0
        • Nio74N Nio74

          @J.Hilk said in Android Read Barcode:

          @Nio74 QZXing is working fine, if you set it up correctly in your project.

          How did you include it? The pri file in your project or as precompiled lib ?

          Do you want to use the QML based imageFilter ? I assume so because your error message eis of missing regisetQMLTypes.

          My guess is you forget this define in your pro file

          DEFINES += QZXING_QML
          

          I have created new project and insert "Src" library in the my project directory renamed it in to QZXing, and this is my complete *.pro file.

          /QT += quick
          
          
          CONFIG += c++11
          include(QZXing/QZXing.pri)
          
          CONFIG += qzxing_qml
          
          
          # The following define makes your compiler emit warnings if you use
          # any Qt feature that has been marked deprecated (the exact warnings
          # depend on your compiler). Refer to the documentation for the
          # deprecated API to know how to port your code away from it.
          DEFINES += QT_DEPRECATED_WARNINGS QZXING_QML
          
          # You can also make your code fail to compile if it uses deprecated APIs.
          # In order to do so, uncomment the following line.
          # You can also select to disable deprecated APIs only up to a certain version of Qt.
          #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
          
          SOURCES += \
                  main.cpp
          
          RESOURCES += qml.qrc
          
          # Additional import path used to resolve QML modules in Qt Creator's code model
          QML_IMPORT_PATH =
          
          # Additional import path used to resolve QML modules just for Qt Quick Designer
          QML_DESIGNER_IMPORT_PATH =
          
          # Default rules for deployment.
          qnx: target.path = /tmp/$${TARGET}/bin
          else: unix:!android: target.path = /opt/$${TARGET}/bin
          !isEmpty(target.path): INSTALLS += target
          
          

          in this image you to see my qml and the error
          0_1557145094538_Cattura.JPG ![alt text](image url)

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Nio74 on first glance, I would say you mixed stuff up.

          It's defines, not config.

          example, directly taken from one of my projects

          DEFINES += QZXING_QML
          
          include($$PWD/3rdParty/QZXing/QZXing.pri)
          

          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          Nio74N 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @Nio74 on first glance, I would say you mixed stuff up.

            It's defines, not config.

            example, directly taken from one of my projects

            DEFINES += QZXING_QML
            
            include($$PWD/3rdParty/QZXing/QZXing.pri)
            
            Nio74N Offline
            Nio74N Offline
            Nio74
            wrote on last edited by Nio74
            #5

            @J.Hilk

            not work this is the simple project, I feel like I'm crazy, I compiled for Android Arm,and work with QT 5.12.2

            KroMignonK 1 Reply Last reply
            0
            • Nio74N Nio74

              @J.Hilk

              not work this is the simple project, I feel like I'm crazy, I compiled for Android Arm,and work with QT 5.12.2

              KroMignonK Offline
              KroMignonK Offline
              KroMignon
              wrote on last edited by KroMignon
              #6

              @Nio74 like @J-Hilk has written, QZXing works fine with Android. I've used it a little project.

              Important: You have to set CONFIG += qzxing_qml, before include(QZXing/QZXing.pri)!

              If you want to use filter capabilities: CONFIG += qzxing_qml qzxing_multimedia

              It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

              Nio74N 1 Reply Last reply
              4
              • KroMignonK KroMignon

                @Nio74 like @J-Hilk has written, QZXing works fine with Android. I've used it a little project.

                Important: You have to set CONFIG += qzxing_qml, before include(QZXing/QZXing.pri)!

                If you want to use filter capabilities: CONFIG += qzxing_qml qzxing_multimedia

                Nio74N Offline
                Nio74N Offline
                Nio74
                wrote on last edited by
                #7

                @KroMignon said in Android Read Barcode:

                qzxing_qml qzxing_multimedia

                so it works thanks, now I have to let the camera read the barcode let's see if we can study a bit, if anyone has any help it's welcome;)

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved