-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearchLocationDialog.h
More file actions
51 lines (43 loc) · 1.2 KB
/
SearchLocationDialog.h
File metadata and controls
51 lines (43 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//SearchLocationDialog.h
#pragma once
#include <QDialog.h>
#include <QLineEdit>
#include <QLabel.h>
#include <QPushButton>
#include <QListWidget.h>
#include <QString.h>
#include <QMap.h>
#include <QGeoCoordinate.h>
#include <QKeyEvent>
class CSearchLocationDialog : public QDialog
{
Q_OBJECT
//Constructor
public:
explicit CSearchLocationDialog(QWidget* parent = nullptr);
//Methods
public slots:
void handleSearchResults(const QMap<QString, QGeoCoordinate>& results);
signals:
void searchRequested(const QString& searchTerm);
void locationSelected(const QGeoCoordinate& coordinates);
protected:
void showEvent(QShowEvent* event) override; // Declare the override
void keyPressEvent(QKeyEvent* event) override;
private:
void onSearchButtonClicked();
void onOkButtonClicked();
void onSearchTextChanged(const QString& text);
void onResultsListSelectionChanged();
void setupUI();
//Member variables
private:
QLabel* lblSearchText;
QLineEdit* editSearchText;
QPushButton* buttonSearch;
QListWidget* listSearchResults;
QPushButton* buttonOK;
QPushButton* buttonCancel;
bool m_bInitialShow;
QMap<QString, QGeoCoordinate> m_currentResults;
};