Hi. finally i only found the answer form my question. i hope it will will help to others.
i used QPrintPreviewWidget. please see the code....
Widget::Widget(QWidget *parent, QWidget *report) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
printer = new QPrinter(QPrinter::PrinterResolution);
printer->setOutputFormat(QPrinter::PdfFormat);
printer->setOutputFileName("sample.pdf");
printer->setPaperSize(QPrinter::A4);
printer->setFullPage(true);
printer->setResolution(300);
preview = new QPrintPreviewWidget(printer, this);
ui->verticalLayout->addWidget(preview);
preview->setFont(QFont("Arial",18,QFont::Bold));
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(print()));
connect(preview, SIGNAL(paintRequested(QPrinter*)), report, SLOT(Print(QPrinter*)));
preview->setZoomFactor(1);
preview->show();
}
void Widget::print()
{
preview->print();
}
void Report::Print(QPrinter *printer)
{
QPainter p(printer);
p.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform, true);
for (int page = 0; page < 5; page++)
{
p.drawText(1750, 200, QString("Date: %1").arg(QDateTime::currentDateTime().toString("dd.MM.yyyy")));
p->fillRect(QRect(150,150,2179,125),QBrush(QColor(222,222,230,255)));
printer->newPage();
}
}