Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Regarding the barcode reader in Qt
Forum Updated to NodeBB v4.3 + New Features

Regarding the barcode reader in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 5 Posters 10.0k Views 3 Watching
  • 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.
  • Pradeep KumarP Offline
    Pradeep KumarP Offline
    Pradeep Kumar
    wrote on last edited by Pradeep Kumar
    #1

    Hi,

    I require the information, where to read the barcode value and display in Qt, and display in any one of visual element say QLabel, QTextEdit.

    While searching i got the project, from the link below.

    https://github.com/ftylitak/qzxing/tree/master/examples

    can anyone provide the guidance how can i start for implementing in Qt, to read the barcode value?.

    Thanks,

    Pradeep Kumar
    Qt,QML Developer

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Try looking at this example and change the decode format in the constructor of QQrDecoder

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      3
      • Pradeep KumarP Offline
        Pradeep KumarP Offline
        Pradeep Kumar
        wrote on last edited by Pradeep Kumar
        #3

        I just downloaded and changd in constructor, the following lines of code.

        m_centralwidget = new QCameraControllerWidget(this);
        m_centralwidget->setObjectName(QStringLiteral("centralwidget"));
        
        this->setCentralWidget(m_centralwidget);
        
        connect(m_centralwidget,SIGNAL(imageCaptured(QImage)),this,SLOT(decodeImage(QImage)));
        connect(&decoder,SIGNAL(tagFound(QString)),this,SLOT(reportTagFound(QString)));
        

        And when i run the application i get the following errors, as failed to start video surface

        QML debugging is enabled. Only use this in a safe environment.
        libpng warning: iCCP: known incorrect sRGB profile
        libpng warning: iCCP: known incorrect sRGB profile
        libpng warning: iCCP: known incorrect sRGB profile
        Failed to start video surface
        CameraBin error: "Internal data flow error."

        Guidance is required?.
        And has anyone tried to read the barcode value using Qt?.

        Pradeep Kumar
        Qt,QML Developer

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          The "libpng warning: iCCP: known incorrect sRGB profile" can be ignored.

          The "CameraBin error: "Internal data flow error.""
          seems to come when it cant find your camera or do not like it or its default format.
          http://stackoverflow.com/questions/17650710/recording-video-from-usb-cam-with-qt5

          What barcode format are you aiming at?
          What scanner/ camera are you using to scan the barcode?

          1 Reply Last reply
          0
          • Pradeep KumarP Offline
            Pradeep KumarP Offline
            Pradeep Kumar
            wrote on last edited by Pradeep Kumar
            #5

            I am not aiming at specific barcode format.
            But to get the values out of barcode and append to QLabel or QTextEdit.
            using QCamera. Any suggestions?.

            Pradeep Kumar
            Qt,QML Developer

            mrjjM 1 Reply Last reply
            0
            • Pradeep KumarP Pradeep Kumar

              I am not aiming at specific barcode format.
              But to get the values out of barcode and append to QLabel or QTextEdit.
              using QCamera. Any suggestions?.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Pradeep-Kumar
              Yes, first you must understand that bar code has formats.
              Just like an image format, say JPG and GIF.
              You can use the following formats:
              UPC-A
              UPC-E
              EAN-8
              EAN-13
              ITF
              Code 39
              Code 93
              Code 128
              Codabar
              QR Code
              Data Matrix
              Aztec (beta)
              PDF 417 (beta)

              So your INPUT must be encoded in that format for you to be able to read it.
              IF you are not using a scanner or camera, you need to find out IF and how it will
              accept an image of a barcode. And if it does, what format of the image it accepts.

              So u need to be clear about
              Bar code format used
              How you get the barcode
              and what options the qzxing has for the input.

              1 Reply Last reply
              2
              • Pradeep KumarP Offline
                Pradeep KumarP Offline
                Pradeep Kumar
                wrote on last edited by Pradeep Kumar
                #7

                yes @mrjj i will go through ,
                similar could help

                https://www.google.co.in/imgres?imgurl=http%3A%2F%2Fwww.incimages.com%2Fuploaded_files%2Fimage%2F1940x900%2F*Barcode_32896.jpg&imgrefurl=http%3A%2F%2Fwww.inc.com%2Fthe-build-network%2F6-lessons-on-innovation-from-the-history-of-the-barcode.html&docid=w6igdcCocEzSOM&tbnid=4rx6PxpACO2LLM%3A&w=1940&h=900&bih=678&biw=1303&ved=0ahUKEwizxOGi077PAhVJP48KHdASA7gQMwgwKAAwAA&iact=mrc&uact=8

                and QRcode also will help

                http://www.google.co.in/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwjH787E077PAhUJpo8KHeIzA6kQjRwIBw&url=http%3A%2F%2Fteamhnm.com%2Findex.php%3Froute%3Dproduct%2Fproduct%26product_id%3D115&bvm=bv.134495766,d.c2I&psig=AFQjCNEW3TjftZ8IR9Qu8UOnAzil-kDhgQ&ust=1475584705251754

                Pradeep Kumar
                Qt,QML Developer

                1 Reply Last reply
                3
                • F Offline
                  F Offline
                  favoritas37
                  wrote on last edited by
                  #8

                  Hello,

                  i wanted to reply to this thread even though it is quite old in order to give a suggestion for future reference.

                  In QZXing's examples, the project "QQrDecoder" that you have used is deprecated thus I removed it from the repository to avoid any further confusion. It is now replaced by the project QZXingLive. The intention is to make this project as complete as possible for all the supported platforms. Thus, in case you come up to any issue feel free to open issue at the project's page.

                  (...and a note that goes back many years, the QQrDecoder was the first example made for QZXing back in the days of Symbian...)

                  1 Reply Last reply
                  3
                  • lukas_kosinskiL Offline
                    lukas_kosinskiL Offline
                    lukas_kosinski
                    wrote on last edited by
                    #9

                    Hi! You can scan the barcodes easily using some library. I would recommend using SCodes, which is easy to use, and also allows you to draw your own QR/barcodes. It's based on ZXing C++ port, like popular QZxing. You can read more about it here.

                    1 Reply Last reply
                    1

                    • Login

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