File indexing completed on 2024-04-28 03:59:06

0001 /*
0002     SPDX-FileCopyrightText: 2023 Volker Krause <vkrause@kde.org>
0003     SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 #ifndef KLINEEDITEVENTHANDLER_H
0007 #define KLINEEDITEVENTHANDLER_H
0008 
0009 #include <kwidgetsaddons_export.h>
0010 
0011 class QObject;
0012 
0013 /**
0014  * Event-handling utilities for QLineEdit instances.
0015  *
0016  * @since 6.0
0017  */
0018 namespace KLineEditEventHandler
0019 {
0020 /** Do not propagate Return or Enter key presses in line edits.
0021  *
0022  *  QLineEdit::returnPressed() will still be emitted as normal, but the
0023  *  key event isn't propagated further up the widget hierarchy. This is
0024  *  useful to prevent closing a dialog for example.
0025  */
0026 KWIDGETSADDONS_EXPORT void catchReturnKey(QObject *lineEdit);
0027 
0028 /**
0029  * Handle drop events with URLs and replace the current line edit with the
0030  * dropped URL.
0031  */
0032 KWIDGETSADDONS_EXPORT void handleUrlDrops(QObject *lineEdit);
0033 };
0034 
0035 #endif