PDA

View Full Version : Qt + Barcode Reader



sunil.thaha
19th January 2006, 07:11
Hi Guys,

Has anyone used Barcode reader with Qt.
Is there a need for a QExtSerial. or USB interfacing code .
Could you please point me to some links

yop
19th January 2006, 08:07
Is there a need for a QExtSerial. or USB interfacing code .
Could you please point me to some links Which platform (Win/Linux)? In linux you can take a look at Serial Programming Guide for POSIX Operating Systems (http://www.easysw.com/~mike/serial/serial.html). For the usb interface take a look at http://www.linux-usb.org/

seneca
19th January 2006, 08:29
The easiest is using a barcode scanner which is looped into the keyboard. You can program such scanners to send different prefixey and postfixes, such as for example Ctrl+F11 when a barcode beginns and CR at the end.

I have used many scanners in previous (non-Qt) applications over years, and for far the most cases a scanner looped into the keyboard is sufficient. There are rare cases however when this has disadvantages.

sunil.thaha
19th January 2006, 08:49
I am using Linux.



The easiest is using a barcode scanner which is looped into the keyboard. You can program such scanners to send different prefixey and postfixes, such as for example Ctrl+F11 when a barcode beginns and CR at the end.

Could u please elaborate



using a barcode scanner which is looped into the keyboard

What does that mean ?

AlexKiriukha
19th January 2006, 09:16
"looped into the keyboard" - it's something like that: Keyboard->Scanner->Computer. That way you plug your keyboard into scanner and scanner plug in yours computer's keyboard interface. When scanner reads data it sends it like it was inputed via regular keyboard. Scanners I've tried use special barcodes (in their's documentation) for tuning theirs' params.

If you want to use serial-bus scanner, there is some points:
1. Due Linux architecture only root can read/write IO ports directly. But using program with root privileges is potentialy dangerous.
2. If you can get to scanner via /dev/ filesystem - you've got simple solution.
3. You can write/get little driver or daemon and somehow communicate with your prog.
4. Somehow - standard unix techniques: pipes, shared memory, TCP/IP sockets (scaneer-application via network;) ), /proc/ filesistem, /dev/ filesystem etc.
5. I think there are a lot of other ways...

dec0ding
19th January 2006, 11:22
I have experience with Barcode reader and I must say that the barcode reader itself has nothing to do with Qt. Actually you should handle the events the barcode sends..the bardcode behaives just like the keyboard. So if u have QLineEdit object and put the focus in it, then plug the barcode in the computer and read some barcode, the code will be written in the QLineEdit object...then tell the LineEdit textChanged(const QString&) method what SLOT() to connect with...

Simple easy and cool :)

P.S.
The Barcode Reader is not OS depended, it should work even in the BIOS system...

sunil.thaha
19th January 2006, 11:54
I have experience with Barcode reader and I must say that the barcode reader itself has nothing to do with Qt. Actually you should handle the events the barcode sends..the bardcode behaives just like the keyboard. So if u have QLineEdit object and put the focus in it, then plug the barcode in the computer and read some barcode, the code will be written in the QLineEdit object...then tell the LineEdit textChanged(const QString&) method what SLOT() to connect with...

Simple easy and cool :)

P.S.
The Barcode Reader is not OS depended, it should work even in the BIOS system...

If this is the case We need not worry about such a thing called the Barcode Reader Do we ?

AlexKiriukha
19th January 2006, 12:05
If this is the case We need not worry about such a thing called the Barcode Reader Do we ?

Generally yes. If you have "looped into the keyboard" you don't have to worry about it at all. Though tuning of barcode reader itself may be needed (things like type of code etc).

dec0ding
19th January 2006, 13:08
If this is the case We need not worry about such a thing called the Barcode Reader Do we ?

sure, just as you dont have to look after Keybords stdin...Barcode reader writes in the Stdin...so the system reads it.

That is all. But there might be different types of Barcode readers anyways...I have experience with one type. Just ask for one that will connect with the keyboard and then both devices will go into PS/2 or serial...

wysota
19th January 2006, 14:01
Is this topic related to Qt in any way? Moving to "General Discussion".

sunil.thaha
20th January 2006, 03:37
Is this topic related to Qt in any way? Moving to "General Discussion".
Me too I didn't want to post here. I mistook Qt's General for General Discussion :D

high_flyer
20th January 2006, 20:51
Bar code scanner is just a device.
So first you need to know what kind of a device you have.
If its serial, then you can use QExtSerial.
If its parallel, you can use parapin, and I made a Qt wrapper class for it you want I can send it to you.
I don't know my self about any USB C++ or Qt wrappers, so either you will have to seach for it, or write it your self.
(I am talking about linux here)

Again, Qt is a GUI tool kit, and if your app needs to talk to any hardware, you will have to link agains that hardware driver, but it has nothing to do with the application being builed with Qt.
Some times it can be convinent to wrap API of drivers with Qt, and enjoy signal and slots to communicate with the hardware.
I have done it with frame grabbers, parapin, and also custom made (not by me) USB driver.

wallyqt
13th November 2007, 12:13
B
If its parallel, you can use parapin, and I made a Qt wrapper class for it you want I can send it to you..


I want to access the parapin-kernel-driver (from user-space) in a KDE-QT application.
May you send me the code you are speaking about above, please.

cheers wally