ff7tk  1.2.0.13
Work with Final Fantasy 7 game data
HexLineEdit.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009 - 2022 Arzel Jérôme <myst6re@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-or-later
3 
4 #pragma once
5 
6 #include <QLineEdit>
7 #include <ff7tkqtwidgets_export.h>
8 
9 class FF7TKQTWIDGETS_EXPORT HexLineEdit : public QLineEdit
10 {
11  Q_OBJECT
12 public:
13  explicit HexLineEdit(QWidget *parent = nullptr);
14  explicit HexLineEdit(const QByteArray &contents, QWidget *parent = nullptr);
15  QByteArray data() const;
16  void setMaxLength(int maxLength);
17 public slots:
18  void setData(const QByteArray &contents);
19 signals:
20  void dataChanged(const QByteArray &data);
21  void dataEdited(const QByteArray &data);
22 private:
23  QString text() const;
24  void setInputMask(const QString &inputMask);
25  bool _noEmit;
26  QString _hexRegEx = QStringLiteral("([A-F]|[0-9]|[a-f])*");
27 private slots:
28  void emitDataEdited();
29  void setText(const QString &);
30 };
HexLineEdit
Definition: HexLineEdit.h:9