Marble

SearchInputWidget.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2012 Dennis Nienhüser <[email protected]>
4 // SPDX-FileCopyrightText: 2012 Bernhard Beschow <[email protected]>
5 //
6 
7 #ifndef MARBLE_SEARCHINPUTWIDGET_H
8 #define MARBLE_SEARCHINPUTWIDGET_H
9 
10 #include <QSortFilterProxyModel>
11 
12 #include "MarbleLineEdit.h"
13 #include "MarbleGlobal.h"
14 #include "marble_export.h"
15 
16 class QAbstractItemModel;
17 
18 class QCompleter;
19 class QModelIndex;
20 
21 namespace Marble {
22 
23 class GeoDataCoordinates;
24 
25 class MARBLE_EXPORT SearchInputWidget : public MarbleLineEdit
26 {
27  Q_OBJECT
28 
29 public:
30  explicit SearchInputWidget( QWidget* parent = nullptr );
31 
32  void setCompletionModel( QAbstractItemModel *completionModel );
33 
34 public Q_SLOTS:
35  void disableSearchAnimation();
36 
37 Q_SIGNALS:
38  void search( const QString &searchTerm, SearchMode searchMode );
39 
40  void centerOn( const GeoDataCoordinates &coordinates );
41 
42 private Q_SLOTS:
43  void search();
44 
45  void centerOnSearchSuggestion( const QModelIndex &suggestionIndex );
46 
47  void showDropDownMenu();
48 
49  void setGlobalSearch();
50 
51  void setAreaSearch();
52 
53 private:
54  void updatePlaceholderText();
55 
56  QSortFilterProxyModel m_sortFilter;
57  QCompleter *const m_completer;
58  bool m_areaSearch;
59 };
60 
61 }
62 
63 #endif
SearchMode
Search mode: Global (worldwide) versus area (local, regional) search.
Definition: MarbleGlobal.h:172
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:28 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.