mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-03-22 21:25:19 +01:00
We only need to check if the data is valid for clicks on empty space in the game grid. I don't remember why I initially checked < 0
23 lines
486 B
C++
23 lines
486 B
C++
#pragma once
|
|
|
|
#include <QTableWidget>
|
|
#include <QMouseEvent>
|
|
|
|
/*
|
|
class used in order to get deselection
|
|
if you know a simpler way, tell @Megamouse
|
|
*/
|
|
class game_list : public QTableWidget
|
|
{
|
|
private:
|
|
void mousePressEvent(QMouseEvent *event) override
|
|
{
|
|
if (!indexAt(event->pos()).isValid() || !itemAt(event->pos())->data(Qt::UserRole).isValid())
|
|
{
|
|
clearSelection();
|
|
setCurrentItem(nullptr); // Needed for currentItemChanged
|
|
}
|
|
QTableWidget::mousePressEvent(event);
|
|
}
|
|
};
|