forked from KDE/kcalc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kcalc_history.h
45 lines (33 loc) · 888 Bytes
/
kcalc_history.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
SPDX-FileCopyrightText: 2021 Antonio Prcela <antonio.prcela@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef KCALC_HISTORY_H_
#define KCALC_HISTORY_H_
#include <QTextEdit>
/*
This class provides a history display.
*/
class KCalcHistory : public QTextEdit
{
Q_OBJECT
public:
explicit KCalcHistory(QWidget *parent = nullptr);
~KCalcHistory() override;
void addToHistory(const QString &, bool);
void addResultToHistory(const QString &);
void addFuncToHistory(const QString &);
void changeSettings();
void setFont(const QFont &font);
const QFont &baseFont() const;
public Q_SLOTS:
void clearHistory();
protected:
void resizeEvent(QResizeEvent *event) override;
private:
bool add_new_line_ = false;
QFont baseFont_;
double idealPointSizeF_;
void updateFont(double zoomFactor = 1.0);
};
#endif