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. Win CE application
Qt 6.11 is out! See what's new in the release blog

Win CE application

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 2.7k Views 1 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I'm coding and application for mobile with C++ and Qt for Win CE. I need to use the bar-code scanner to get the code but I don't know how to do it, I need your help.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      flaviomarcio
      wrote on last edited by
      #2

      I worked for years with the portable devices with WindowsCE products.

      You do not need to drive the scanner, is usually an active program or service that scanner run and operate as normal keyboard or service.

      In short, the scanner should be called by hardware, with button of the device.

      Flavio Portela

      1 Reply Last reply
      0
      • F Offline
        F Offline
        flaviomarcio
        wrote on last edited by
        #3

        What brand of machine you use?

        I am Brazilian. maybe know that you use?

        Flavio Portela

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Hi,

          If your bar-code scanner is connected in USB (the more likely), then, as Flavio said, it will be interpreted as a keyboard and so you will receive keyboard events on the focused widget

          @onKeyPress(QKeyEvent*)@

          To catch those events at application level, you can reimplement bool QApplication::event(QEvent*) and test the incoming event type

          @bool MyQApplication::event(QEvent* event)
          {
          if (event->type() == QEvent::KeyPress)
          {
          ...
          return true;
          }

          QApplication::event(event);
          }@

          Or install an event filter on your QApplication.

          @
          MyKeyboardEventFilter : public QObject
          {
          ...
          bool eventFilter(QObject* object, QEvent* event)
          {
          if(event->type() == QEvent::KeyPress)
          {
          ...
          return true;
          }

            QObject::eventFilter(object, event);
          

          }
          };@

          @// main.cpp
          qApp->installEventFilter(new MyKeyboardEventFilter());@

          Finally, else if it's connected through a serial port, have a look at QExtSerialPort lib project to receive and interpret incoming messages.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            Thanks for your help, for the bar-code scanner it's in the PDA, so i need a library to manipulate the bar-code scanner, like (turn it on,off,....) and thnx a lot for ur help :D

            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