QT QML integrate with thermal USB Printer
-
Dear experts,
I am learning QT and implement in my Kiosk based Application. I am trying to integrate a USB based thermal printer with the system and print the user selected coupon via printer.
I went through QtPrintSupport library but I am not sure how to implement it with the Application. Any guidance will be really helpful for me.
Thank you.
-
@jsulm Hi, Thank you very much for your quick reply. I am using this printer - https://eurocoincomponents.com/product/ms-fpt201k-panel-printer/
I've used it with python before, accessed it using VID, PID and used escposprinter library there. It's a simple roll printer. There is no SDK to develop it, it works on USB protocol. It uses ESC/POS command.
-
Hi,
That's the kind of printer that is outside the Qt Print Support module scope.
From what I can see, it's a serial port based device so you could use QSerialPort to communicate with it.
-
If you list all the serial ports with QSerialPortInfo::availablePorts, what do you get ?
-
It doesn't print anything for the printer. I have run this part of code:
for(auto info: QSerialPortInfo::availablePorts()){ qDebug()<<info.portName()<<info.description()<<info.manufacturer(); if(!info.isBusy() && (info.description().contains("Silicon Labs CP210x USB to UART Bridge") || info.manufacturer().contains("Silicon Labs"))){ portInfo = info; break; } }
-
What do you get ?
-
Do you mean the list is empty ?