Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Use QZXing in qml

Use QZXing in qml

Scheduled Pinned Locked Moved Solved QML and Qt Quick
13 Posts 4 Posters 5.2k 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.
  • raven-worxR raven-worx

    @MHermann said in Use QZXing as library in qml:

    Any ideas what I am doing wrong?

    are you sure the libQZXing.so relies in $$PWD/QZXing/ ??

    M Offline
    M Offline
    MHermann
    wrote on last edited by
    #3

    @raven-worx : Yes, I compiled it and copied it there.

    1 Reply Last reply
    1
    • raven-worxR raven-worx

      @MHermann said in Use QZXing as library in qml:

      Any ideas what I am doing wrong?

      are you sure the libQZXing.so relies in $$PWD/QZXing/ ??

      M Offline
      M Offline
      MHermann
      wrote on last edited by MHermann
      #4

      @raven-worx :
      The three lines

      QZXing decoder;
      decoder.setDecoder(QZXing::DecoderFormat_QR_CODE);
      QString resultQrCode = decoder.decodeImage(qrCodeimageToDecode);
      

      are executing without problems. And they are also used from libQZXing.so.

      raven-worxR 1 Reply Last reply
      1
      • M MHermann

        @raven-worx :
        The three lines

        QZXing decoder;
        decoder.setDecoder(QZXing::DecoderFormat_QR_CODE);
        QString resultQrCode = decoder.decodeImage(qrCodeimageToDecode);
        

        are executing without problems. And they are also used from libQZXing.so.

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by raven-worx
        #5

        @MHermann

        are executing without problems. And they are also used from libQZXing.so.

        Yes i overread that.

        seems the QZXING_QML macro definition is missing.
        Recompile the lib with CONFIG += qzxing_qml

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        M 1 Reply Last reply
        1
        • raven-worxR raven-worx

          @MHermann

          are executing without problems. And they are also used from libQZXing.so.

          Yes i overread that.

          seems the QZXING_QML macro definition is missing.
          Recompile the lib with CONFIG += qzxing_qml

          M Offline
          M Offline
          MHermann
          wrote on last edited by MHermann
          #6

          @raven-worx :
          I added the line

          CONFIG += qzxing_qml
          

          to QZXing.pro and compiled the lib again.

          I copied the new *.so files to my directory.
          But it behaves exactly the same...
          "undefined reference to `QZXing::registerQMLTypes()'"

          I forgot to mention, that I also added additional arguments in my project:

          DEFINES+=QZXING_QML DEFINES+=QML_MULTIMEDIA
          

          Any more ideas?

          raven-worxR 1 Reply Last reply
          0
          • M MHermann

            @raven-worx :
            I added the line

            CONFIG += qzxing_qml
            

            to QZXing.pro and compiled the lib again.

            I copied the new *.so files to my directory.
            But it behaves exactly the same...
            "undefined reference to `QZXing::registerQMLTypes()'"

            I forgot to mention, that I also added additional arguments in my project:

            DEFINES+=QZXING_QML DEFINES+=QML_MULTIMEDIA
            

            Any more ideas?

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by raven-worx
            #7

            @MHermann said in Use QZXing as library in qml:

            Any more ideas?

            No, this seemed pretty much the cause for issue to me.

            Alternatively - if its's an option for you - you could add include($$PWD/QZXing/src/QZXing.pri (and also add CONFIG += qzxing_qml) to your application's .pro file. Then QZXing is compiled into your binary directly.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            M 1 Reply Last reply
            2
            • raven-worxR raven-worx

              @MHermann said in Use QZXing as library in qml:

              Any more ideas?

              No, this seemed pretty much the cause for issue to me.

              Alternatively - if its's an option for you - you could add include($$PWD/QZXing/src/QZXing.pri (and also add CONFIG += qzxing_qml) to your application's .pro file. Then QZXing is compiled into your binary directly.

              M Offline
              M Offline
              MHermann
              wrote on last edited by
              #8

              @raven-worx :

              This could also be a solution. But this would not be my preferred solution...
              That would mean that the whole QZXing source code will be compiled too, each time I am compiling my own source code.
              Or is it possible to exclude this from the compiling process and compile it only once?

              raven-worxR 1 Reply Last reply
              1
              • M MHermann

                @raven-worx :

                This could also be a solution. But this would not be my preferred solution...
                That would mean that the whole QZXing source code will be compiled too, each time I am compiling my own source code.
                Or is it possible to exclude this from the compiling process and compile it only once?

                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by raven-worx
                #9

                @MHermann
                it gets only recompiled when it needs to (when a source file changes, etc)

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                M 1 Reply Last reply
                1
                • raven-worxR raven-worx

                  @MHermann
                  it gets only recompiled when it needs to (when a source file changes, etc)

                  M Offline
                  M Offline
                  MHermann
                  wrote on last edited by
                  #10

                  @raven-worx :

                  I added the QZXing source code via

                  include($$PWD/QZXing/src/QZXing.pri
                  

                  Now it is working.

                  1 Reply Last reply
                  2
                  • lukas_kosinskiL Offline
                    lukas_kosinskiL Offline
                    lukas_kosinski
                    wrote on last edited by
                    #11

                    Hi! If your project is based on C++, consider using SCodes. SCodes uses latest ZXing C++ port. It also allows you to generate QR/Bar codes. You can read more about it here.

                    ekkescornerE 1 Reply Last reply
                    1
                    • lukas_kosinskiL lukas_kosinski

                      Hi! If your project is based on C++, consider using SCodes. SCodes uses latest ZXing C++ port. It also allows you to generate QR/Bar codes. You can read more about it here.

                      ekkescornerE Offline
                      ekkescornerE Offline
                      ekkescorner
                      Qt Champions 2016
                      wrote on last edited by
                      #12

                      @lukas_kosinski unfortunately SCodes only supports Code128 and QR

                      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                      5.15 --> 6.8 https://t1p.de/ekkeChecklist
                      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                      lukas_kosinskiL 1 Reply Last reply
                      0
                      • ekkescornerE ekkescorner

                        @lukas_kosinski unfortunately SCodes only supports Code128 and QR

                        lukas_kosinskiL Offline
                        lukas_kosinskiL Offline
                        lukas_kosinski
                        wrote on last edited by
                        #13

                        @ekkescorner I worked on that and now it supports much more formats. Currently it's a PR opened, but it should be soon merged:
                        https://github.com/scytheStudio/SCodes/pull/11

                        Sorry that I add the comment to a quite old post. I simply wanted people to know it and not be misled.

                        1 Reply Last reply
                        2

                        • Login

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