Hi all, i have a little problem with this simple code:
void MainWindow::on_Stampa_clicked()
{
printer.
setOrientation(QPrinter::Portrait);
printer.
setPageMargins (15,
15,
15,
15,
QPrinter::Millimeter);
printer.setFullPage(false);
printer.
setOutputFormat(QPrinter::NativeFormat);
painter.
setFont(QFont("Tahoma",
8));
painter.drawText(200,200,"Test prova prova");
painter.end();
}
void MainWindow::on_Stampa_clicked()
{
QPrinter printer(QPrinter::HighResolution);
printer.setPageSize(QPrinter::A4);
printer.setOrientation(QPrinter::Portrait);
printer.setPageMargins (15,15,15,15,QPrinter::Millimeter);
printer.setFullPage(false);
printer.setOutputFormat(QPrinter::NativeFormat);
QPainter painter(&printer);
painter.setFont(QFont("Tahoma",8));
painter.drawText(200,200,"Test prova prova");
painter.end();
}
To copy to clipboard, switch view to plain text mode
"Stampa" is a normal button.
In the PC with QT the print works right, but in the others pc (one with win 8.1 and one with win 7) default print doesn't start, the print queue stay empty. I don't understand why and i don't get any error.
I use:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QPrinter>
#include <QPainter>
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QPrinter>
#include <QPainter>
To copy to clipboard, switch view to plain text mode
and in the .pro:
QT += printsupport
QTPLUGIN += windowsprintersupport
QT += printsupport
QTPLUGIN += windowsprintersupport
To copy to clipboard, switch view to plain text mode
The dll "Qt5PrintSupport" is present inside the folder of course.
Sorry for the noob question but I don't understand what I am doing wrong..
Bookmarks