Hex offsets

Hex offsets Git Source Tree

Root/mainwindow.hpp

1/*
2 Copyright (C) 2017 Grégory Soutadé
3
4 This file is part of Hex offsets.
5
6 Hex offsets is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 Hex offsets is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Hex offsets. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef MAINWINDOW_HPP
21#define MAINWINDOW_HPP
22
23#include <QMainWindow>
24#include <QPushButton>
25#include <QLineEdit>
26#include <QCheckBox>
27#include <uientry.hpp>
28
29namespace Ui {
30class MainWindow;
31}
32
33class MainWindow : public QMainWindow
34{
35 Q_OBJECT
36
37public:
38 explicit MainWindow(QWidget *parent = 0, int entriesNumber = 4);
39 ~MainWindow();
40
41private slots:
42 void on_lineBase_textChanged(const QString &arg1);
43
44 void on_buttonCopyClipboard_clicked();
45
46 void on_lineDec_textChanged(const QString &arg1);
47
48 void on_lineHex_textChanged(const QString &arg1);
49
50 void on_buttonClearBase_clicked();
51
52 void on_buttonClearAll_clicked();
53
54 void on_spinUIEntries_valueChanged(int arg1);
55
56private:
57 Ui::MainWindow *ui;
58 QFont normalFont, errorFont;
59 QPalette blackPalette, redPalette;
60 void addValue(QLineEdit* line, UIEntry* entry, long* result, int base=16);
61 void setTextValue(QLineEdit* line, long value, int base=16);
62 bool editConversion;
63 std::vector<UIEntry*> entries;
64 int entriesNumber;
65
66public:
67 void computeResult(void);
68 void getValue(QLineEdit* line, long* result, int base);
69};
70
71#endif // MAINWINDOW_HPP

Archive Download this file

Branches