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
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
We can't solve problems by using the same kind of thinking we used when we created them
Which platform (Win/Linux)? In linux you can take a look at Serial Programming Guide for POSIX Operating Systems. For the usb interface take a look at http://www.linux-usb.org/Originally Posted by sunil.thaha
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.
I am using Linux.
Could u please elaborateOriginally Posted by seneca
What does that mean ?using a barcode scanner which is looped into the keyboard
We can't solve problems by using the same kind of thinking we used when we created them
"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...
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 ?Originally Posted by dec0ding
We can't solve problems by using the same kind of thinking we used when we created them
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).Originally Posted by sunil.thaha
sure, just as you dont have to look after Keybords stdin...Barcode reader writes in the Stdin...so the system reads it.Originally Posted by sunil.thaha
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...
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 DiscussionOriginally Posted by wysota
We can't solve problems by using the same kind of thinking we used when we created them
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.
Last edited by wallyqt; 13th November 2007 at 12:15. Reason: changed notification mode
Bookmarks