15 #include "ui_tablebreakingdialogbase.h"
18 class KDReports::TableBreakingSettingsDialogPrivate :
public Ui::TableBreakingSettingsDialog
25 void slotBreakTablesToggled(
bool breakTables)
29 numHorizontalPages->setValue(1);
31 numHorizontalPages->setEnabled(breakTables);
39 , d(new TableBreakingSettingsDialogPrivate(report))
43 connect(d->breakTables, &QAbstractButton::toggled,
this, [
this](
bool b) { d->slotBreakTablesToggled(b); });
46 d->breakTables->setChecked(
true);
47 d->breakTables->setChecked(d->m_report->isTableBreakingEnabled());
48 if (d->m_report->isTableBreakingEnabled() && d->m_report->fontScalingFactor() == 1.0) {
49 const int maxH = d->m_report->maximumNumberOfPagesForHorizontalScaling();
50 const int maxV = d->m_report->maximumNumberOfPagesForVerticalScaling();
51 d->fit->setChecked(
true);
52 d->numHorizontalPages->setValue(maxH);
53 d->numVerticalPages->setValue(maxV);
55 d->scaleFonts->setChecked(
true);
56 d->scalingFactor->setValue(qRound(d->m_report->fontScalingFactor() * 100));
60 d->downThenRight->setChecked(
true);
62 d->rightThenDown->setChecked(
true);
69 d->showGrid->setChecked(autoTable->
border() > 0);
71 d->tableSettingsGroupBox->hide();
79 void KDReports::TableBreakingSettingsDialog::accept()
82 const bool breakTables = d->breakTables->isChecked();
83 if (d->fit->isChecked()) {
84 d->m_report->setFontScalingFactor(1.0);
85 d->m_report->scaleTo(breakTables ? d->numHorizontalPages->value() : 1, d->numVerticalPages->value());
87 d->m_report->setFontScalingFactor(
static_cast<qreal
>(d->scalingFactor->value()) / 100.0);
90 if (d->downThenRight->isChecked()) {
101 const bool currentGrid = autoTable->
border() > 0;
102 if (currentGrid != d->showGrid->isChecked())
103 autoTable->
setBorder(d->showGrid->isChecked() ? 1 : 0);
104 d->m_report->regenerateAutoTables();
106 d->tableSettingsGroupBox->hide();
112 void KDReports::TableBreakingSettingsDialog::reject()
void setBorder(qreal border)
void setHorizontalHeaderVisible(bool visible)
bool isHorizontalHeaderVisible() const
bool isVerticalHeaderVisible() const
void setVerticalHeaderVisible(bool visible)
TableBreakingSettingsDialog(KDReports::Report *report, QWidget *parent=nullptr)
~TableBreakingSettingsDialog() override