Use less pointers in frontend

This commit is contained in:
SimoneN64
2024-09-24 13:05:10 +02:00
parent 60870165d5
commit bd98a3b4ee
16 changed files with 270 additions and 261 deletions

View File

@@ -3,12 +3,25 @@
#include <QLabel>
#include <QPushButton>
#include <QWidget>
#include <QKeyEvent>
#include <QVBoxLayout>
class InputSettings : public QWidget {
bool grabbing = false;
int which_grabbing = -1;
QPushButton *kb_buttons[18];
QLabel *n64_button_labels[18];
std::unique_ptr<QHBoxLayout> AB = std::make_unique<QHBoxLayout>();
std::unique_ptr<QHBoxLayout> ZStart = std::make_unique<QHBoxLayout>();
std::unique_ptr<QHBoxLayout> LR = std::make_unique<QHBoxLayout>();
std::unique_ptr<QHBoxLayout> DupDdown = std::make_unique<QHBoxLayout>();
std::unique_ptr<QHBoxLayout> DleftDright = std::make_unique<QHBoxLayout>();
std::unique_ptr<QHBoxLayout> CupCdown = std::make_unique<QHBoxLayout>();
std::unique_ptr<QHBoxLayout> CleftCright = std::make_unique<QHBoxLayout>();
std::unique_ptr<QHBoxLayout> AupAdown = std::make_unique<QHBoxLayout>();
std::unique_ptr<QHBoxLayout> AleftAright = std::make_unique<QHBoxLayout>();
std::unique_ptr<QVBoxLayout> mainLayout = std::make_unique<QVBoxLayout>();
std::array<std::unique_ptr<QPushButton>, 18> kb_buttons;
std::array<std::unique_ptr<QLabel>, 18> n64_button_labels;
Q_OBJECT
public:
InputSettings(nlohmann::json &);