Use less pointers in frontend
This commit is contained in:
@@ -6,14 +6,23 @@
|
||||
#include <QPushButton>
|
||||
#include <QTabWidget>
|
||||
#include <QWidget>
|
||||
#include <QButtonGroup>
|
||||
#include <QFileDialog>
|
||||
#include <QGroupBox>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
class SettingsWindow : public QWidget {
|
||||
QPushButton *cancel = new QPushButton("Cancel");
|
||||
QPushButton *apply = new QPushButton("Apply");
|
||||
QFileIconProvider *iconProv = new QFileIconProvider;
|
||||
QPushButton *folderBtn = new QPushButton(iconProv->icon(QFileIconProvider::Folder), "");
|
||||
QLabel *folderLabelPrefix;
|
||||
QLabel *folderLabel;
|
||||
std::unique_ptr<QPushButton> cancel = std::make_unique<QPushButton>("Cancel");
|
||||
std::unique_ptr<QPushButton> apply = std::make_unique<QPushButton>("Apply");
|
||||
std::unique_ptr<QFileIconProvider> iconProv = std::make_unique<QFileIconProvider>();
|
||||
std::unique_ptr<QPushButton> folderBtn = std::make_unique<QPushButton>(iconProv->icon(QFileIconProvider::Folder), "");
|
||||
std::unique_ptr<QLabel> folderLabelPrefix = std::make_unique<QLabel>("Save files' path: ");
|
||||
std::unique_ptr<QLabel> folderLabel;
|
||||
std::unique_ptr<QHBoxLayout> generalLayout = std::make_unique<QHBoxLayout>();
|
||||
std::unique_ptr<QVBoxLayout> generalLayoutV = std::make_unique<QVBoxLayout>();
|
||||
std::unique_ptr<QTabWidget> tabs = std::make_unique<QTabWidget>();
|
||||
std::unique_ptr<QVBoxLayout> mainLayout = std::make_unique<QVBoxLayout>();
|
||||
std::unique_ptr<QHBoxLayout> buttonsLayout = std::make_unique<QHBoxLayout>();
|
||||
Q_OBJECT
|
||||
public:
|
||||
float getVolumeL() { return float(audioSettings->volumeL->value()) / 100.f; }
|
||||
@@ -21,10 +30,10 @@ public:
|
||||
std::array<Qt::Key, 18> keyMap{};
|
||||
SettingsWindow();
|
||||
nlohmann::json settings;
|
||||
CPUSettings *cpuSettings;
|
||||
AudioSettings *audioSettings;
|
||||
InputSettings *inputSettings;
|
||||
QWidget *generalSettings;
|
||||
std::unique_ptr<CPUSettings> cpuSettings{};
|
||||
std::unique_ptr<AudioSettings> audioSettings{};
|
||||
std::unique_ptr<InputSettings> inputSettings{};
|
||||
std::unique_ptr<QWidget> generalSettings{};
|
||||
Q_SIGNALS:
|
||||
void regrabKeyboard();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user