File indexing completed on 2024-12-22 04:28:09

0001 /*
0002   SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
0003 
0004   SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "autocorrectionlistwidget.h"
0008 
0009 #include <QKeyEvent>
0010 
0011 using namespace TextAutoCorrectionWidgets;
0012 
0013 AutoCorrectionListWidget::AutoCorrectionListWidget(QWidget *parent)
0014     : QListWidget(parent)
0015 {
0016 }
0017 
0018 AutoCorrectionListWidget::~AutoCorrectionListWidget() = default;
0019 
0020 void AutoCorrectionListWidget::keyPressEvent(QKeyEvent *event)
0021 {
0022     if (event->key() == Qt::Key_Delete) {
0023         Q_EMIT deleteSelectedItems();
0024     }
0025     QListWidget::keyPressEvent(event);
0026 }
0027 
0028 #include "moc_autocorrectionlistwidget.cpp"