21 #include "ui_tablebreakingdialogbase.h"
24 class KDReports::TableBreakingSettingsDialogPrivate :
public Ui::TableBreakingSettingsDialog
31 void slotBreakTablesToggled(
bool breakTables)
35 numHorizontalPages->setValue(1);
37 numHorizontalPages->setEnabled(breakTables);
45 , d(new TableBreakingSettingsDialogPrivate(report))
49 connect(d->breakTables, &QAbstractButton::toggled,
this, [
this](
bool b) { d->slotBreakTablesToggled(b); } );
52 d->breakTables->setChecked(
true);
53 d->breakTables->setChecked(d->m_report->isTableBreakingEnabled());
54 if (d->m_report->isTableBreakingEnabled() && d->m_report->fontScalingFactor() == 1.0) {
55 const int maxH = d->m_report->maximumNumberOfPagesForHorizontalScaling();
56 const int maxV = d->m_report->maximumNumberOfPagesForVerticalScaling();
57 d->fit->setChecked(
true);
58 d->numHorizontalPages->setValue(maxH);
59 d->numVerticalPages->setValue(maxV);
61 d->scaleFonts->setChecked(
true);
62 d->scalingFactor->setValue(qRound(d->m_report->fontScalingFactor() * 100));
66 d->downThenRight->setChecked(
true);
68 d->rightThenDown->setChecked(
true);
75 d->showGrid->setChecked(autoTable->
border() > 0);
77 d->tableSettingsGroupBox->hide();
86 void KDReports::TableBreakingSettingsDialog::accept()
89 const bool breakTables = d->breakTables->isChecked();
90 if (d->fit->isChecked()) {
91 d->m_report->setFontScalingFactor(1.0);
92 d->m_report->scaleTo(breakTables ? d->numHorizontalPages->value() : 1, d->numVerticalPages->value());
94 d->m_report->setFontScalingFactor(
static_cast<qreal
>(d->scalingFactor->value()) / 100.0);
97 if (d->downThenRight->isChecked()) {
108 const bool currentGrid = autoTable->
border() > 0;
109 if (currentGrid != d->showGrid->isChecked())
110 autoTable->
setBorder(d->showGrid->isChecked() ? 1 : 0);
111 d->m_report->regenerateAutoTables();
113 d->tableSettingsGroupBox->hide();
119 void KDReports::TableBreakingSettingsDialog::reject()