(Qt) Cleanups

This commit is contained in:
twinaphex 2020-05-12 08:02:55 +02:00
parent e8d2ea7a56
commit 3981b1cc82
2 changed files with 13 additions and 26 deletions

View File

@ -41,7 +41,7 @@ extern "C" {
}
#endif
#define CORE_NAME_COLUMN 0
#define CORE_NAME_COLUMN 0
#define CORE_VERSION_COLUMN 1
LoadCoreTableWidget::LoadCoreTableWidget(QWidget *parent) :
@ -150,18 +150,16 @@ void LoadCoreWindow::loadCore(const char *path)
void LoadCoreWindow::onCoreEnterPressed()
{
QTableWidgetItem *selectedCoreItem = NULL;
QString path;
QByteArray pathArray;
const char *pathData = NULL;
QVariantHash hash;
selectedCoreItem = m_table->item(m_table->currentRow(), CORE_NAME_COLUMN);
hash = selectedCoreItem->data(Qt::UserRole).toHash();
path = hash["path"].toString();
const char *pathData = NULL;
QTableWidgetItem *selectedCoreItem =
m_table->item(m_table->currentRow(), CORE_NAME_COLUMN);
QVariantHash hash = selectedCoreItem->data(
Qt::UserRole).toHash();
QString path = hash["path"].toString();
pathArray.append(path);
pathData = pathArray.constData();
pathData = pathArray.constData();
loadCore(pathData);
}

View File

@ -151,13 +151,11 @@ static void scan_finished_handler(retro_task_t *task,
/* https://stackoverflow.com/questions/7246622/how-to-create-a-slider-with-a-non-linear-scale */
static double expScale(double inputValue, double midValue, double maxValue)
{
double returnValue = 0;
double M = maxValue / midValue;
double C = log(pow(M - 1, 2));
double B = maxValue / (exp(C) - 1);
double A = -1 * B;
returnValue = A + B * exp(C * inputValue);
double M = maxValue / midValue;
double C = log(pow(M - 1, 2));
double B = maxValue / (exp(C) - 1);
double A = -1 * B;
double returnValue = A + B * exp(C * inputValue);
return returnValue;
}
@ -2891,15 +2889,6 @@ void MainWindow::updateItemsCount()
void MainWindow::keyPressEvent(QKeyEvent *event)
{
#if 0
if (event->key() == Qt::Key_F5)
{
event->accept();
hide();
return;
}
#endif
QMainWindow::keyPressEvent(event);
}