mirror of
https://github.com/simple64/simple64.git
synced 2026-11-17 10:54:02 +01:00
move files
This commit is contained in:
1 parent
8905684837
commit
8e8583c042
72 files changed
+1
-1
No files matched your search
@@ -0,0 +1,39 @@
|
||||
#include "settingclasses.h"
|
||||
#include "common.h"
|
||||
#include "interface/core_commands.h"
|
||||
#include <SDL.h>
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
CustomLineEdit::CustomLineEdit(QWidget *parent)
|
||||
: QLineEdit(parent)
|
||||
{
|
||||
connect(this, &QLineEdit::editingFinished, [=](){
|
||||
int i_value = this->text().toInt();
|
||||
float f_value = this->text().toFloat();
|
||||
switch (m_ParamType) {
|
||||
case M64TYPE_INT:
|
||||
(*ConfigSetParameter)(m_CurrentHandle, m_ParamName.toUtf8().constData(), m_ParamType, &i_value);
|
||||
break;
|
||||
case M64TYPE_FLOAT:
|
||||
(*ConfigSetParameter)(m_CurrentHandle, m_ParamName.toUtf8().constData(), m_ParamType, &f_value);
|
||||
break;
|
||||
case M64TYPE_STRING:
|
||||
(*ConfigSetParameter)(m_CurrentHandle, m_ParamName.toUtf8().constData(), m_ParamType, this->text().toUtf8().constData());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
(*ConfigSaveFile)();
|
||||
});
|
||||
}
|
||||
|
||||
CustomCheckBox::CustomCheckBox(QWidget *parent)
|
||||
: QCheckBox(parent)
|
||||
{
|
||||
connect(this, &QCheckBox::stateChanged, [=](int state){
|
||||
int value = state == Qt::Checked ? 1 : 0;
|
||||
(*ConfigSetParameter)(m_CurrentHandle, m_ParamName.toUtf8().constData(), m_ParamType, &value);
|
||||
(*ConfigSaveFile)();
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user