Marble

MarbleLineEdit.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// The code in this file is largely based on KDE's KLineEdit class
4// as included in KDE 4.5. See there for its authors:
5// https://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/klineedit_8cpp.html
6//
7// SPDX-FileCopyrightText: 2010, 2012 Dennis Nienhüser <nienhueser@kde.org>
8//
9
10#ifndef MARBLE_MARBLELINEEDIT_H
11#define MARBLE_MARBLELINEEDIT_H
12
13#include "marble_export.h"
14
15#include <QLineEdit>
16
17namespace Marble
18{
19
20class MarbleLineEditPrivate;
21
22/**
23 * A QLineEdit with an embedded clear button. The clear button removes any input
24 * in the line edit when clicked with the left mouse button. It replaces the line
25 * edit input with the current clipboard content on a middle mouse button click.
26 */
27class MARBLE_EXPORT MarbleLineEdit : public QLineEdit
28{
29 Q_OBJECT
30
31public:
32 /** Constructor */
33 explicit MarbleLineEdit(QWidget *parent = nullptr);
34
35 /** Destructor */
36 ~MarbleLineEdit() override;
37
38 void setDecorator(const QPixmap &decorator);
39
40 void setBusy(bool busy);
41
42Q_SIGNALS:
43 /** The clear button was clicked with the left mouse button */
45
46 void decoratorButtonClicked();
47
48protected:
49 void mouseReleaseEvent(QMouseEvent *event) override;
50
51 void resizeEvent(QResizeEvent *event) override;
52
53private Q_SLOTS:
54 void updateClearButtonIcon(const QString &text);
55
56 void updateClearButton();
57
58 void updateProgress();
59
60private:
61 MarbleLineEditPrivate *const d;
62};
63
64} // namespace Marble
65
66#endif // MARBLE_MARBLELINEEDIT_H
A QLineEdit with an embedded clear button.
void clearButtonClicked()
The clear button was clicked with the left mouse button.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:03 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.