void testFontScaling()
    {
        SKIP_IF_FONT_NOT_FOUND

        fillModel(2, 25);
        Report report;
        report.setReportMode(Report::SpreadSheet);
        report.setDefaultFont(QFont(QLatin1String(s_fontName), 48));
        AutoTableElement tableElement(&m_model);
        tableElement.setHorizontalHeaderVisible(false);
        tableElement.setVerticalHeaderVisible(false);
        report.mainTable()->setAutoTableElement(tableElement);
        QCOMPARE(report.numberOfPages(), 2);
        QCOMPARE(report.mainTable()->pageRects().count(), 2);

#ifndef Q_OS_MAC // Somehow the mac gets different font size for the headers, even compared to linux with DPI 72.
        const int rowsFirstPage = report.mainTable()->pageRects()[0].height();
        QVERIFY(rowsFirstPage <= 20);
        QVERIFY(rowsFirstPage >= 18);
        QCOMPARE(report.mainTable()->pageRects()[0], QRect(0,0,2,rowsFirstPage));
        QCOMPARE(report.mainTable()->pageRects()[1], QRect(0,rowsFirstPage,2,m_model.rowCount()-rowsFirstPage));

        // Now show a huge horizontal header, and check we have less rows per page
        tableElement.setHorizontalHeaderVisible(true);
        report.mainTable()->setAutoTableElement(tableElement);
        report.mainTable()->setHorizontalHeaderFont(QFont(QLatin1String(s_fontName), 48));
        QCOMPARE(report.numberOfPages(), 2);
        QVERIFY(report.mainTable()->pageRects()[0].height() < rowsFirstPage);

        // Now force a very small font scaling factor
        report.setFontScalingFactor(0.2);
        QCOMPARE(report.numberOfPages(), 1);
        QCOMPARE(report.mainTable()->lastAutoFontScalingFactor(), 0.2);
        QCOMPARE(report.mainTable()->pageRects()[0], QRect(0,0,2,m_model.rowCount()));
#endif
    }