swift
src
gui
components
dbcountryselectorcomponent.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6
#ifndef SWIFT_GUI_DBCOUNTRYSELECTORCOMPONENT_H
7
#define SWIFT_GUI_DBCOUNTRYSELECTORCOMPONENT_H
8
9
#include <QFrame>
10
#include <QObject>
11
#include <QScopedPointer>
12
#include <QString>
13
14
#include "gui/dropbase.h"
15
#include "
gui/swiftguiexport.h
"
16
#include "
misc/country.h
"
17
#include "
misc/network/entityflags.h
"
18
19
class
QCompleter
;
20
class
QDragEnterEvent
;
21
class
QDragLeaveEvent
;
22
class
QDragMoveEvent
;
23
class
QDropEvent
;
24
class
QWidget
;
25
26
namespace
Ui
27
{
28
class
CDbCountrySelectorComponent;
29
}
30
namespace
swift::gui::components
31
{
35
class
SWIFT_GUI_EXPORT
CDbCountrySelectorComponent
:
public
QFrame
,
public
swift::gui::CDropBase
36
{
37
Q_OBJECT
38
39
public
:
41
explicit
CDbCountrySelectorComponent
(
QWidget
*parent =
nullptr
);
42
44
~
CDbCountrySelectorComponent
()
override
;
45
47
void
setCountry(
const
swift::misc::CCountry
&country);
48
50
void
setCountry(
const
QString
&isoCode);
51
53
swift::misc::CCountry
getCountry()
const
;
54
56
void
setReadOnly(
bool
readOnly);
57
59
bool
isSet()
const
;
60
62
void
clear();
63
64
signals:
66
void
countryChanged
(
const
swift::misc::CCountry
&country);
67
68
protected
:
70
virtual
void
dragEnterEvent(
QDragEnterEvent
*event)
override
;
71
73
virtual
void
dragMoveEvent(
QDragMoveEvent
*event)
override
;
74
76
virtual
void
dragLeaveEvent(
QDragLeaveEvent
*event)
override
;
77
79
virtual
void
dropEvent(
QDropEvent
*event)
override
;
80
81
private
:
83
void
onCountriesRead(swift::misc::network::CEntityFlags::Entity entity,
84
swift::misc::network::CEntityFlags::ReadState
readState,
int
count);
85
87
void
onDataChanged();
88
90
void
onCompleterActivated(
const
QString
&countryName);
91
92
QScopedPointer<Ui::CDbCountrySelectorComponent>
ui;
93
QScopedPointer<QCompleter>
m_completerCountryNames;
94
swift::misc::CCountry
m_currentCountry;
95
};
96
}
// namespace swift::gui::components
97
#endif
// SWIFT_GUI_DBCOUNTRYSELECTORCOMPONENT_H
swift::gui::CDropBase
Utilities for dropping swift value objects.
Definition:
dropbase.h:19
swift::gui::components::CDbCountrySelectorComponent
Country selector.
Definition:
dbcountryselectorcomponent.h:36
swift::gui::components::CDbCountrySelectorComponent::countryChanged
void countryChanged(const swift::misc::CCountry &country)
Country has been changed.
swift::misc::CCountry
Color.
Definition:
country.h:27
swift::misc::network::CEntityFlags::ReadState
ReadState
State of operation.
Definition:
entityflags.h:61
country.h
entityflags.h
swift::gui::components
High level reusable GUI components.
Definition:
aboutdialog.cpp:13
QCompleter
QDragEnterEvent
QDragLeaveEvent
QDragMoveEvent
QDropEvent
QFrame
QScopedPointer< Ui::CDbCountrySelectorComponent >
QString
QWidget
swiftguiexport.h
SWIFT_GUI_EXPORT
#define SWIFT_GUI_EXPORT
Export a class or function from the library.
Definition:
swiftguiexport.h:19
Generated on Sun Oct 12 2025 20:05:10 for swift by
1.9.1