1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-02-06 05:08:22 +08:00
QXlsx/SpreadsheetExample/printview.cpp

26 lines
467 B
C++
Raw Normal View History

2018-06-16 16:28:51 +09:00
// (c) The Qt Company Ltd. BSD License
2018-06-13 19:13:16 +09:00
// Some code is fixed by j2doll.
2018-06-16 16:28:51 +09:00
2018-06-13 19:13:16 +09:00
#ifndef QT_NO_PRINTER
#include <QPrinter>
#endif
#include <QStyleOptionViewItem>
#include "printview.h"
PrintView::PrintView()
{
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
}
void PrintView::print(QPrinter *printer)
{
#ifndef QT_NO_PRINTER
resize(printer->width(), printer->height());
render(printer);
#endif
}