Hola
 
Tengo esta función que usa la API de windows para imprimir, no la escribí yo, la copié de un ejemplo de la web de microsoft y la modifiqué un poco:    
Código C++:
Ver original- bool imprimirTicket(QString impresora, QByteArray datos) 
- { 
-     wchar_t szPrinterName[255]; 
-     int length = impresora.toWCharArray(szPrinterName); 
-     szPrinterName[length] = 0; 
-   
-     HANDLE hPrinter; 
-     DOC_INFO_1 DocInfo; 
-     DWORD dwJob; 
-     DWORD dwBytesWritten; 
-   
-     // Need a handle to the printer. 
-     if(!OpenPrinter(szPrinterName, &hPrinter, NULL)) { 
-         qDebug() << "Error al abrir la impresora " << impresora; 
-         return false; 
-     } 
-   
-     // Fill in the structure with info about this "document." 
-     DocInfo.pDocName = L"Ticket"; 
-     DocInfo.pOutputFile = NULL; 
-     DocInfo.pDatatype = L"RAW"; 
-   
-     // Inform the spooler the document is beginning. 
-     if((dwJob = StartDocPrinter( hPrinter, 1, (LPBYTE)&DocInfo)) == 0) { 
-         ClosePrinter(hPrinter); 
-         qDebug() << "Error al crear el documento"; 
-         return false; 
-     } 
-   
-     // Start a page. 
-     if(!StartPagePrinter(hPrinter)) { 
-         EndDocPrinter(hPrinter); 
-         ClosePrinter(hPrinter); 
-         qDebug() << "Error al iniciar la página"; 
-         return false; 
-     } 
-   
-     // Send the data to the printer. 
-     if(!WritePrinter(hPrinter, datos.data(), datos.length(), &dwBytesWritten)) { 
-         EndPagePrinter(hPrinter); 
-         EndDocPrinter(hPrinter); 
-         ClosePrinter(hPrinter); 
-         qDebug() << "Error al enviar los datos a la impresora"; 
-         return false; 
-     } 
-   
-     // End the page. 
-     if(!EndPagePrinter(hPrinter)) { 
-         EndDocPrinter(hPrinter); 
-         ClosePrinter(hPrinter); 
-         qDebug() << "Error al cerrar la página"; 
-         return false; 
-     } 
-   
-     // Inform the spooler that the document is ending. 
-     if( ! EndDocPrinter(hPrinter)) { 
-         ClosePrinter(hPrinter); 
-         qDebug() << "Error al cerrar el documento"; 
-         return false; 
-     } 
-   
-     // Tidy up the printer handle. 
-     ClosePrinter(hPrinter); 
-   
-     // Check to see if correct number of bytes were written. 
-     if(dwBytesWritten != datos.length()) { 
-         qDebug() << "Error: No coindiden los bytes escritos"; 
-         return false; 
-     } 
-   
-     return true; 
- } 
Si no recuerdo mal, la copié de aquí: 
https://support.microsoft.com/es-es/kb/138594 
En principio la usaba para abrir el cajón portamonedas y ningún problema, ahora quiero imprimir pequeños textos y lo hace, pero no me imprime los acentos ni los caracteres como la 'ñ'. Los textos que tengo que imprimir los tengo en un QStringList, este podría ser un ejemplo de llamada:    
Código C++:
Ver original- QStringList ticketPrueba; 
-     ticketPrueba << "Ticket de prueba"; 
-     ticketPrueba << "á é í ó ú ñ Ñ"; 
-     ticketPrueba << "Gracias por su visita"; 
-   
-     QByteArray texto; 
-     foreach(QString linea, ticketPrueba) { 
-         texto.append(linea.toStdString().c_str()); 
-         texto.append('\n'); 
-     } 
-     texto.append('\n'); // un espacio extra al final 
-   
-   
-     if(imprimirTicket(impresora, texto)) 
-         qDebug() << "Ticket impreso con éxito"; 
Todo bien, pero la tercera línea, la de los acentos, pues salen caracteres raros. ¿Cómo podría hacer para que me imprima los acentos? 
Un saludo