Setting dialog has been modified to edit report settings

Setting dialog has been modified to edit report settings
This commit is contained in:
Arin Alex 2016-06-24 23:10:47 +03:00
parent a8b193de05
commit 779eefcab5
4 changed files with 107 additions and 69 deletions

View File

@ -394,11 +394,13 @@ void ReportDesignWidget::editSetting()
setting.setVerticalGridStep(m_verticalGridStep);
setting.setHorizontalGridStep(m_horizontalGridStep);
setting.setDefaultFont(m_defaultFont);
setting.setSuppressAbsentFieldsAndVarsWarnings(m_report->suppressFieldAndVarError());
if (setting.exec()){
m_horizontalGridStep = setting.horizontalGridStep();
m_verticalGridStep = setting.verticalGridStep();
m_defaultFont = setting.defaultFont();
m_report->setSuppressFieldAndVarError(setting.suppressAbsentFieldsAndVarsWarnings());
applySettings();
}
}

View File

@ -32,6 +32,15 @@ QFont SettingDialog::defaultFont()
return result;
}
bool SettingDialog::suppressAbsentFieldsAndVarsWarnings()
{
return ui->cbSuppressWarnings->isChecked();
}
void SettingDialog::setSuppressAbsentFieldsAndVarsWarnings(bool value){
ui->cbSuppressWarnings->setChecked(value);
}
void SettingDialog::setHorizontalGridStep(int value)
{
ui->horizontalGridStep->setValue(value);

View File

@ -19,6 +19,8 @@ public:
int verticalGridStep();
int horizontalGridStep();
QFont defaultFont();
bool suppressAbsentFieldsAndVarsWarnings();
void setSuppressAbsentFieldsAndVarsWarnings(bool value);
void setHorizontalGridStep(int value);
void setVerticalGridStep(int value);
void setDefaultFont(const QFont& value);

View File

@ -7,97 +7,122 @@
<x>0</x>
<y>0</y>
<width>351</width>
<height>185</height>
<height>318</height>
</rect>
</property>
<property name="windowTitle">
<string>Designer setting</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Default font</string>
</property>
</widget>
</item>
<item>
<widget class="QFontComboBox" name="defaultFont"/>
</item>
<item>
<widget class="QSpinBox" name="defaultFontSize">
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Grid</string>
<string>Designer Setting</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Vertical grid step</string>
<string>Default font</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="verticalGridStep">
<item>
<widget class="QFontComboBox" name="defaultFont"/>
</item>
<item>
<widget class="QSpinBox" name="defaultFontSize">
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Horizontal grid step</string>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="horizontalGridStep">
<property name="value">
<number>10</number>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</widget>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Grid</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>73</width>
<height>20</height>
</size>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Vertical grid step</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="verticalGridStep">
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Horizontal grid step</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="horizontalGridStep">
<property name="value">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>73</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Report Setting</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="cbSuppressWarnings">
<property name="text">
<string>Suppress absent fields and variables warning</string>
</property>
</spacer>
</widget>
</item>
</layout>
</widget>
@ -153,8 +178,8 @@
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
<x>221</x>
<y>307</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
@ -169,8 +194,8 @@
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
<x>221</x>
<y>307</y>
</hint>
<hint type="destinationlabel">
<x>286</x>