Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/views/reports/reporttabimpl.h
| Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | 98 | public: | |||
|---|---|---|---|---|---|
| 99 | explicit ReportTabRange(QWidget *parent); | 99 | explicit ReportTabRange(QWidget *parent); | ||
| 100 | ~ReportTabRange(); | 100 | ~ReportTabRange(); | ||
| 101 | 101 | | |||
| 102 | Ui::ReportTabRange* ui; | 102 | Ui::ReportTabRange* ui; | ||
| 103 | DateRangeDlg *m_dateRange; | 103 | DateRangeDlg *m_dateRange; | ||
| 104 | void setRangeLogarythmic(bool set); | 104 | void setRangeLogarythmic(bool set); | ||
| 105 | private: | 105 | private: | ||
| 106 | enum EDimension { eRangeStart = 0, eRangeEnd, eMajorTick, eMinorTick}; | 106 | enum EDimension { eRangeStart = 0, eRangeEnd, eMajorTick, eMinorTick}; | ||
| 107 | bool m_logYaxis; | ||||
tbaumgart: Make sure to initialize `m_logYaxis` in the ctor() | |||||
| 108 | /** | ||||
| 109 | * Update data range start and data range end text validators | ||||
| 110 | * and re-validate the contents of those text fields against the updated validator. | ||||
| 111 | * If re-validation fails, arbitrary default values will be set depending on vertical axis type. | ||||
| 112 | * This fucntion should be called when vertical axis type or labels precision changed. | ||||
| 113 | */ | ||||
| 114 | void updateDataRangeValidators(const int& precision); | ||||
| 107 | private Q_SLOTS: | 115 | private Q_SLOTS: | ||
| 108 | void slotEditingFinished(EDimension dim); | 116 | void slotEditingFinished(EDimension dim); | ||
| 109 | void slotEditingFinishedStart(); | 117 | void slotEditingFinishedStart(); | ||
| 110 | void slotEditingFinishedEnd(); | 118 | void slotEditingFinishedEnd(); | ||
| 111 | void slotEditingFinishedMajor(); | 119 | void slotEditingFinishedMajor(); | ||
| 112 | void slotEditingFinishedMinor(); | 120 | void slotEditingFinishedMinor(); | ||
| 113 | void slotYLabelsPrecisionChanged(const int &value); | 121 | void slotYLabelsPrecisionChanged(const int &value); | ||
| 114 | void slotDataLockChanged(int index); | 122 | void slotDataLockChanged(int index); | ||
| Show All 25 Lines | |||||
| 140 | 148 | | |||
| 141 | class MyDoubleValidator : public QDoubleValidator | 149 | class MyDoubleValidator : public QDoubleValidator | ||
| 142 | { | 150 | { | ||
| 143 | public: | 151 | public: | ||
| 144 | explicit MyDoubleValidator(int decimals, QObject * parent = 0); | 152 | explicit MyDoubleValidator(int decimals, QObject * parent = 0); | ||
| 145 | 153 | | |||
| 146 | QValidator::State validate(QString &s, int &i) const final override; | 154 | QValidator::State validate(QString &s, int &i) const final override; | ||
| 147 | }; | 155 | }; | ||
| 156 | | ||||
| 157 | class MyLogarithmicDoubleValidator : public QDoubleValidator | ||||
| 158 | { | ||||
| 159 | public: | ||||
| 160 | explicit MyLogarithmicDoubleValidator(const int decimals, const qreal defaultValue, QObject *parent = nullptr); | ||||
tbaumgart: Use `nullptr` instead of 0. | |||||
| 161 | | ||||
| 162 | QValidator::State validate(QString &s, int &i) const final Q_DECL_OVERRIDE; | ||||
| 163 | void fixup(QString &input) const final Q_DECL_OVERRIDE; | ||||
| 164 | private: | ||||
| 165 | QString m_defaultText; | ||||
| 166 | }; | ||||
| 148 | #endif /* REPORTTABIMPL_H */ | 167 | #endif /* REPORTTABIMPL_H */ | ||
| 149 | 168 | | |||
Make sure to initialize m_logYaxis in the ctor()