game_list: fix deprecation warning

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
This commit is contained in:
Megamouse 2021-01-07 19:07:38 +01:00 committed by Ivan
parent 1ad0f24ecd
commit ed1b8f2545

View File

@ -12,14 +12,7 @@ class game_list : public QTableWidget
private:
void mousePressEvent(QMouseEvent *event) override
{
#ifndef _MSC_VER
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
if (!indexAt(event->pos()).isValid() || itemAt(event->pos())->data(Qt::UserRole) < 0)
#ifndef _MSC_VER
#pragma GCC diagnostic pop
#endif
if (!indexAt(event->pos()).isValid() || !itemAt(event->pos())->data(Qt::UserRole).isValid())
{
clearSelection();
setCurrentItem(nullptr); // Needed for currentItemChanged