Start working on settings

This commit is contained in:
SimoneN64
2024-01-22 21:01:16 +01:00
parent cc1cb8b961
commit bc7849c765
3 changed files with 23 additions and 12 deletions

View File

@@ -49,16 +49,6 @@ void KaizenQt::LoadROM(const QString& file_name) noexcept {
emuThread->core->LoadROM(file_name.toStdString()); emuThread->core->LoadROM(file_name.toStdString());
} }
static inline u32 QtKeyToN64Controller(Qt::Key k) {
u32 ret{};
printf("Valore prima: %08X\n", ret);
printf("Valore dopo: %08X\n", ret);
return ret;
}
void KaizenQt::keyPressEvent(QKeyEvent *e) { void KaizenQt::keyPressEvent(QKeyEvent *e) {
emuThread->core->pause = true; emuThread->core->pause = true;
auto k = static_cast<Qt::Key>(e->key()); auto k = static_cast<Qt::Key>(e->key());

View File

@@ -2,6 +2,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QKeyEvent> #include <QKeyEvent>
#include <MainWindow.hpp> #include <MainWindow.hpp>
#include <QSlider>
MainWindowController::MainWindowController() noexcept { MainWindowController::MainWindowController() noexcept {
view.setupUi(this); view.setupUi(this);
@@ -55,4 +56,12 @@ void MainWindowController::ConnectSignalsToSlots() noexcept {
"Kaizen is licensed under the BSD 3-clause license.\n" "Kaizen is licensed under the BSD 3-clause license.\n"
"Nintendo 64 is a registered trademarks of Nintendo Co., Ltd.")); "Nintendo 64 is a registered trademarks of Nintendo Co., Ltd."));
}); });
connect(view.actionSettings, &QAction::triggered, this, [this]() {
auto layout = new QVBoxLayout(this);
layout->addWidget(new QSlider(Qt::Horizontal));
auto settings = new QWidget;
settings->setLayout(layout);
settings->show();
});
} }

View File

@@ -31,7 +31,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="RenderWidget" name="vulkanWidget"/> <widget class="RenderWidget" name="vulkanWidget" native="true"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -41,7 +41,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>800</width>
<height>21</height> <height>22</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">
@@ -55,6 +55,7 @@
<property name="title"> <property name="title">
<string>Emulation</string> <string>Emulation</string>
</property> </property>
<addaction name="actionSettings"/>
<addaction name="actionPause"/> <addaction name="actionPause"/>
<addaction name="actionReset"/> <addaction name="actionReset"/>
<addaction name="actionStop"/> <addaction name="actionStop"/>
@@ -121,6 +122,17 @@
<string>Stop the emulation</string> <string>Stop the emulation</string>
</property> </property>
</action> </action>
<action name="actionSettings">
<property name="text">
<string>Settings</string>
</property>
<property name="toolTip">
<string>Settings</string>
</property>
<property name="statusTip">
<string>Open the settings window</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>