mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 00:40:09 +00:00
Qt: add fallback path for older versions
This commit is contained in:
parent
ab6a46f2ba
commit
6bc3cd49d5
@ -199,6 +199,11 @@ TableWidget::TableWidget(QWidget *parent) :
|
||||
{
|
||||
}
|
||||
|
||||
bool TableWidget::isEditorOpen()
|
||||
{
|
||||
return (state() == QAbstractItemView::EditingState);
|
||||
}
|
||||
|
||||
void TableWidget::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)
|
||||
@ -1586,8 +1591,13 @@ QTabWidget* MainWindow::browserAndPlaylistTabWidget()
|
||||
|
||||
void MainWindow::onTableWidgetEnterPressed()
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
/* entry is being renamed, ignore this enter press */
|
||||
if (m_tableWidget->isPersistentEditorOpen(m_tableWidget->currentIndex()))
|
||||
#else
|
||||
/* we can only check if any editor at all is open */
|
||||
if (m_tableWidget->isEditorOpen())
|
||||
#endif
|
||||
return;
|
||||
onRunClicked();
|
||||
}
|
||||
|
@ -169,6 +169,7 @@ class TableWidget : public QTableWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
TableWidget(QWidget *parent = 0);
|
||||
bool isEditorOpen();
|
||||
signals:
|
||||
void enterPressed();
|
||||
void deletePressed();
|
||||
|
Loading…
x
Reference in New Issue
Block a user