From 1bfe48de7512a1f80a721c89127f1491641fd7a7 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sun, 10 Sep 2017 12:59:21 +0300 Subject: [PATCH] Style change again --- include/AvatarProvider.h | 20 +- include/Config.h | 24 +- include/Deserializable.h | 38 +- include/EmojiCategory.h | 24 +- include/EmojiItemDelegate.h | 12 +- include/EmojiPanel.h | 38 +- include/EmojiPickButton.h | 20 +- include/EmojiProvider.h | 24 +- include/ImageItem.h | 48 +- include/ImageOverlayDialog.h | 22 +- include/InputValidator.h | 10 +- include/Login.h | 38 +- include/LoginPage.h | 82 +- include/LogoutDialog.h | 10 +- include/MainWindow.h | 74 +- include/Profile.h | 14 +- include/QuickSwitcher.h | 42 +- include/Register.h | 38 +- include/RegisterPage.h | 50 +- include/RoomInfoListItem.h | 89 +- include/RoomList.h | 40 +- include/RoomMessages.h | 20 +- include/RoomSettings.h | 44 +- include/SlidingStackWidget.h | 65 +- include/Splitter.h | 12 +- include/Sync.h | 114 +- include/TrayIcon.h | 24 +- include/UserInfoWidget.h | 48 +- include/Versions.h | 16 +- include/WelcomePage.h | 32 +- include/events/AliasesEventContent.h | 10 +- include/events/AvatarEventContent.h | 10 +- include/events/CanonicalAliasEventContent.h | 10 +- include/events/CreateEventContent.h | 12 +- include/events/Event.h | 156 +- .../events/HistoryVisibilityEventContent.h | 18 +- include/events/JoinRulesEventContent.h | 28 +- include/events/MemberEventContent.h | 42 +- include/events/MessageEvent.h | 20 +- include/events/MessageEventContent.h | 46 +- include/events/NameEventContent.h | 10 +- include/events/PowerLevelsEventContent.h | 60 +- include/events/RoomEvent.h | 70 +- include/events/StateEvent.h | 42 +- include/events/TopicEventContent.h | 10 +- include/events/messages/Audio.h | 20 +- include/events/messages/Emote.h | 2 +- include/events/messages/File.h | 28 +- include/events/messages/Image.h | 26 +- include/events/messages/Location.h | 18 +- include/events/messages/Notice.h | 2 +- include/events/messages/Text.h | 2 +- include/events/messages/Video.h | 28 +- include/ui/Avatar.h | 50 +- include/ui/Badge.h | 74 +- include/ui/CircularProgress.h | 100 +- include/ui/DropShadow.h | 174 +- include/ui/FlatButton.h | 227 +- include/ui/Menu.h | 34 +- include/ui/OverlayModal.h | 26 +- include/ui/OverlayWidget.h | 10 +- include/ui/RaisedButton.h | 20 +- include/ui/Ripple.h | 100 +- include/ui/RippleOverlay.h | 40 +- include/ui/ScrollBar.h | 32 +- include/ui/TextField.h | 162 +- include/ui/Theme.h | 40 +- include/ui/ThemeManager.h | 20 +- src/AvatarProvider.cc | 60 +- src/Deserializable.cc | 2 +- src/EmojiCategory.cc | 80 +- src/EmojiItemDelegate.cc | 22 +- src/EmojiPanel.cc | 317 +- src/EmojiPickButton.cc | 44 +- src/EmojiProvider.cc | 2847 +++++++++-------- src/ImageItem.cc | 182 +- src/ImageOverlayDialog.cc | 122 +- src/InputValidator.cc | 3 +- src/Login.cc | 46 +- src/LoginPage.cc | 369 +-- src/LogoutDialog.cc | 48 +- src/MainWindow.cc | 256 +- src/Profile.cc | 14 +- src/QuickSwitcher.cc | 149 +- src/Register.cc | 28 +- src/RegisterPage.cc | 217 +- src/RoomInfoListItem.cc | 337 +- src/RoomList.cc | 201 +- src/RoomMessages.cc | 28 +- src/SlidingStackWidget.cc | 152 +- src/Splitter.cc | 80 +- src/Sync.cc | 190 +- src/TrayIcon.cc | 96 +- src/UserInfoWidget.cc | 177 +- src/Versions.cc | 45 +- src/WelcomePage.cc | 99 +- src/events/AliasesEventContent.cc | 30 +- src/events/AvatarEventContent.cc | 24 +- src/events/CanonicalAliasEventContent.cc | 20 +- src/events/CreateEventContent.cc | 20 +- src/events/Event.cc | 66 +- src/events/HistoryVisibilityEventContent.cc | 55 +- src/events/JoinRulesEventContent.cc | 53 +- src/events/MemberEventContent.cc | 81 +- src/events/MessageEventContent.cc | 62 +- src/events/NameEventContent.cc | 20 +- src/events/PowerLevelsEventContent.cc | 100 +- src/events/TopicEventContent.cc | 20 +- src/events/messages/Audio.cc | 22 +- src/events/messages/Emote.cc | 4 +- src/events/messages/File.cc | 40 +- src/events/messages/Image.cc | 40 +- src/events/messages/Location.cc | 32 +- src/events/messages/Notice.cc | 4 +- src/events/messages/Text.cc | 4 +- src/events/messages/Video.cc | 42 +- src/main.cc | 68 +- src/ui/Avatar.cc | 148 +- src/ui/Badge.cc | 170 +- src/ui/CircularProgress.cc | 190 +- src/ui/FlatButton.cc | 673 ++-- src/ui/OverlayModal.cc | 50 +- src/ui/OverlayWidget.cc | 68 +- src/ui/RaisedButton.cc | 98 +- src/ui/Ripple.cc | 72 +- src/ui/RippleOverlay.cc | 46 +- src/ui/ScrollBar.cc | 96 +- src/ui/TextField.cc | 373 +-- src/ui/Theme.cc | 56 +- src/ui/ThemeManager.cc | 10 +- 130 files changed, 6039 insertions(+), 5940 deletions(-) diff --git a/include/AvatarProvider.h b/include/AvatarProvider.h index 29c8152b..0a37ffb9 100644 --- a/include/AvatarProvider.h +++ b/include/AvatarProvider.h @@ -27,21 +27,21 @@ class AvatarProvider : public QObject { - Q_OBJECT + Q_OBJECT public: - static void init(QSharedPointer client); - static void resolve(const QString &userId, TimelineItem *item); - static void setAvatarUrl(const QString &userId, const QUrl &url); + static void init(QSharedPointer client); + static void resolve(const QString &userId, TimelineItem *item); + static void setAvatarUrl(const QString &userId, const QUrl &url); - static void clear(); + static void clear(); private: - static void updateAvatar(const QString &uid, const QImage &img); + static void updateAvatar(const QString &uid, const QImage &img); - static QSharedPointer client_; - static QMap> toBeResolved_; + static QSharedPointer client_; + static QMap> toBeResolved_; - static QMap userAvatars_; - static QMap avatarUrls_; + static QMap userAvatars_; + static QMap avatarUrls_; }; diff --git a/include/Config.h b/include/Config.h index 2fdeef83..654eadb6 100644 --- a/include/Config.h +++ b/include/Config.h @@ -7,24 +7,24 @@ namespace conf { // Global settings. -static const int fontSize = 12; -static const int emojiSize = 14; +static const int fontSize = 12; +static const int emojiSize = 14; static const int headerFontSize = 21; // Window geometry. namespace window { static const int height = 600; -static const int width = 1066; +static const int width = 1066; static const int minHeight = 600; -static const int minWidth = 950; +static const int minWidth = 950; } // Button settings. namespace btn { -static const int fontSize = 20; +static const int fontSize = 20; static const int cornerRadius = 3; } @@ -34,8 +34,8 @@ namespace roomlist namespace fonts { static const int heading = 13; -static const int badge = 10; -static const int bubble = 20; +static const int badge = 10; +static const int bubble = 20; } // namespace fonts } // namespace roomlist @@ -44,7 +44,7 @@ namespace userInfoWidget namespace fonts { static const int displayName = 16; -static const int userid = 14; +static const int userid = 14; } // namespace fonts } // namespace userInfoWidget @@ -52,16 +52,16 @@ namespace topRoomBar { namespace fonts { -static const int roomName = 15; +static const int roomName = 15; static const int roomDescription = 13; } // namespace fonts } // namespace topRoomBar namespace timeline { -static const int msgMargin = 11; -static const int avatarSize = 36; -static const int headerSpacing = 5; +static const int msgMargin = 11; +static const int avatarSize = 36; +static const int headerSpacing = 5; static const int headerLeftMargin = 15; namespace fonts diff --git a/include/Deserializable.h b/include/Deserializable.h index afd4f26c..938238b9 100644 --- a/include/Deserializable.h +++ b/include/Deserializable.h @@ -26,36 +26,36 @@ class DeserializationException : public std::exception { public: - explicit DeserializationException(const std::string &msg); - virtual const char *what() const noexcept; + explicit DeserializationException(const std::string &msg); + virtual const char *what() const noexcept; private: - std::string msg_; + std::string msg_; }; // JSON response structs need to implement the interface. class Deserializable { public: - virtual void deserialize(const QJsonValue &) - { - } - virtual void deserialize(const QJsonObject &) - { - } - virtual void deserialize(const QJsonDocument &) - { - } - virtual ~Deserializable() - { - } + virtual void deserialize(const QJsonValue &) + { + } + virtual void deserialize(const QJsonObject &) + { + } + virtual void deserialize(const QJsonDocument &) + { + } + virtual ~Deserializable() + { + } }; class Serializable { public: - virtual QJsonObject serialize() const = 0; - virtual ~Serializable() - { - } + virtual QJsonObject serialize() const = 0; + virtual ~Serializable() + { + } }; diff --git a/include/EmojiCategory.h b/include/EmojiCategory.h index 3a4e4e1e..e17b110b 100644 --- a/include/EmojiCategory.h +++ b/include/EmojiCategory.h @@ -29,32 +29,32 @@ class EmojiCategory : public QWidget { - Q_OBJECT + Q_OBJECT public: - EmojiCategory(QString category, QList emoji, QWidget *parent = nullptr); - ~EmojiCategory(); + EmojiCategory(QString category, QList emoji, QWidget *parent = nullptr); + ~EmojiCategory(); signals: - void emojiSelected(const QString &emoji); + void emojiSelected(const QString &emoji); private slots: - inline void clickIndex(const QModelIndex &); + inline void clickIndex(const QModelIndex &); private: - QVBoxLayout *mainLayout_; + QVBoxLayout *mainLayout_; - QStandardItemModel *itemModel_; - QListView *emojiListView_; + QStandardItemModel *itemModel_; + QListView *emojiListView_; - Emoji *data_; - EmojiItemDelegate *delegate_; + Emoji *data_; + EmojiItemDelegate *delegate_; - QLabel *category_; + QLabel *category_; }; inline void EmojiCategory::clickIndex(const QModelIndex &index) { - emit emojiSelected(index.data(Qt::UserRole).toString()); + emit emojiSelected(index.data(Qt::UserRole).toString()); } diff --git a/include/EmojiItemDelegate.h b/include/EmojiItemDelegate.h index d99fe2b6..15d61f49 100644 --- a/include/EmojiItemDelegate.h +++ b/include/EmojiItemDelegate.h @@ -25,14 +25,16 @@ class EmojiItemDelegate : public QStyledItemDelegate { - Q_OBJECT + Q_OBJECT public: - explicit EmojiItemDelegate(QObject *parent = nullptr); - ~EmojiItemDelegate(); + explicit EmojiItemDelegate(QObject *parent = nullptr); + ~EmojiItemDelegate(); - void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; + void paint(QPainter *painter, + const QStyleOptionViewItem &option, + const QModelIndex &index) const override; private: - Emoji *data_; + Emoji *data_; }; diff --git a/include/EmojiPanel.h b/include/EmojiPanel.h index 14b7692a..360e7006 100644 --- a/include/EmojiPanel.h +++ b/include/EmojiPanel.h @@ -27,38 +27,38 @@ class EmojiPanel : public QWidget { - Q_OBJECT + Q_OBJECT public: - EmojiPanel(QWidget *parent = nullptr); + EmojiPanel(QWidget *parent = nullptr); - void fadeOut(); - void fadeIn(); + void fadeOut(); + void fadeIn(); signals: - void mouseLeft(); - void emojiSelected(const QString &emoji); + void mouseLeft(); + void emojiSelected(const QString &emoji); protected: - void leaveEvent(QEvent *event); - void paintEvent(QPaintEvent *event); + void leaveEvent(QEvent *event); + void paintEvent(QPaintEvent *event); private: - void showEmojiCategory(const EmojiCategory *category); + void showEmojiCategory(const EmojiCategory *category); - QPropertyAnimation *animation_; - QGraphicsOpacityEffect *opacity_; + QPropertyAnimation *animation_; + QGraphicsOpacityEffect *opacity_; - EmojiProvider emoji_provider_; + EmojiProvider emoji_provider_; - QScrollArea *scrollArea_; + QScrollArea *scrollArea_; - int shadowMargin_; + int shadowMargin_; - // Panel dimensions. - int width_; - int height_; + // Panel dimensions. + int width_; + int height_; - int animationDuration_; - int categoryIconSize_; + int animationDuration_; + int categoryIconSize_; }; diff --git a/include/EmojiPickButton.h b/include/EmojiPickButton.h index 840aa5dd..041e25a6 100644 --- a/include/EmojiPickButton.h +++ b/include/EmojiPickButton.h @@ -25,23 +25,23 @@ class EmojiPickButton : public FlatButton { - Q_OBJECT + Q_OBJECT public: - explicit EmojiPickButton(QWidget *parent = nullptr); + explicit EmojiPickButton(QWidget *parent = nullptr); signals: - void emojiSelected(const QString &emoji); + void emojiSelected(const QString &emoji); protected: - void enterEvent(QEvent *e) override; - void leaveEvent(QEvent *e) override; + void enterEvent(QEvent *e) override; + void leaveEvent(QEvent *e) override; private: - // Vertical distance from panel's bottom. - int vertical_distance_ = 10; + // Vertical distance from panel's bottom. + int vertical_distance_ = 10; - // Horizontal distance from panel's bottom right corner. - int horizontal_distance_ = 70; + // Horizontal distance from panel's bottom right corner. + int horizontal_distance_ = 70; - EmojiPanel *panel_; + EmojiPanel *panel_; }; diff --git a/include/EmojiProvider.h b/include/EmojiProvider.h index 40360c96..5b6f7c88 100644 --- a/include/EmojiProvider.h +++ b/include/EmojiProvider.h @@ -22,21 +22,21 @@ #include struct Emoji { - // Unicode code. - QString unicode; - // Keyboard shortcut e.g :emoji: - QString shortname; + // Unicode code. + QString unicode; + // Keyboard shortcut e.g :emoji: + QString shortname; }; class EmojiProvider { public: - static const QList people; - static const QList nature; - static const QList food; - static const QList activity; - static const QList travel; - static const QList objects; - static const QList symbols; - static const QList flags; + static const QList people; + static const QList nature; + static const QList food; + static const QList activity; + static const QList travel; + static const QList objects; + static const QList symbols; + static const QList flags; }; diff --git a/include/ImageItem.h b/include/ImageItem.h index 5953c6e5..e37e04b2 100644 --- a/include/ImageItem.h +++ b/include/ImageItem.h @@ -26,47 +26,47 @@ #include "MatrixClient.h" namespace events = matrix::events; -namespace msgs = matrix::events::messages; +namespace msgs = matrix::events::messages; class ImageItem : public QWidget { - Q_OBJECT + Q_OBJECT public: - ImageItem(QSharedPointer client, - const events::MessageEvent &event, - QWidget *parent = nullptr); + ImageItem(QSharedPointer client, + const events::MessageEvent &event, + QWidget *parent = nullptr); - void setImage(const QPixmap &image); + void setImage(const QPixmap &image); - QSize sizeHint() const override; + QSize sizeHint() const override; protected: - void paintEvent(QPaintEvent *event) override; - void mousePressEvent(QMouseEvent *event) override; - void resizeEvent(QResizeEvent *event) override; + void paintEvent(QPaintEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void resizeEvent(QResizeEvent *event) override; private slots: - void imageDownloaded(const QString &event_id, const QPixmap &img); + void imageDownloaded(const QString &event_id, const QPixmap &img); private: - void scaleImage(); - void openUrl(); + void scaleImage(); + void openUrl(); - int max_width_ = 500; - int max_height_ = 300; + int max_width_ = 500; + int max_height_ = 300; - int width_; - int height_; + int width_; + int height_; - QPixmap scaled_image_; - QPixmap image_; + QPixmap scaled_image_; + QPixmap image_; - QUrl url_; - QString text_; + QUrl url_; + QString text_; - int bottom_height_ = 30; + int bottom_height_ = 30; - events::MessageEvent event_; + events::MessageEvent event_; - QSharedPointer client_; + QSharedPointer client_; }; diff --git a/include/ImageOverlayDialog.h b/include/ImageOverlayDialog.h index 287b2d1b..5159c665 100644 --- a/include/ImageOverlayDialog.h +++ b/include/ImageOverlayDialog.h @@ -23,24 +23,24 @@ class ImageOverlayDialog : public QWidget { - Q_OBJECT + Q_OBJECT public: - ImageOverlayDialog(QPixmap image, QWidget *parent = nullptr); + ImageOverlayDialog(QPixmap image, QWidget *parent = nullptr); protected: - void mousePressEvent(QMouseEvent *event) override; - void paintEvent(QPaintEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void paintEvent(QPaintEvent *event) override; signals: - void closing(); + void closing(); private: - void scaleImage(int width, int height); + void scaleImage(int width, int height); - QPixmap originalImage_; - QPixmap image_; + QPixmap originalImage_; + QPixmap image_; - QRect content_; - QRect close_button_; - QRect screen_; + QRect content_; + QRect close_button_; + QRect screen_; }; diff --git a/include/InputValidator.h b/include/InputValidator.h index 0d3e52ab..4f77033e 100644 --- a/include/InputValidator.h +++ b/include/InputValidator.h @@ -23,9 +23,9 @@ class InputValidator { public: - // Validators for the different types of input. - static QRegExpValidator Id; - static QRegExpValidator Localpart; - static QRegExpValidator Password; - static QRegExpValidator Domain; + // Validators for the different types of input. + static QRegExpValidator Id; + static QRegExpValidator Localpart; + static QRegExpValidator Password; + static QRegExpValidator Domain; }; diff --git a/include/Login.h b/include/Login.h index 09f62a71..ceca4ebf 100644 --- a/include/Login.h +++ b/include/Login.h @@ -24,60 +24,60 @@ class LoginRequest { public: - LoginRequest(); - LoginRequest(QString username, QString password); + LoginRequest(); + LoginRequest(QString username, QString password); - QByteArray serialize() noexcept; + QByteArray serialize() noexcept; - inline void setPassword(QString password); - inline void setUser(QString username); + inline void setPassword(QString password); + inline void setUser(QString username); private: - QString user_; - QString password_; + QString user_; + QString password_; }; inline void LoginRequest::setPassword(QString password) { - password_ = password; + password_ = password; } inline void LoginRequest::setUser(QString username) { - user_ = username; + user_ = username; } class LoginResponse : public Deserializable { public: - void deserialize(const QJsonDocument &data) override; + void deserialize(const QJsonDocument &data) override; - inline QString getAccessToken(); - inline QString getHomeServer(); - inline QString getUserId(); + inline QString getAccessToken(); + inline QString getHomeServer(); + inline QString getUserId(); private: - QString access_token_; - QString home_server_; - QString user_id_; + QString access_token_; + QString home_server_; + QString user_id_; }; inline QString LoginResponse::getAccessToken() { - return access_token_; + return access_token_; } inline QString LoginResponse::getHomeServer() { - return home_server_; + return home_server_; } inline QString LoginResponse::getUserId() { - return user_id_; + return user_id_; } diff --git a/include/LoginPage.h b/include/LoginPage.h index ef0a6e9e..db852e2c 100644 --- a/include/LoginPage.h +++ b/include/LoginPage.h @@ -32,68 +32,68 @@ class LoginPage : public QWidget { - Q_OBJECT + Q_OBJECT public: - LoginPage(QSharedPointer client, QWidget *parent = 0); - ~LoginPage(); + LoginPage(QSharedPointer client, QWidget *parent = 0); + ~LoginPage(); - void reset(); + void reset(); signals: - void backButtonClicked(); + void backButtonClicked(); private slots: - // Callback for the back button. - void onBackButtonClicked(); + // Callback for the back button. + void onBackButtonClicked(); - // Callback for the login button. - void onLoginButtonClicked(); + // Callback for the login button. + void onLoginButtonClicked(); - // Callback for probing the server found in the mxid - void onMatrixIdEntered(); + // Callback for probing the server found in the mxid + void onMatrixIdEntered(); - // Callback for probing the manually entered server - void onServerAddressEntered(); + // Callback for probing the manually entered server + void onServerAddressEntered(); - // Displays errors produced during the login. - void loginError(QString error_message); + // Displays errors produced during the login. + void loginError(QString error_message); - // Callback for errors produced during server probing - void versionError(QString error_message); + // Callback for errors produced during server probing + void versionError(QString error_message); - // Callback for successful server probing - void versionSuccess(); + // Callback for successful server probing + void versionSuccess(); private: - bool isMatrixIdValid(); + bool isMatrixIdValid(); - QVBoxLayout *top_layout_; + QVBoxLayout *top_layout_; - QHBoxLayout *top_bar_layout_; - QHBoxLayout *logo_layout_; - QHBoxLayout *button_layout_; + QHBoxLayout *top_bar_layout_; + QHBoxLayout *logo_layout_; + QHBoxLayout *button_layout_; - QLabel *logo_; - QLabel *error_label_; + QLabel *logo_; + QLabel *error_label_; - QHBoxLayout *serverLayout_; - QHBoxLayout *matrixidLayout_; - CircularProgress *spinner_; - QLabel *errorIcon_; - QString inferredServerAddress_; + QHBoxLayout *serverLayout_; + QHBoxLayout *matrixidLayout_; + CircularProgress *spinner_; + QLabel *errorIcon_; + QString inferredServerAddress_; - FlatButton *back_button_; - RaisedButton *login_button_; + FlatButton *back_button_; + RaisedButton *login_button_; - QWidget *form_widget_; - QHBoxLayout *form_wrapper_; - QVBoxLayout *form_layout_; + QWidget *form_widget_; + QHBoxLayout *form_wrapper_; + QVBoxLayout *form_layout_; - TextField *matrixid_input_; - TextField *password_input_; - TextField *serverInput_; + TextField *matrixid_input_; + TextField *password_input_; + TextField *serverInput_; - // Matrix client API provider. - QSharedPointer client_; + // Matrix client API provider. + QSharedPointer client_; }; diff --git a/include/LogoutDialog.h b/include/LogoutDialog.h index a2d313c7..44dab17a 100644 --- a/include/LogoutDialog.h +++ b/include/LogoutDialog.h @@ -23,14 +23,14 @@ class LogoutDialog : public QFrame { - Q_OBJECT + Q_OBJECT public: - explicit LogoutDialog(QWidget *parent = nullptr); + explicit LogoutDialog(QWidget *parent = nullptr); signals: - void closing(bool isLoggingOut); + void closing(bool isLoggingOut); private: - FlatButton *confirmBtn_; - FlatButton *cancelBtn_; + FlatButton *confirmBtn_; + FlatButton *cancelBtn_; }; diff --git a/include/MainWindow.h b/include/MainWindow.h index a8a86719..6f1d6e3e 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -32,64 +32,64 @@ class MainWindow : public QMainWindow { - Q_OBJECT + Q_OBJECT public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); - static MainWindow *instance(); - void saveCurrentWindowSize(); + static MainWindow *instance(); + void saveCurrentWindowSize(); protected: - void closeEvent(QCloseEvent *event); + void closeEvent(QCloseEvent *event); private slots: - // Handle interaction with the tray icon. - void iconActivated(QSystemTrayIcon::ActivationReason reason); + // Handle interaction with the tray icon. + void iconActivated(QSystemTrayIcon::ActivationReason reason); - // Show the welcome page in the main window. - void showWelcomePage(); + // Show the welcome page in the main window. + void showWelcomePage(); - // Show the login page in the main window. - void showLoginPage(); + // Show the login page in the main window. + void showLoginPage(); - // Show the register page in the main window. - void showRegisterPage(); + // Show the register page in the main window. + void showRegisterPage(); - // Show the chat page and start communicating with the given access token. - void showChatPage(QString user_id, QString home_server, QString token); + // Show the chat page and start communicating with the given access token. + void showChatPage(QString user_id, QString home_server, QString token); - void removeOverlayProgressBar(); + void removeOverlayProgressBar(); private: - bool hasActiveUser(); - void restoreWindowSize(); + bool hasActiveUser(); + void restoreWindowSize(); - static MainWindow *instance_; + static MainWindow *instance_; - // The initial welcome screen. - WelcomePage *welcome_page_; + // The initial welcome screen. + WelcomePage *welcome_page_; - // The login screen. - LoginPage *login_page_; + // The login screen. + LoginPage *login_page_; - // The register page. - RegisterPage *register_page_; + // The register page. + RegisterPage *register_page_; - // A stacked widget that handles the transitions between widgets. - SlidingStackWidget *sliding_stack_; + // A stacked widget that handles the transitions between widgets. + SlidingStackWidget *sliding_stack_; - // The main chat area. - ChatPage *chat_page_; + // The main chat area. + ChatPage *chat_page_; - // Used to hide undefined states between page transitions. - OverlayModal *progress_modal_; - CircularProgress *spinner_; + // Used to hide undefined states between page transitions. + OverlayModal *progress_modal_; + CircularProgress *spinner_; - // Matrix Client API provider. - QSharedPointer client_; + // Matrix Client API provider. + QSharedPointer client_; - // Tray icon that shows the unread message count. - TrayIcon *trayIcon_; + // Tray icon that shows the unread message count. + TrayIcon *trayIcon_; }; diff --git a/include/Profile.h b/include/Profile.h index 7bb3deaa..c460efbb 100644 --- a/include/Profile.h +++ b/include/Profile.h @@ -25,24 +25,24 @@ class ProfileResponse : public Deserializable { public: - void deserialize(const QJsonDocument &data) override; + void deserialize(const QJsonDocument &data) override; - inline QUrl getAvatarUrl(); - inline QString getDisplayName(); + inline QUrl getAvatarUrl(); + inline QString getDisplayName(); private: - QUrl avatar_url_; - QString display_name_; + QUrl avatar_url_; + QString display_name_; }; inline QUrl ProfileResponse::getAvatarUrl() { - return avatar_url_; + return avatar_url_; } inline QString ProfileResponse::getDisplayName() { - return display_name_; + return display_name_; } diff --git a/include/QuickSwitcher.h b/include/QuickSwitcher.h index 6a7875f9..5cbd0f1f 100644 --- a/include/QuickSwitcher.h +++ b/include/QuickSwitcher.h @@ -26,44 +26,44 @@ class RoomSearchInput : public TextField { - Q_OBJECT + Q_OBJECT public: - explicit RoomSearchInput(QWidget *parent = nullptr); + explicit RoomSearchInput(QWidget *parent = nullptr); signals: - void selectNextCompletion(); - void selectPreviousCompletion(); - void hiding(); + void selectNextCompletion(); + void selectPreviousCompletion(); + void hiding(); protected: - void keyPressEvent(QKeyEvent *event) override; - void hideEvent(QHideEvent *event) override; - bool focusNextPrevChild(bool next) override; + void keyPressEvent(QKeyEvent *event) override; + void hideEvent(QHideEvent *event) override; + bool focusNextPrevChild(bool next) override; }; class QuickSwitcher : public QFrame { - Q_OBJECT + Q_OBJECT public: - explicit QuickSwitcher(QWidget *parent = nullptr); + explicit QuickSwitcher(QWidget *parent = nullptr); - void setRoomList(const QMap &rooms); + void setRoomList(const QMap &rooms); signals: - void closing(); - void roomSelected(const QString &roomid); + void closing(); + void roomSelected(const QString &roomid); protected: - void keyPressEvent(QKeyEvent *event) override; - void showEvent(QShowEvent *event) override; + void keyPressEvent(QKeyEvent *event) override; + void showEvent(QShowEvent *event) override; private: - // Current highlighted selection from the completer. - int selection_ = -1; + // Current highlighted selection from the completer. + int selection_ = -1; - QVBoxLayout *topLayout_; - RoomSearchInput *roomSearch_; - QCompleter *completer_; + QVBoxLayout *topLayout_; + RoomSearchInput *roomSearch_; + QCompleter *completer_; - QMap rooms_; + QMap rooms_; }; diff --git a/include/Register.h b/include/Register.h index 695595a8..eb3a3d81 100644 --- a/include/Register.h +++ b/include/Register.h @@ -24,60 +24,60 @@ class RegisterRequest { public: - RegisterRequest(); - RegisterRequest(const QString &username, const QString &password); + RegisterRequest(); + RegisterRequest(const QString &username, const QString &password); - QByteArray serialize() noexcept; + QByteArray serialize() noexcept; - inline void setPassword(QString password); - inline void setUser(QString username); + inline void setPassword(QString password); + inline void setUser(QString username); private: - QString user_; - QString password_; + QString user_; + QString password_; }; inline void RegisterRequest::setPassword(QString password) { - password_ = password; + password_ = password; } inline void RegisterRequest::setUser(QString username) { - user_ = username; + user_ = username; } class RegisterResponse : public Deserializable { public: - void deserialize(const QJsonDocument &data) override; + void deserialize(const QJsonDocument &data) override; - inline QString getAccessToken(); - inline QString getHomeServer(); - inline QString getUserId(); + inline QString getAccessToken(); + inline QString getHomeServer(); + inline QString getUserId(); private: - QString access_token_; - QString home_server_; - QString user_id_; + QString access_token_; + QString home_server_; + QString user_id_; }; inline QString RegisterResponse::getAccessToken() { - return access_token_; + return access_token_; } inline QString RegisterResponse::getHomeServer() { - return home_server_; + return home_server_; } inline QString RegisterResponse::getUserId() { - return user_id_; + return user_id_; } diff --git a/include/RegisterPage.h b/include/RegisterPage.h index 417aa6de..a42cbedd 100644 --- a/include/RegisterPage.h +++ b/include/RegisterPage.h @@ -31,44 +31,44 @@ class RegisterPage : public QWidget { - Q_OBJECT + Q_OBJECT public: - RegisterPage(QSharedPointer client, QWidget *parent = 0); - ~RegisterPage(); + RegisterPage(QSharedPointer client, QWidget *parent = 0); + ~RegisterPage(); signals: - void backButtonClicked(); + void backButtonClicked(); private slots: - void onBackButtonClicked(); - void onRegisterButtonClicked(); + void onBackButtonClicked(); + void onRegisterButtonClicked(); - // Display registration specific errors to the user. - void registerError(const QString &msg); + // Display registration specific errors to the user. + void registerError(const QString &msg); private: - QVBoxLayout *top_layout_; + QVBoxLayout *top_layout_; - QHBoxLayout *back_layout_; - QHBoxLayout *logo_layout_; - QHBoxLayout *button_layout_; + QHBoxLayout *back_layout_; + QHBoxLayout *logo_layout_; + QHBoxLayout *button_layout_; - Avatar *logo_; - QLabel *error_label_; + Avatar *logo_; + QLabel *error_label_; - FlatButton *back_button_; - RaisedButton *register_button_; + FlatButton *back_button_; + RaisedButton *register_button_; - QWidget *form_widget_; - QHBoxLayout *form_wrapper_; - QVBoxLayout *form_layout_; + QWidget *form_widget_; + QHBoxLayout *form_wrapper_; + QVBoxLayout *form_layout_; - TextField *username_input_; - TextField *password_input_; - TextField *password_confirmation_; - TextField *server_input_; + TextField *username_input_; + TextField *password_input_; + TextField *password_confirmation_; + TextField *server_input_; - // Matrix client API provider. - QSharedPointer client_; + // Matrix client API provider. + QSharedPointer client_; }; diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h index b368ab64..21001a9c 100644 --- a/include/RoomInfoListItem.h +++ b/include/RoomInfoListItem.h @@ -27,99 +27,102 @@ #include "RoomState.h" struct DescInfo { - QString username; - QString userid; - QString body; - QString timestamp; + QString username; + QString userid; + QString body; + QString timestamp; }; class RoomInfoListItem : public QWidget { - Q_OBJECT + Q_OBJECT public: - RoomInfoListItem(QSharedPointer settings, RoomState state, QString room_id, QWidget *parent = 0); + RoomInfoListItem(QSharedPointer settings, + RoomState state, + QString room_id, + QWidget *parent = 0); - ~RoomInfoListItem(); + ~RoomInfoListItem(); - void updateUnreadMessageCount(int count); - void clearUnreadMessageCount(); - void setState(const RoomState &state); + void updateUnreadMessageCount(int count); + void clearUnreadMessageCount(); + void setState(const RoomState &state); - inline bool isPressed() const; - inline RoomState state() const; - inline void setAvatar(const QImage &avatar_image); - inline int unreadMessageCount() const; - inline void setDescriptionMessage(const DescInfo &info); + inline bool isPressed() const; + inline RoomState state() const; + inline void setAvatar(const QImage &avatar_image); + inline int unreadMessageCount() const; + inline void setDescriptionMessage(const DescInfo &info); signals: - void clicked(const QString &room_id); + void clicked(const QString &room_id); public slots: - void setPressedState(bool state); + void setPressedState(bool state); protected: - void mousePressEvent(QMouseEvent *event) override; - void paintEvent(QPaintEvent *event) override; - void resizeEvent(QResizeEvent *event) override; - void contextMenuEvent(QContextMenuEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void paintEvent(QPaintEvent *event) override; + void resizeEvent(QResizeEvent *event) override; + void contextMenuEvent(QContextMenuEvent *event) override; private: - QString notificationText(); + QString notificationText(); - const int Padding = 7; - const int IconSize = 48; + const int Padding = 7; + const int IconSize = 48; - RippleOverlay *ripple_overlay_; + RippleOverlay *ripple_overlay_; - RoomState state_; + RoomState state_; - QString roomId_; - QString roomName_; + QString roomId_; + QString roomName_; - DescInfo lastMsgInfo_; + DescInfo lastMsgInfo_; - QPixmap roomAvatar_; + QPixmap roomAvatar_; - Menu *menu_; - QAction *toggleNotifications_; + Menu *menu_; + QAction *toggleNotifications_; - QSharedPointer roomSettings_; + QSharedPointer roomSettings_; - bool isPressed_ = false; + bool isPressed_ = false; - int maxHeight_; - int unreadMsgCount_ = 0; + int maxHeight_; + int unreadMsgCount_ = 0; }; inline int RoomInfoListItem::unreadMessageCount() const { - return unreadMsgCount_; + return unreadMsgCount_; } inline bool RoomInfoListItem::isPressed() const { - return isPressed_; + return isPressed_; } inline RoomState RoomInfoListItem::state() const { - return state_; + return state_; } inline void RoomInfoListItem::setAvatar(const QImage &img) { - roomAvatar_ = - QPixmap::fromImage(img.scaled(IconSize, IconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - update(); + roomAvatar_ = QPixmap::fromImage( + img.scaled(IconSize, IconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + update(); } inline void RoomInfoListItem::setDescriptionMessage(const DescInfo &info) { - lastMsgInfo_ = info; + lastMsgInfo_ = info; } diff --git a/include/RoomList.h b/include/RoomList.h index f548400d..573f43a8 100644 --- a/include/RoomList.h +++ b/include/RoomList.h @@ -29,37 +29,37 @@ class RoomList : public QWidget { - Q_OBJECT + Q_OBJECT public: - RoomList(QSharedPointer client, QWidget *parent = 0); - ~RoomList(); + RoomList(QSharedPointer client, QWidget *parent = 0); + ~RoomList(); - void setInitialRooms(const QMap> &settings, - const QMap &states); - void sync(const QMap &states); + void setInitialRooms(const QMap> &settings, + const QMap &states); + void sync(const QMap &states); - void clear(); + void clear(); signals: - void roomChanged(const QString &room_id); - void totalUnreadMessageCountUpdated(int count); + void roomChanged(const QString &room_id); + void totalUnreadMessageCountUpdated(int count); public slots: - void updateRoomAvatar(const QString &roomid, const QPixmap &img); - void highlightSelectedRoom(const QString &room_id); - void updateUnreadMessageCount(const QString &roomid, int count); - void updateRoomDescription(const QString &roomid, const DescInfo &info); + void updateRoomAvatar(const QString &roomid, const QPixmap &img); + void highlightSelectedRoom(const QString &room_id); + void updateUnreadMessageCount(const QString &roomid, int count); + void updateRoomDescription(const QString &roomid, const DescInfo &info); private: - void calculateUnreadMessageCount(); + void calculateUnreadMessageCount(); - QVBoxLayout *topLayout_; - QVBoxLayout *contentsLayout_; - QScrollArea *scrollArea_; - QWidget *scrollAreaContents_; + QVBoxLayout *topLayout_; + QVBoxLayout *contentsLayout_; + QScrollArea *scrollArea_; + QWidget *scrollAreaContents_; - QMap> rooms_; + QMap> rooms_; - QSharedPointer client_; + QSharedPointer client_; }; diff --git a/include/RoomMessages.h b/include/RoomMessages.h index 1321ac8e..89d546a8 100644 --- a/include/RoomMessages.h +++ b/include/RoomMessages.h @@ -25,32 +25,32 @@ class RoomMessages : public Deserializable { public: - void deserialize(const QJsonDocument &data) override; + void deserialize(const QJsonDocument &data) override; - inline QString start() const; - inline QString end() const; - inline QJsonArray chunk() const; + inline QString start() const; + inline QString end() const; + inline QJsonArray chunk() const; private: - QString start_; - QString end_; - QJsonArray chunk_; + QString start_; + QString end_; + QJsonArray chunk_; }; inline QString RoomMessages::start() const { - return start_; + return start_; } inline QString RoomMessages::end() const { - return end_; + return end_; } inline QJsonArray RoomMessages::chunk() const { - return chunk_; + return chunk_; } diff --git a/include/RoomSettings.h b/include/RoomSettings.h index ee74b9eb..d9ecff99 100644 --- a/include/RoomSettings.h +++ b/include/RoomSettings.h @@ -22,34 +22,34 @@ class RoomSettings { public: - RoomSettings(QString room_id) - { - path_ = QString("notifications/%1").arg(room_id); - isNotificationsEnabled_ = true; + RoomSettings(QString room_id) + { + path_ = QString("notifications/%1").arg(room_id); + isNotificationsEnabled_ = true; - QSettings settings; + QSettings settings; - if (settings.contains(path_)) - isNotificationsEnabled_ = settings.value(path_).toBool(); - else - settings.setValue(path_, isNotificationsEnabled_); - }; + if (settings.contains(path_)) + isNotificationsEnabled_ = settings.value(path_).toBool(); + else + settings.setValue(path_, isNotificationsEnabled_); + }; - bool isNotificationsEnabled() - { - return isNotificationsEnabled_; - }; + bool isNotificationsEnabled() + { + return isNotificationsEnabled_; + }; - void toggleNotifications() - { - isNotificationsEnabled_ = !isNotificationsEnabled_; + void toggleNotifications() + { + isNotificationsEnabled_ = !isNotificationsEnabled_; - QSettings settings; - settings.setValue(path_, isNotificationsEnabled_); - } + QSettings settings; + settings.setValue(path_, isNotificationsEnabled_); + } private: - QString path_; + QString path_; - bool isNotificationsEnabled_; + bool isNotificationsEnabled_; }; diff --git a/include/SlidingStackWidget.h b/include/SlidingStackWidget.h index 51903678..c2f329d6 100644 --- a/include/SlidingStackWidget.h +++ b/include/SlidingStackWidget.h @@ -32,56 +32,57 @@ class SlidingStackWidget : public QStackedWidget { - Q_OBJECT + Q_OBJECT public: - // Defines the animation direction. - enum class AnimationDirection { LEFT_TO_RIGHT, RIGHT_TO_LEFT, AUTOMATIC }; + // Defines the animation direction. + enum class AnimationDirection { LEFT_TO_RIGHT, RIGHT_TO_LEFT, AUTOMATIC }; - SlidingStackWidget(QWidget *parent); - ~SlidingStackWidget(); + SlidingStackWidget(QWidget *parent); + ~SlidingStackWidget(); public slots: - // Move to the next widget. - void slideInNext(); + // Move to the next widget. + void slideInNext(); - // Move to the previous widget. - void slideInPrevious(); + // Move to the previous widget. + void slideInPrevious(); - // Move to a widget by index. - void slideInIndex(int index, AnimationDirection direction = AnimationDirection::AUTOMATIC); + // Move to a widget by index. + void slideInIndex(int index, AnimationDirection direction = AnimationDirection::AUTOMATIC); - int getWidgetIndex(QWidget *widget); + int getWidgetIndex(QWidget *widget); signals: - // Internal signal to alert the engine for the animation's end. - void animationFinished(); + // Internal signal to alert the engine for the animation's end. + void animationFinished(); protected slots: - // Internal slot to handle the end of the animation. - void onAnimationFinished(); + // Internal slot to handle the end of the animation. + void onAnimationFinished(); protected: - // The method that does the main work for the widget transition. - void slideInWidget(QWidget *widget, AnimationDirection direction = AnimationDirection::AUTOMATIC); + // The method that does the main work for the widget transition. + void slideInWidget(QWidget *widget, + AnimationDirection direction = AnimationDirection::AUTOMATIC); - // Indicates whether or not the animation is active. - bool active_; + // Indicates whether or not the animation is active. + bool active_; - // The widget currently displayed. - QWidget *window_; + // The widget currently displayed. + QWidget *window_; - // The speed of the animation in milliseconds. - int speed_; + // The speed of the animation in milliseconds. + int speed_; - // The animation type. - QEasingCurve::Type animation_type_; + // The animation type. + QEasingCurve::Type animation_type_; - // Current widget's index. - int now_; + // Current widget's index. + int now_; - // Reference point. - QPoint current_position_; + // Reference point. + QPoint current_position_; - // Next widget's to show index. - int next_; + // Next widget's to show index. + int next_; }; diff --git a/include/Splitter.h b/include/Splitter.h index fdaca8f7..5591fe55 100644 --- a/include/Splitter.h +++ b/include/Splitter.h @@ -21,15 +21,15 @@ class Splitter : public QSplitter { - Q_OBJECT + Q_OBJECT public: - explicit Splitter(QWidget *parent = nullptr); + explicit Splitter(QWidget *parent = nullptr); private: - void onSplitterMoved(int pos, int index); + void onSplitterMoved(int pos, int index); - int moveEventLimit_ = 50; + int moveEventLimit_ = 50; - int leftMoveCount_ = 0; - int rightMoveCount_ = 0; + int leftMoveCount_ = 0; + int rightMoveCount_ = 0; }; diff --git a/include/Sync.h b/include/Sync.h index da81344e..420c9b6c 100644 --- a/include/Sync.h +++ b/include/Sync.h @@ -27,187 +27,187 @@ class Event : public Deserializable { public: - inline QJsonObject content() const; - inline QJsonObject unsigned_content() const; + inline QJsonObject content() const; + inline QJsonObject unsigned_content() const; - inline QString sender() const; - inline QString state_key() const; - inline QString type() const; - inline QString eventId() const; + inline QString sender() const; + inline QString state_key() const; + inline QString type() const; + inline QString eventId() const; - inline uint64_t timestamp() const; + inline uint64_t timestamp() const; - void deserialize(const QJsonValue &data) override; + void deserialize(const QJsonValue &data) override; private: - QJsonObject content_; - QJsonObject unsigned_; + QJsonObject content_; + QJsonObject unsigned_; - QString sender_; - QString state_key_; - QString type_; - QString event_id_; + QString sender_; + QString state_key_; + QString type_; + QString event_id_; - uint64_t origin_server_ts_; + uint64_t origin_server_ts_; }; inline QJsonObject Event::content() const { - return content_; + return content_; } inline QJsonObject Event::unsigned_content() const { - return unsigned_; + return unsigned_; } inline QString Event::sender() const { - return sender_; + return sender_; } inline QString Event::state_key() const { - return state_key_; + return state_key_; } inline QString Event::type() const { - return type_; + return type_; } inline QString Event::eventId() const { - return event_id_; + return event_id_; } inline uint64_t Event::timestamp() const { - return origin_server_ts_; + return origin_server_ts_; } class State : public Deserializable { public: - void deserialize(const QJsonValue &data) override; - inline QJsonArray events() const; + void deserialize(const QJsonValue &data) override; + inline QJsonArray events() const; private: - QJsonArray events_; + QJsonArray events_; }; inline QJsonArray State::events() const { - return events_; + return events_; } class Timeline : public Deserializable { public: - inline QJsonArray events() const; - inline QString previousBatch() const; - inline bool limited() const; + inline QJsonArray events() const; + inline QString previousBatch() const; + inline bool limited() const; - void deserialize(const QJsonValue &data) override; + void deserialize(const QJsonValue &data) override; private: - QJsonArray events_; - QString prev_batch_; - bool limited_; + QJsonArray events_; + QString prev_batch_; + bool limited_; }; inline QJsonArray Timeline::events() const { - return events_; + return events_; } inline QString Timeline::previousBatch() const { - return prev_batch_; + return prev_batch_; } inline bool Timeline::limited() const { - return limited_; + return limited_; } // TODO: Add support for ehpmeral, account_data, undread_notifications class JoinedRoom : public Deserializable { public: - inline State state() const; - inline Timeline timeline() const; + inline State state() const; + inline Timeline timeline() const; - void deserialize(const QJsonValue &data) override; + void deserialize(const QJsonValue &data) override; private: - State state_; - Timeline timeline_; - /* Ephemeral ephemeral_; */ - /* AccountData account_data_; */ - /* UnreadNotifications unread_notifications_; */ + State state_; + Timeline timeline_; + /* Ephemeral ephemeral_; */ + /* AccountData account_data_; */ + /* UnreadNotifications unread_notifications_; */ }; inline State JoinedRoom::state() const { - return state_; + return state_; } inline Timeline JoinedRoom::timeline() const { - return timeline_; + return timeline_; } // TODO: Add support for invited and left rooms. class Rooms : public Deserializable { public: - inline QMap join() const; - void deserialize(const QJsonValue &data) override; + inline QMap join() const; + void deserialize(const QJsonValue &data) override; private: - QMap join_; + QMap join_; }; inline QMap Rooms::join() const { - return join_; + return join_; } class SyncResponse : public Deserializable { public: - void deserialize(const QJsonDocument &data) override; - inline QString nextBatch() const; - inline Rooms rooms() const; + void deserialize(const QJsonDocument &data) override; + inline QString nextBatch() const; + inline Rooms rooms() const; private: - QString next_batch_; - Rooms rooms_; + QString next_batch_; + Rooms rooms_; }; inline Rooms SyncResponse::rooms() const { - return rooms_; + return rooms_; } inline QString SyncResponse::nextBatch() const { - return next_batch_; + return next_batch_; } diff --git a/include/TrayIcon.h b/include/TrayIcon.h index 7fe46ad3..2c9020c1 100644 --- a/include/TrayIcon.h +++ b/include/TrayIcon.h @@ -28,31 +28,31 @@ class MsgCountComposedIcon : public QIconEngine { public: - MsgCountComposedIcon(const QString &filename); + MsgCountComposedIcon(const QString &filename); - virtual void paint(QPainter *p, const QRect &rect, QIcon::Mode mode, QIcon::State state); - virtual QIconEngine *clone() const; + virtual void paint(QPainter *p, const QRect &rect, QIcon::Mode mode, QIcon::State state); + virtual QIconEngine *clone() const; - int msgCount = 0; + int msgCount = 0; private: - const int BubbleDiameter = 17; + const int BubbleDiameter = 17; - QIcon icon_; + QIcon icon_; }; class TrayIcon : public QSystemTrayIcon { - Q_OBJECT + Q_OBJECT public: - TrayIcon(const QString &filename, QWidget *parent); + TrayIcon(const QString &filename, QWidget *parent); public slots: - void setUnreadCount(int count); + void setUnreadCount(int count); private: - QAction *viewAction_; - QAction *quitAction_; + QAction *viewAction_; + QAction *quitAction_; - MsgCountComposedIcon *icon_; + MsgCountComposedIcon *icon_; }; diff --git a/include/UserInfoWidget.h b/include/UserInfoWidget.h index 10c770d8..25dc2265 100644 --- a/include/UserInfoWidget.h +++ b/include/UserInfoWidget.h @@ -29,47 +29,47 @@ class UserInfoWidget : public QWidget { - Q_OBJECT + Q_OBJECT public: - UserInfoWidget(QWidget *parent = 0); - ~UserInfoWidget(); + UserInfoWidget(QWidget *parent = 0); + ~UserInfoWidget(); - void setAvatar(const QImage &img); - void setDisplayName(const QString &name); - void setUserId(const QString &userid); + void setAvatar(const QImage &img); + void setDisplayName(const QString &name); + void setUserId(const QString &userid); - void reset(); + void reset(); signals: - void logout(); + void logout(); protected: - void resizeEvent(QResizeEvent *event) override; + void resizeEvent(QResizeEvent *event) override; private slots: - void closeLogoutDialog(bool isLoggingOut); + void closeLogoutDialog(bool isLoggingOut); private: - Avatar *userAvatar_; + Avatar *userAvatar_; - QHBoxLayout *topLayout_; - QHBoxLayout *avatarLayout_; - QVBoxLayout *textLayout_; - QHBoxLayout *buttonLayout_; + QHBoxLayout *topLayout_; + QHBoxLayout *avatarLayout_; + QVBoxLayout *textLayout_; + QHBoxLayout *buttonLayout_; - FlatButton *logoutButton_; + FlatButton *logoutButton_; - QLabel *displayNameLabel_; - QLabel *userIdLabel_; + QLabel *displayNameLabel_; + QLabel *userIdLabel_; - QString display_name_; - QString user_id_; + QString display_name_; + QString user_id_; - QImage avatar_image_; + QImage avatar_image_; - OverlayModal *logoutModal_; - LogoutDialog *logoutDialog_; + OverlayModal *logoutModal_; + LogoutDialog *logoutDialog_; - int logoutButtonSize_; + int logoutButtonSize_; }; diff --git a/include/Versions.h b/include/Versions.h index d751fd9a..62584eb7 100644 --- a/include/Versions.h +++ b/include/Versions.h @@ -25,16 +25,16 @@ class VersionsResponse : public Deserializable { public: - void deserialize(const QJsonDocument &data) override; + void deserialize(const QJsonDocument &data) override; - bool isVersionSupported(unsigned int major, unsigned int minor, unsigned int patch); + bool isVersionSupported(unsigned int major, unsigned int minor, unsigned int patch); private: - struct Version_ { - unsigned int major_; - unsigned int minor_; - unsigned int patch_; - }; + struct Version_ { + unsigned int major_; + unsigned int minor_; + unsigned int patch_; + }; - QVector supported_versions_; + QVector supported_versions_; }; diff --git a/include/WelcomePage.h b/include/WelcomePage.h index 13d9d141..bef463c6 100644 --- a/include/WelcomePage.h +++ b/include/WelcomePage.h @@ -27,32 +27,32 @@ class WelcomePage : public QWidget { - Q_OBJECT + Q_OBJECT public: - explicit WelcomePage(QWidget *parent = 0); - ~WelcomePage(); + explicit WelcomePage(QWidget *parent = 0); + ~WelcomePage(); signals: - // Notify that the user wants to login in. - void userLogin(); + // Notify that the user wants to login in. + void userLogin(); - // Notify that the user wants to register. - void userRegister(); + // Notify that the user wants to register. + void userRegister(); private slots: - void onLoginButtonClicked(); - void onRegisterButtonClicked(); + void onLoginButtonClicked(); + void onRegisterButtonClicked(); private: - QVBoxLayout *top_layout_; - QHBoxLayout *button_layout_; + QVBoxLayout *top_layout_; + QHBoxLayout *button_layout_; - QLabel *intro_banner_; - QLabel *intro_text_; + QLabel *intro_banner_; + QLabel *intro_text_; - QSpacerItem *button_spacer_; + QSpacerItem *button_spacer_; - RaisedButton *register_button_; - RaisedButton *login_button_; + RaisedButton *register_button_; + RaisedButton *login_button_; }; diff --git a/include/events/AliasesEventContent.h b/include/events/AliasesEventContent.h index bd7f8f9f..a60da9e8 100644 --- a/include/events/AliasesEventContent.h +++ b/include/events/AliasesEventContent.h @@ -31,19 +31,19 @@ class AliasesEventContent , public Serializable { public: - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; - inline QList aliases() const; + inline QList aliases() const; private: - QList aliases_; + QList aliases_; }; inline QList AliasesEventContent::aliases() const { - return aliases_; + return aliases_; } } // namespace events } // namespace matrix diff --git a/include/events/AvatarEventContent.h b/include/events/AvatarEventContent.h index 03347e26..d46f0420 100644 --- a/include/events/AvatarEventContent.h +++ b/include/events/AvatarEventContent.h @@ -35,19 +35,19 @@ class AvatarEventContent , public Serializable { public: - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; - inline QUrl url() const; + inline QUrl url() const; private: - QUrl url_; + QUrl url_; }; inline QUrl AvatarEventContent::url() const { - return url_; + return url_; } } // namespace events } // namespace matrix diff --git a/include/events/CanonicalAliasEventContent.h b/include/events/CanonicalAliasEventContent.h index bc08bcce..210e4a34 100644 --- a/include/events/CanonicalAliasEventContent.h +++ b/include/events/CanonicalAliasEventContent.h @@ -37,19 +37,19 @@ class CanonicalAliasEventContent , public Serializable { public: - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; - inline QString alias() const; + inline QString alias() const; private: - QString alias_; + QString alias_; }; inline QString CanonicalAliasEventContent::alias() const { - return alias_; + return alias_; } } // namespace events } // namespace matrix diff --git a/include/events/CreateEventContent.h b/include/events/CreateEventContent.h index 0a401dac..dcea5fd5 100644 --- a/include/events/CreateEventContent.h +++ b/include/events/CreateEventContent.h @@ -34,20 +34,20 @@ class CreateEventContent , public Serializable { public: - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; - inline QString creator() const; + inline QString creator() const; private: - // The user_id of the room creator. This is set by the homeserver. - QString creator_; + // The user_id of the room creator. This is set by the homeserver. + QString creator_; }; inline QString CreateEventContent::creator() const { - return creator_; + return creator_; } } // namespace events } // namespace matrix diff --git a/include/events/Event.h b/include/events/Event.h index d48c20c6..c6d2da2f 100644 --- a/include/events/Event.h +++ b/include/events/Event.h @@ -27,30 +27,30 @@ namespace matrix namespace events { enum class EventType { - /// m.room.aliases - RoomAliases, - /// m.room.avatar - RoomAvatar, - /// m.room.canonical_alias - RoomCanonicalAlias, - /// m.room.create - RoomCreate, - /// m.room.history_visibility - RoomHistoryVisibility, - /// m.room.join_rules - RoomJoinRules, - /// m.room.member - RoomMember, - /// m.room.message - RoomMessage, - /// m.room.name - RoomName, - /// m.room.power_levels - RoomPowerLevels, - /// m.room.topic - RoomTopic, - // Unsupported event - Unsupported, + /// m.room.aliases + RoomAliases, + /// m.room.avatar + RoomAvatar, + /// m.room.canonical_alias + RoomCanonicalAlias, + /// m.room.create + RoomCreate, + /// m.room.history_visibility + RoomHistoryVisibility, + /// m.room.join_rules + RoomJoinRules, + /// m.room.member + RoomMember, + /// m.room.message + RoomMessage, + /// m.room.name + RoomName, + /// m.room.power_levels + RoomPowerLevels, + /// m.room.topic + RoomTopic, + // Unsupported event + Unsupported, }; EventType @@ -67,92 +67,92 @@ class Event , public Serializable { public: - inline Content content() const; - inline EventType eventType() const; + inline Content content() const; + inline EventType eventType() const; - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; private: - Content content_; - EventType type_; + Content content_; + EventType type_; }; template inline Content Event::content() const { - return content_; + return content_; } template inline EventType Event::eventType() const { - return type_; + return type_; } template void Event::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("Event is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("Event is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - content_.deserialize(object.value("content")); - type_ = extractEventType(object); + content_.deserialize(object.value("content")); + type_ = extractEventType(object); } template QJsonObject Event::serialize() const { - QJsonObject object; + QJsonObject object; - switch (type_) { - case EventType::RoomAliases: - object["type"] = "m.room.aliases"; - break; - case EventType::RoomAvatar: - object["type"] = "m.room.avatar"; - break; - case EventType::RoomCanonicalAlias: - object["type"] = "m.room.canonical_alias"; - break; - case EventType::RoomCreate: - object["type"] = "m.room.create"; - break; - case EventType::RoomHistoryVisibility: - object["type"] = "m.room.history_visibility"; - break; - case EventType::RoomJoinRules: - object["type"] = "m.room.join_rules"; - break; - case EventType::RoomMember: - object["type"] = "m.room.member"; - break; - case EventType::RoomMessage: - object["type"] = "m.room.message"; - break; - case EventType::RoomName: - object["type"] = "m.room.name"; - break; - case EventType::RoomPowerLevels: - object["type"] = "m.room.power_levels"; - break; - case EventType::RoomTopic: - object["type"] = "m.room.topic"; - break; - case EventType::Unsupported: - qWarning() << "Unsupported type to serialize"; - break; - } + switch (type_) { + case EventType::RoomAliases: + object["type"] = "m.room.aliases"; + break; + case EventType::RoomAvatar: + object["type"] = "m.room.avatar"; + break; + case EventType::RoomCanonicalAlias: + object["type"] = "m.room.canonical_alias"; + break; + case EventType::RoomCreate: + object["type"] = "m.room.create"; + break; + case EventType::RoomHistoryVisibility: + object["type"] = "m.room.history_visibility"; + break; + case EventType::RoomJoinRules: + object["type"] = "m.room.join_rules"; + break; + case EventType::RoomMember: + object["type"] = "m.room.member"; + break; + case EventType::RoomMessage: + object["type"] = "m.room.message"; + break; + case EventType::RoomName: + object["type"] = "m.room.name"; + break; + case EventType::RoomPowerLevels: + object["type"] = "m.room.power_levels"; + break; + case EventType::RoomTopic: + object["type"] = "m.room.topic"; + break; + case EventType::Unsupported: + qWarning() << "Unsupported type to serialize"; + break; + } - object["content"] = content_.serialize(); + object["content"] = content_.serialize(); - return object; + return object; } } // namespace events } // namespace matrix diff --git a/include/events/HistoryVisibilityEventContent.h b/include/events/HistoryVisibilityEventContent.h index d854a775..53405087 100644 --- a/include/events/HistoryVisibilityEventContent.h +++ b/include/events/HistoryVisibilityEventContent.h @@ -26,10 +26,10 @@ namespace matrix namespace events { enum class HistoryVisibility { - Invited, - Joined, - Shared, - WorldReadable, + Invited, + Joined, + Shared, + WorldReadable, }; class HistoryVisibilityEventContent @@ -37,19 +37,19 @@ class HistoryVisibilityEventContent , public Serializable { public: - inline HistoryVisibility historyVisibility() const; + inline HistoryVisibility historyVisibility() const; - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; private: - HistoryVisibility history_visibility_; + HistoryVisibility history_visibility_; }; inline HistoryVisibility HistoryVisibilityEventContent::historyVisibility() const { - return history_visibility_; + return history_visibility_; } } // namespace events } // namespace matrix diff --git a/include/events/JoinRulesEventContent.h b/include/events/JoinRulesEventContent.h index 702bba98..738be9d3 100644 --- a/include/events/JoinRulesEventContent.h +++ b/include/events/JoinRulesEventContent.h @@ -26,18 +26,18 @@ namespace matrix namespace events { enum class JoinRule { - // A user who wishes to join the room must first receive - // an invite to the room from someone already inside of the room. - Invite, + // A user who wishes to join the room must first receive + // an invite to the room from someone already inside of the room. + Invite, - // Reserved but not yet implemented by the Matrix specification. - Knock, + // Reserved but not yet implemented by the Matrix specification. + Knock, - // Reserved but not yet implemented by the Matrix specification. - Private, + // Reserved but not yet implemented by the Matrix specification. + Private, - /// Anyone can join the room without any prior action. - Public, + /// Anyone can join the room without any prior action. + Public, }; /* @@ -49,19 +49,19 @@ class JoinRulesEventContent , public Serializable { public: - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; - inline JoinRule joinRule() const; + inline JoinRule joinRule() const; private: - JoinRule join_rule_; + JoinRule join_rule_; }; inline JoinRule JoinRulesEventContent::joinRule() const { - return join_rule_; + return join_rule_; } } // namespace events } // namespace matrix diff --git a/include/events/MemberEventContent.h b/include/events/MemberEventContent.h index 2dd133ea..5af19218 100644 --- a/include/events/MemberEventContent.h +++ b/include/events/MemberEventContent.h @@ -27,20 +27,20 @@ namespace matrix namespace events { enum class Membership { - // The user is banned. - Ban, + // The user is banned. + Ban, - // The user has been invited. - Invite, + // The user has been invited. + Invite, - // The user has joined. - Join, + // The user has joined. + Join, - // The user has requested to join. - Knock, + // The user has requested to join. + Knock, - // The user has left. - Leave, + // The user has left. + Leave, }; /* @@ -52,35 +52,35 @@ class MemberEventContent , public Serializable { public: - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; - inline QUrl avatarUrl() const; - inline QString displayName() const; - inline Membership membershipState() const; + inline QUrl avatarUrl() const; + inline QString displayName() const; + inline Membership membershipState() const; private: - QUrl avatar_url_; - QString display_name_; - Membership membership_state_; + QUrl avatar_url_; + QString display_name_; + Membership membership_state_; }; inline QUrl MemberEventContent::avatarUrl() const { - return avatar_url_; + return avatar_url_; } inline QString MemberEventContent::displayName() const { - return display_name_; + return display_name_; } inline Membership MemberEventContent::membershipState() const { - return membership_state_; + return membership_state_; } } // namespace events } // namespace matrix diff --git a/include/events/MessageEvent.h b/include/events/MessageEvent.h index 24e236e3..1b105d62 100644 --- a/include/events/MessageEvent.h +++ b/include/events/MessageEvent.h @@ -28,38 +28,38 @@ template class MessageEvent : public RoomEvent { public: - inline MsgContent msgContent() const; + inline MsgContent msgContent() const; - void deserialize(const QJsonValue &data) override; + void deserialize(const QJsonValue &data) override; private: - MsgContent msg_content_; + MsgContent msg_content_; }; template inline MsgContent MessageEvent::msgContent() const { - return msg_content_; + return msg_content_; } template void MessageEvent::deserialize(const QJsonValue &data) { - RoomEvent::deserialize(data); + RoomEvent::deserialize(data); - msg_content_.deserialize(data.toObject().value("content").toObject()); + msg_content_.deserialize(data.toObject().value("content").toObject()); } namespace messages { struct ThumbnailInfo { - int h; - int w; - int size; + int h; + int w; + int size; - QString mimetype; + QString mimetype; }; } // namespace messages } // namespace events diff --git a/include/events/MessageEventContent.h b/include/events/MessageEventContent.h index 9f20809d..90f6cfaf 100644 --- a/include/events/MessageEventContent.h +++ b/include/events/MessageEventContent.h @@ -26,32 +26,32 @@ namespace matrix namespace events { enum class MessageEventType { - // m.audio - Audio, + // m.audio + Audio, - // m.emote - Emote, + // m.emote + Emote, - // m.file - File, + // m.file + File, - // m.image - Image, + // m.image + Image, - // m.location - Location, + // m.location + Location, - // m.notice - Notice, + // m.notice + Notice, - // m.text - Text, + // m.text + Text, - // m.video - Video, + // m.video + Video, - // Unrecognized message type - Unknown, + // Unrecognized message type + Unknown, }; MessageEventType @@ -62,19 +62,19 @@ class MessageEventContent , public Serializable { public: - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; - inline QString body() const; + inline QString body() const; private: - QString body_; + QString body_; }; inline QString MessageEventContent::body() const { - return body_; + return body_; } } // namespace events } // namespace matrix diff --git a/include/events/NameEventContent.h b/include/events/NameEventContent.h index e290a696..d2cf86da 100644 --- a/include/events/NameEventContent.h +++ b/include/events/NameEventContent.h @@ -34,19 +34,19 @@ class NameEventContent , public Serializable { public: - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; - inline QString name() const; + inline QString name() const; private: - QString name_; + QString name_; }; inline QString NameEventContent::name() const { - return name_; + return name_; } } // namespace events } // namespace matrix diff --git a/include/events/PowerLevelsEventContent.h b/include/events/PowerLevelsEventContent.h index 3a9d80d1..7cfeadf1 100644 --- a/include/events/PowerLevelsEventContent.h +++ b/include/events/PowerLevelsEventContent.h @@ -27,9 +27,9 @@ namespace matrix namespace events { enum class PowerLevels { - User = 0, - Moderator = 50, - Admin = 100, + User = 0, + Moderator = 50, + Admin = 100, }; /* @@ -41,75 +41,75 @@ class PowerLevelsEventContent , public Serializable { public: - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; - inline int banLevel() const; - inline int inviteLevel() const; - inline int kickLevel() const; - inline int redactLevel() const; + inline int banLevel() const; + inline int inviteLevel() const; + inline int kickLevel() const; + inline int redactLevel() const; - inline int eventsDefaultLevel() const; - inline int stateDefaultLevel() const; - inline int usersDefaultLevel() const; + inline int eventsDefaultLevel() const; + inline int stateDefaultLevel() const; + inline int usersDefaultLevel() const; - int eventLevel(QString event_type) const; - int userLevel(QString user_id) const; + int eventLevel(QString event_type) const; + int userLevel(QString user_id) const; private: - int ban_ = static_cast(PowerLevels::Moderator); - int invite_ = static_cast(PowerLevels::Moderator); - int kick_ = static_cast(PowerLevels::Moderator); - int redact_ = static_cast(PowerLevels::Moderator); + int ban_ = static_cast(PowerLevels::Moderator); + int invite_ = static_cast(PowerLevels::Moderator); + int kick_ = static_cast(PowerLevels::Moderator); + int redact_ = static_cast(PowerLevels::Moderator); - int events_default_ = static_cast(PowerLevels::User); - int state_default_ = static_cast(PowerLevels::Moderator); - int users_default_ = static_cast(PowerLevels::User); + int events_default_ = static_cast(PowerLevels::User); + int state_default_ = static_cast(PowerLevels::Moderator); + int users_default_ = static_cast(PowerLevels::User); - QMap events_; - QMap users_; + QMap events_; + QMap users_; }; inline int PowerLevelsEventContent::banLevel() const { - return ban_; + return ban_; } inline int PowerLevelsEventContent::inviteLevel() const { - return invite_; + return invite_; } inline int PowerLevelsEventContent::kickLevel() const { - return kick_; + return kick_; } inline int PowerLevelsEventContent::redactLevel() const { - return redact_; + return redact_; } inline int PowerLevelsEventContent::eventsDefaultLevel() const { - return events_default_; + return events_default_; } inline int PowerLevelsEventContent::stateDefaultLevel() const { - return state_default_; + return state_default_; } inline int PowerLevelsEventContent::usersDefaultLevel() const { - return users_default_; + return users_default_; } } // namespace events } // namespace matrix diff --git a/include/events/RoomEvent.h b/include/events/RoomEvent.h index b4bc78fe..540fafaf 100644 --- a/include/events/RoomEvent.h +++ b/include/events/RoomEvent.h @@ -30,89 +30,89 @@ template class RoomEvent : public Event { public: - inline QString eventId() const; - inline QString roomId() const; - inline QString sender() const; - inline uint64_t timestamp() const; + inline QString eventId() const; + inline QString roomId() const; + inline QString sender() const; + inline uint64_t timestamp() const; - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; private: - QString event_id_; - QString room_id_; - QString sender_; + QString event_id_; + QString room_id_; + QString sender_; - uint64_t origin_server_ts_; + uint64_t origin_server_ts_; }; template inline QString RoomEvent::eventId() const { - return event_id_; + return event_id_; } template inline QString RoomEvent::roomId() const { - return room_id_; + return room_id_; } template inline QString RoomEvent::sender() const { - return sender_; + return sender_; } template inline uint64_t RoomEvent::timestamp() const { - return origin_server_ts_; + return origin_server_ts_; } template void RoomEvent::deserialize(const QJsonValue &data) { - Event::deserialize(data); + Event::deserialize(data); - auto object = data.toObject(); + auto object = data.toObject(); - if (!object.contains("event_id")) - throw DeserializationException("event_id key is missing"); + if (!object.contains("event_id")) + throw DeserializationException("event_id key is missing"); - if (!object.contains("origin_server_ts")) - throw DeserializationException("origin_server_ts key is missing"); + if (!object.contains("origin_server_ts")) + throw DeserializationException("origin_server_ts key is missing"); - // FIXME: Synapse doesn't include room id?! - /* if (!object.contains("room_id")) */ - /* throw DeserializationException("room_id key is missing"); */ + // FIXME: Synapse doesn't include room id?! + /* if (!object.contains("room_id")) */ + /* throw DeserializationException("room_id key is missing"); */ - if (!object.contains("sender")) - throw DeserializationException("sender key is missing"); + if (!object.contains("sender")) + throw DeserializationException("sender key is missing"); - event_id_ = object.value("event_id").toString(); - room_id_ = object.value("room_id").toString(); - sender_ = object.value("sender").toString(); - origin_server_ts_ = object.value("origin_server_ts").toDouble(); + event_id_ = object.value("event_id").toString(); + room_id_ = object.value("room_id").toString(); + sender_ = object.value("sender").toString(); + origin_server_ts_ = object.value("origin_server_ts").toDouble(); } template QJsonObject RoomEvent::serialize() const { - QJsonObject object = Event::serialize(); + QJsonObject object = Event::serialize(); - object["event_id"] = event_id_; - object["room_id"] = room_id_; - object["sender"] = sender_; - object["origin_server_ts"] = QJsonValue(static_cast(origin_server_ts_)); + object["event_id"] = event_id_; + object["room_id"] = room_id_; + object["sender"] = sender_; + object["origin_server_ts"] = QJsonValue(static_cast(origin_server_ts_)); - return object; + return object; } } // namespace events } // namespace matrix diff --git a/include/events/StateEvent.h b/include/events/StateEvent.h index e5cd4c10..75bf1bbb 100644 --- a/include/events/StateEvent.h +++ b/include/events/StateEvent.h @@ -29,62 +29,62 @@ template class StateEvent : public RoomEvent { public: - inline QString stateKey() const; - inline Content previousContent() const; + inline QString stateKey() const; + inline Content previousContent() const; - void deserialize(const QJsonValue &data); - QJsonObject serialize() const; + void deserialize(const QJsonValue &data); + QJsonObject serialize() const; private: - QString state_key_; - Content prev_content_; + QString state_key_; + Content prev_content_; }; template inline QString StateEvent::stateKey() const { - return state_key_; + return state_key_; } template inline Content StateEvent::previousContent() const { - return prev_content_; + return prev_content_; } template void StateEvent::deserialize(const QJsonValue &data) { - RoomEvent::deserialize(data); + RoomEvent::deserialize(data); - auto object = data.toObject(); + auto object = data.toObject(); - if (!object.contains("state_key")) - throw DeserializationException("state_key key is missing"); + if (!object.contains("state_key")) + throw DeserializationException("state_key key is missing"); - state_key_ = object.value("state_key").toString(); + state_key_ = object.value("state_key").toString(); - if (object.contains("prev_content")) - prev_content_.deserialize(object.value("prev_content")); + if (object.contains("prev_content")) + prev_content_.deserialize(object.value("prev_content")); } template QJsonObject StateEvent::serialize() const { - QJsonObject object = RoomEvent::serialize(); + QJsonObject object = RoomEvent::serialize(); - object["state_key"] = state_key_; + object["state_key"] = state_key_; - auto prev = prev_content_.serialize(); + auto prev = prev_content_.serialize(); - if (!prev.isEmpty()) - object["prev_content"] = prev; + if (!prev.isEmpty()) + object["prev_content"] = prev; - return object; + return object; } } // namespace events } // namespace matrix diff --git a/include/events/TopicEventContent.h b/include/events/TopicEventContent.h index e8f3d7a4..c393b3ef 100644 --- a/include/events/TopicEventContent.h +++ b/include/events/TopicEventContent.h @@ -34,19 +34,19 @@ class TopicEventContent , public Serializable { public: - void deserialize(const QJsonValue &data) override; - QJsonObject serialize() const override; + void deserialize(const QJsonValue &data) override; + QJsonObject serialize() const override; - inline QString topic() const; + inline QString topic() const; private: - QString topic_; + QString topic_; }; inline QString TopicEventContent::topic() const { - return topic_; + return topic_; } } // namespace events } // namespace matrix diff --git a/include/events/messages/Audio.h b/include/events/messages/Audio.h index 1f289dbb..41bc2496 100644 --- a/include/events/messages/Audio.h +++ b/include/events/messages/Audio.h @@ -28,35 +28,35 @@ namespace events namespace messages { struct AudioInfo { - uint64_t duration; - int size; + uint64_t duration; + int size; - QString mimetype; + QString mimetype; }; class Audio : public Deserializable { public: - inline QString url() const; - inline AudioInfo info() const; + inline QString url() const; + inline AudioInfo info() const; - void deserialize(const QJsonObject &object) override; + void deserialize(const QJsonObject &object) override; private: - QString url_; - AudioInfo info_; + QString url_; + AudioInfo info_; }; inline QString Audio::url() const { - return url_; + return url_; } inline AudioInfo Audio::info() const { - return info_; + return info_; } } // namespace messages diff --git a/include/events/messages/Emote.h b/include/events/messages/Emote.h index b3af8a5f..98d049e7 100644 --- a/include/events/messages/Emote.h +++ b/include/events/messages/Emote.h @@ -30,7 +30,7 @@ namespace messages class Emote : public Deserializable { public: - void deserialize(const QJsonObject &obj) override; + void deserialize(const QJsonObject &obj) override; }; } // namespace messages } // namespace events diff --git a/include/events/messages/File.h b/include/events/messages/File.h index 22cad8be..a4e8b6a4 100644 --- a/include/events/messages/File.h +++ b/include/events/messages/File.h @@ -29,46 +29,46 @@ namespace events namespace messages { struct FileInfo { - int size; + int size; - QString mimetype; - QString thumbnail_url; - ThumbnailInfo thumbnail_info; + QString mimetype; + QString thumbnail_url; + ThumbnailInfo thumbnail_info; }; class File : public Deserializable { public: - inline QString url() const; - inline QString filename() const; + inline QString url() const; + inline QString filename() const; - inline FileInfo info() const; + inline FileInfo info() const; - void deserialize(const QJsonObject &object) override; + void deserialize(const QJsonObject &object) override; private: - QString url_; - QString filename_; + QString url_; + QString filename_; - FileInfo info_; + FileInfo info_; }; inline QString File::filename() const { - return filename_; + return filename_; } inline QString File::url() const { - return url_; + return url_; } inline FileInfo File::info() const { - return info_; + return info_; } } // namespace messages diff --git a/include/events/messages/Image.h b/include/events/messages/Image.h index 79360050..93a598e2 100644 --- a/include/events/messages/Image.h +++ b/include/events/messages/Image.h @@ -29,38 +29,38 @@ namespace events namespace messages { struct ImageInfo { - int h; - int w; - int size; + int h; + int w; + int size; - QString mimetype; - QString thumbnail_url; - ThumbnailInfo thumbnail_info; + QString mimetype; + QString thumbnail_url; + ThumbnailInfo thumbnail_info; }; class Image : public Deserializable { public: - inline QString url() const; - inline ImageInfo info() const; + inline QString url() const; + inline ImageInfo info() const; - void deserialize(const QJsonObject &object) override; + void deserialize(const QJsonObject &object) override; private: - QString url_; - ImageInfo info_; + QString url_; + ImageInfo info_; }; inline QString Image::url() const { - return url_; + return url_; } inline ImageInfo Image::info() const { - return info_; + return info_; } } // namespace messages diff --git a/include/events/messages/Location.h b/include/events/messages/Location.h index 864c5111..4b523878 100644 --- a/include/events/messages/Location.h +++ b/include/events/messages/Location.h @@ -29,34 +29,34 @@ namespace events namespace messages { struct LocationInfo { - QString thumbnail_url; - ThumbnailInfo thumbnail_info; + QString thumbnail_url; + ThumbnailInfo thumbnail_info; }; class Location : public Deserializable { public: - inline QString geoUri() const; - inline LocationInfo info() const; + inline QString geoUri() const; + inline LocationInfo info() const; - void deserialize(const QJsonObject &object) override; + void deserialize(const QJsonObject &object) override; private: - QString geo_uri_; + QString geo_uri_; - LocationInfo info_; + LocationInfo info_; }; inline QString Location::geoUri() const { - return geo_uri_; + return geo_uri_; } inline LocationInfo Location::info() const { - return info_; + return info_; } } // namespace messages diff --git a/include/events/messages/Notice.h b/include/events/messages/Notice.h index 0b2a92e3..b303dd79 100644 --- a/include/events/messages/Notice.h +++ b/include/events/messages/Notice.h @@ -30,7 +30,7 @@ namespace messages class Notice : public Deserializable { public: - void deserialize(const QJsonObject &obj) override; + void deserialize(const QJsonObject &obj) override; }; } // namespace messages } // namespace events diff --git a/include/events/messages/Text.h b/include/events/messages/Text.h index 8950e994..2c787d04 100644 --- a/include/events/messages/Text.h +++ b/include/events/messages/Text.h @@ -30,7 +30,7 @@ namespace messages class Text : public Deserializable { public: - void deserialize(const QJsonObject &obj) override; + void deserialize(const QJsonObject &obj) override; }; } // namespace messages } // namespace events diff --git a/include/events/messages/Video.h b/include/events/messages/Video.h index 2b160bea..37056c27 100644 --- a/include/events/messages/Video.h +++ b/include/events/messages/Video.h @@ -29,39 +29,39 @@ namespace events namespace messages { struct VideoInfo { - int h; - int w; - int size; - int duration; + int h; + int w; + int size; + int duration; - QString mimetype; - QString thumbnail_url; - ThumbnailInfo thumbnail_info; + QString mimetype; + QString thumbnail_url; + ThumbnailInfo thumbnail_info; }; class Video : public Deserializable { public: - inline QString url() const; - inline VideoInfo info() const; + inline QString url() const; + inline VideoInfo info() const; - void deserialize(const QJsonObject &object) override; + void deserialize(const QJsonObject &object) override; private: - QString url_; - VideoInfo info_; + QString url_; + VideoInfo info_; }; inline QString Video::url() const { - return url_; + return url_; } inline VideoInfo Video::info() const { - return info_; + return info_; } } // namespace messages diff --git a/include/ui/Avatar.h b/include/ui/Avatar.h index b99ee683..dc089139 100644 --- a/include/ui/Avatar.h +++ b/include/ui/Avatar.h @@ -9,40 +9,40 @@ class Avatar : public QWidget { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor) - Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor) + Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor) + Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor) public: - explicit Avatar(QWidget *parent = 0); - ~Avatar(); + explicit Avatar(QWidget *parent = 0); + ~Avatar(); - void setBackgroundColor(const QColor &color); - void setIcon(const QIcon &icon); - void setImage(const QImage &image); - void setLetter(const QChar &letter); - void setSize(int size); - void setTextColor(const QColor &color); + void setBackgroundColor(const QColor &color); + void setIcon(const QIcon &icon); + void setImage(const QImage &image); + void setLetter(const QChar &letter); + void setSize(int size); + void setTextColor(const QColor &color); - QColor backgroundColor() const; - QColor textColor() const; - int size() const; + QColor backgroundColor() const; + QColor textColor() const; + int size() const; - QSize sizeHint() const override; + QSize sizeHint() const override; protected: - void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; private: - void init(); + void init(); - ui::AvatarType type_; - QChar letter_; - QColor background_color_; - QColor text_color_; - QIcon icon_; - QImage image_; - QPixmap pixmap_; - int size_; + ui::AvatarType type_; + QChar letter_; + QColor background_color_; + QColor text_color_; + QIcon icon_; + QImage image_; + QPixmap pixmap_; + int size_; }; diff --git a/include/ui/Badge.h b/include/ui/Badge.h index b994cfdf..4084247e 100644 --- a/include/ui/Badge.h +++ b/include/ui/Badge.h @@ -9,55 +9,55 @@ class Badge : public OverlayWidget { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor) - Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor) - Q_PROPERTY(QPointF relativePosition WRITE setRelativePosition READ relativePosition) + Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor) + Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor) + Q_PROPERTY(QPointF relativePosition WRITE setRelativePosition READ relativePosition) public: - explicit Badge(QWidget *parent = 0); - explicit Badge(const QIcon &icon, QWidget *parent = 0); - explicit Badge(const QString &text, QWidget *parent = 0); - ~Badge(); + explicit Badge(QWidget *parent = 0); + explicit Badge(const QIcon &icon, QWidget *parent = 0); + explicit Badge(const QString &text, QWidget *parent = 0); + ~Badge(); - void setBackgroundColor(const QColor &color); - void setTextColor(const QColor &color); - void setIcon(const QIcon &icon); - void setRelativePosition(const QPointF &pos); - void setRelativePosition(qreal x, qreal y); - void setRelativeXPosition(qreal x); - void setRelativeYPosition(qreal y); - void setText(const QString &text); - void setDiameter(int diameter); + void setBackgroundColor(const QColor &color); + void setTextColor(const QColor &color); + void setIcon(const QIcon &icon); + void setRelativePosition(const QPointF &pos); + void setRelativePosition(qreal x, qreal y); + void setRelativeXPosition(qreal x); + void setRelativeYPosition(qreal y); + void setText(const QString &text); + void setDiameter(int diameter); - QIcon icon() const; - QString text() const; - QColor backgroundColor() const; - QColor textColor() const; - QPointF relativePosition() const; - QSize sizeHint() const override; - qreal relativeXPosition() const; - qreal relativeYPosition() const; + QIcon icon() const; + QString text() const; + QColor backgroundColor() const; + QColor textColor() const; + QPointF relativePosition() const; + QSize sizeHint() const override; + qreal relativeXPosition() const; + qreal relativeYPosition() const; - int diameter() const; + int diameter() const; protected: - void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; private: - void init(); + void init(); - QColor background_color_; - QColor text_color_; + QColor background_color_; + QColor text_color_; - QIcon icon_; - QSize size_; - QString text_; + QIcon icon_; + QSize size_; + QString text_; - int padding_; - int diameter_; + int padding_; + int diameter_; - qreal x_; - qreal y_; + qreal x_; + qreal y_; }; diff --git a/include/ui/CircularProgress.h b/include/ui/CircularProgress.h index 5ed8994d..291cce1c 100644 --- a/include/ui/CircularProgress.h +++ b/include/ui/CircularProgress.h @@ -9,112 +9,112 @@ class CircularProgressDelegate; class CircularProgress : public QProgressBar { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(qreal lineWidth WRITE setLineWidth READ lineWidth) - Q_PROPERTY(qreal size WRITE setSize READ size) - Q_PROPERTY(QColor color WRITE setColor READ color) + Q_PROPERTY(qreal lineWidth WRITE setLineWidth READ lineWidth) + Q_PROPERTY(qreal size WRITE setSize READ size) + Q_PROPERTY(QColor color WRITE setColor READ color) public: - explicit CircularProgress(QWidget *parent = nullptr); - ~CircularProgress(); + explicit CircularProgress(QWidget *parent = nullptr); + ~CircularProgress(); - void setProgressType(ui::ProgressType type); - void setLineWidth(qreal width); - void setSize(int size); - void setColor(const QColor &color); + void setProgressType(ui::ProgressType type); + void setLineWidth(qreal width); + void setSize(int size); + void setColor(const QColor &color); - ui::ProgressType progressType() const; - qreal lineWidth() const; - int size() const; - QColor color() const; + ui::ProgressType progressType() const; + qreal lineWidth() const; + int size() const; + QColor color() const; - QSize sizeHint() const override; + QSize sizeHint() const override; protected: - void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; private: - CircularProgressDelegate *delegate_; + CircularProgressDelegate *delegate_; - ui::ProgressType progress_type_; + ui::ProgressType progress_type_; - QColor color_; + QColor color_; - // Circle width. - qreal width_; + // Circle width. + qreal width_; - // Circle radius. - int size_; + // Circle radius. + int size_; - // Animation duration. - int duration_; + // Animation duration. + int duration_; }; class CircularProgressDelegate : public QObject { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(qreal dashOffset WRITE setDashOffset READ dashOffset) - Q_PROPERTY(qreal dashLength WRITE setDashLength READ dashLength) - Q_PROPERTY(int angle WRITE setAngle READ angle) + Q_PROPERTY(qreal dashOffset WRITE setDashOffset READ dashOffset) + Q_PROPERTY(qreal dashLength WRITE setDashLength READ dashLength) + Q_PROPERTY(int angle WRITE setAngle READ angle) public: - explicit CircularProgressDelegate(CircularProgress *parent); - ~CircularProgressDelegate(); + explicit CircularProgressDelegate(CircularProgress *parent); + ~CircularProgressDelegate(); - inline void setDashOffset(qreal offset); - inline void setDashLength(qreal length); - inline void setAngle(int angle); + inline void setDashOffset(qreal offset); + inline void setDashLength(qreal length); + inline void setAngle(int angle); - inline qreal dashOffset() const; - inline qreal dashLength() const; - inline int angle() const; + inline qreal dashOffset() const; + inline qreal dashLength() const; + inline int angle() const; private: - CircularProgress *const progress_; + CircularProgress *const progress_; - qreal dash_offset_; - qreal dash_length_; + qreal dash_offset_; + qreal dash_length_; - int angle_; + int angle_; }; inline void CircularProgressDelegate::setDashOffset(qreal offset) { - dash_offset_ = offset; - progress_->update(); + dash_offset_ = offset; + progress_->update(); } inline void CircularProgressDelegate::setDashLength(qreal length) { - dash_length_ = length; - progress_->update(); + dash_length_ = length; + progress_->update(); } inline void CircularProgressDelegate::setAngle(int angle) { - angle_ = angle; - progress_->update(); + angle_ = angle; + progress_->update(); } inline qreal CircularProgressDelegate::dashOffset() const { - return dash_offset_; + return dash_offset_; } inline qreal CircularProgressDelegate::dashLength() const { - return dash_length_; + return dash_length_; } inline int CircularProgressDelegate::angle() const { - return angle_; + return angle_; } diff --git a/include/ui/DropShadow.h b/include/ui/DropShadow.h index 3054d7dd..b7ba1985 100644 --- a/include/ui/DropShadow.h +++ b/include/ui/DropShadow.h @@ -7,97 +7,105 @@ class DropShadow { public: - static void draw(QPainter &painter, - qint16 margin, - qreal radius, - QColor start, - QColor end, - qreal startPosition, - qreal endPosition0, - qreal endPosition1, - qreal width, - qreal height) - { - painter.setPen(Qt::NoPen); + static void draw(QPainter &painter, + qint16 margin, + qreal radius, + QColor start, + QColor end, + qreal startPosition, + qreal endPosition0, + qreal endPosition1, + qreal width, + qreal height) + { + painter.setPen(Qt::NoPen); - QLinearGradient gradient; - gradient.setColorAt(startPosition, start); - gradient.setColorAt(endPosition0, end); + QLinearGradient gradient; + gradient.setColorAt(startPosition, start); + gradient.setColorAt(endPosition0, end); - // Right - QPointF right0(width - margin, height / 2); - QPointF right1(width, height / 2); - gradient.setStart(right0); - gradient.setFinalStop(right1); - painter.setBrush(QBrush(gradient)); - painter.drawRoundRect( - QRectF(QPointF(width - margin * radius, margin), QPointF(width, height - margin)), 0.0, 0.0); + // Right + QPointF right0(width - margin, height / 2); + QPointF right1(width, height / 2); + gradient.setStart(right0); + gradient.setFinalStop(right1); + painter.setBrush(QBrush(gradient)); + painter.drawRoundRect( + QRectF(QPointF(width - margin * radius, margin), QPointF(width, height - margin)), + 0.0, + 0.0); - // Left - QPointF left0(margin, height / 2); - QPointF left1(0, height / 2); - gradient.setStart(left0); - gradient.setFinalStop(left1); - painter.setBrush(QBrush(gradient)); - painter.drawRoundRect(QRectF(QPointF(margin * radius, margin), QPointF(0, height - margin)), 0.0, 0.0); + // Left + QPointF left0(margin, height / 2); + QPointF left1(0, height / 2); + gradient.setStart(left0); + gradient.setFinalStop(left1); + painter.setBrush(QBrush(gradient)); + painter.drawRoundRect( + QRectF(QPointF(margin * radius, margin), QPointF(0, height - margin)), 0.0, 0.0); - // Top - QPointF top0(width / 2, margin); - QPointF top1(width / 2, 0); - gradient.setStart(top0); - gradient.setFinalStop(top1); - painter.setBrush(QBrush(gradient)); - painter.drawRoundRect(QRectF(QPointF(width - margin, 0), QPointF(margin, margin)), 0.0, 0.0); + // Top + QPointF top0(width / 2, margin); + QPointF top1(width / 2, 0); + gradient.setStart(top0); + gradient.setFinalStop(top1); + painter.setBrush(QBrush(gradient)); + painter.drawRoundRect( + QRectF(QPointF(width - margin, 0), QPointF(margin, margin)), 0.0, 0.0); - // Bottom - QPointF bottom0(width / 2, height - margin); - QPointF bottom1(width / 2, height); - gradient.setStart(bottom0); - gradient.setFinalStop(bottom1); - painter.setBrush(QBrush(gradient)); - painter.drawRoundRect( - QRectF(QPointF(margin, height - margin), QPointF(width - margin, height)), 0.0, 0.0); + // Bottom + QPointF bottom0(width / 2, height - margin); + QPointF bottom1(width / 2, height); + gradient.setStart(bottom0); + gradient.setFinalStop(bottom1); + painter.setBrush(QBrush(gradient)); + painter.drawRoundRect( + QRectF(QPointF(margin, height - margin), QPointF(width - margin, height)), + 0.0, + 0.0); - // BottomRight - QPointF bottomright0(width - margin, height - margin); - QPointF bottomright1(width, height); - gradient.setStart(bottomright0); - gradient.setFinalStop(bottomright1); - gradient.setColorAt(endPosition1, end); - painter.setBrush(QBrush(gradient)); - painter.drawRoundRect(QRectF(bottomright0, bottomright1), 0.0, 0.0); + // BottomRight + QPointF bottomright0(width - margin, height - margin); + QPointF bottomright1(width, height); + gradient.setStart(bottomright0); + gradient.setFinalStop(bottomright1); + gradient.setColorAt(endPosition1, end); + painter.setBrush(QBrush(gradient)); + painter.drawRoundRect(QRectF(bottomright0, bottomright1), 0.0, 0.0); - // BottomLeft - QPointF bottomleft0(margin, height - margin); - QPointF bottomleft1(0, height); - gradient.setStart(bottomleft0); - gradient.setFinalStop(bottomleft1); - gradient.setColorAt(endPosition1, end); - painter.setBrush(QBrush(gradient)); - painter.drawRoundRect(QRectF(bottomleft0, bottomleft1), 0.0, 0.0); + // BottomLeft + QPointF bottomleft0(margin, height - margin); + QPointF bottomleft1(0, height); + gradient.setStart(bottomleft0); + gradient.setFinalStop(bottomleft1); + gradient.setColorAt(endPosition1, end); + painter.setBrush(QBrush(gradient)); + painter.drawRoundRect(QRectF(bottomleft0, bottomleft1), 0.0, 0.0); - // TopLeft - QPointF topleft0(margin, margin); - QPointF topleft1(0, 0); - gradient.setStart(topleft0); - gradient.setFinalStop(topleft1); - gradient.setColorAt(endPosition1, end); - painter.setBrush(QBrush(gradient)); - painter.drawRoundRect(QRectF(topleft0, topleft1), 0.0, 0.0); + // TopLeft + QPointF topleft0(margin, margin); + QPointF topleft1(0, 0); + gradient.setStart(topleft0); + gradient.setFinalStop(topleft1); + gradient.setColorAt(endPosition1, end); + painter.setBrush(QBrush(gradient)); + painter.drawRoundRect(QRectF(topleft0, topleft1), 0.0, 0.0); - // TopRight - QPointF topright0(width - margin, margin); - QPointF topright1(width, 0); - gradient.setStart(topright0); - gradient.setFinalStop(topright1); - gradient.setColorAt(endPosition1, end); - painter.setBrush(QBrush(gradient)); - painter.drawRoundRect(QRectF(topright0, topright1), 0.0, 0.0); + // TopRight + QPointF topright0(width - margin, margin); + QPointF topright1(width, 0); + gradient.setStart(topright0); + gradient.setFinalStop(topright1); + gradient.setColorAt(endPosition1, end); + painter.setBrush(QBrush(gradient)); + painter.drawRoundRect(QRectF(topright0, topright1), 0.0, 0.0); - // Widget - painter.setBrush(QBrush("#FFFFFF")); - painter.setRenderHint(QPainter::Antialiasing); - painter.drawRoundRect( - QRectF(QPointF(margin, margin), QPointF(width - margin, height - margin)), radius, radius); - } + // Widget + painter.setBrush(QBrush("#FFFFFF")); + painter.setRenderHint(QPainter::Antialiasing); + painter.drawRoundRect( + QRectF(QPointF(margin, margin), QPointF(width - margin, height - margin)), + radius, + radius); + } }; diff --git a/include/ui/FlatButton.h b/include/ui/FlatButton.h index 1c44d5d7..816563e3 100644 --- a/include/ui/FlatButton.h +++ b/include/ui/FlatButton.h @@ -12,167 +12,174 @@ class FlatButton; class FlatButtonStateMachine : public QStateMachine { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(qreal overlayOpacity WRITE setOverlayOpacity READ overlayOpacity) - Q_PROPERTY(qreal checkedOverlayProgress WRITE setCheckedOverlayProgress READ checkedOverlayProgress) + Q_PROPERTY(qreal overlayOpacity WRITE setOverlayOpacity READ overlayOpacity) + Q_PROPERTY( + qreal checkedOverlayProgress WRITE setCheckedOverlayProgress READ checkedOverlayProgress) public: - explicit FlatButtonStateMachine(FlatButton *parent); - ~FlatButtonStateMachine(); + explicit FlatButtonStateMachine(FlatButton *parent); + ~FlatButtonStateMachine(); - void setOverlayOpacity(qreal opacity); - void setCheckedOverlayProgress(qreal opacity); + void setOverlayOpacity(qreal opacity); + void setCheckedOverlayProgress(qreal opacity); - inline qreal overlayOpacity() const; - inline qreal checkedOverlayProgress() const; + inline qreal overlayOpacity() const; + inline qreal checkedOverlayProgress() const; - void startAnimations(); - void setupProperties(); - void updateCheckedStatus(); + void startAnimations(); + void setupProperties(); + void updateCheckedStatus(); signals: - void buttonPressed(); - void buttonChecked(); - void buttonUnchecked(); + void buttonPressed(); + void buttonChecked(); + void buttonUnchecked(); protected: - bool eventFilter(QObject *watched, QEvent *event) override; + bool eventFilter(QObject *watched, QEvent *event) override; private: - void addTransition(QObject *object, const char *signal, QState *fromState, QState *toState); - void addTransition(QObject *object, QEvent::Type eventType, QState *fromState, QState *toState); - void addTransition(QAbstractTransition *transition, QState *fromState, QState *toState); + void addTransition(QObject *object, const char *signal, QState *fromState, QState *toState); + void addTransition(QObject *object, + QEvent::Type eventType, + QState *fromState, + QState *toState); + void addTransition(QAbstractTransition *transition, QState *fromState, QState *toState); - FlatButton *const button_; + FlatButton *const button_; - QState *const top_level_state_; - QState *const config_state_; - QState *const checkable_state_; - QState *const checked_state_; - QState *const unchecked_state_; - QState *const neutral_state_; - QState *const neutral_focused_state_; - QState *const hovered_state_; - QState *const hovered_focused_state_; - QState *const pressed_state_; + QState *const top_level_state_; + QState *const config_state_; + QState *const checkable_state_; + QState *const checked_state_; + QState *const unchecked_state_; + QState *const neutral_state_; + QState *const neutral_focused_state_; + QState *const hovered_state_; + QState *const hovered_focused_state_; + QState *const pressed_state_; - qreal overlay_opacity_; - qreal checked_overlay_progress_; + qreal overlay_opacity_; + qreal checked_overlay_progress_; - bool was_checked_; + bool was_checked_; }; inline qreal FlatButtonStateMachine::overlayOpacity() const { - return overlay_opacity_; + return overlay_opacity_; } inline qreal FlatButtonStateMachine::checkedOverlayProgress() const { - return checked_overlay_progress_; + return checked_overlay_progress_; } class FlatButton : public QPushButton { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(QColor foregroundColor WRITE setForegroundColor READ foregroundColor) - Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor) - Q_PROPERTY(QColor overlayColor WRITE setOverlayColor READ overlayColor) - Q_PROPERTY(QColor disabledForegroundColor WRITE setDisabledForegroundColor READ disabledForegroundColor) - Q_PROPERTY(QColor disabledBackgroundColor WRITE setDisabledBackgroundColor READ disabledBackgroundColor) - Q_PROPERTY(qreal fontSize WRITE setFontSize READ fontSize) + Q_PROPERTY(QColor foregroundColor WRITE setForegroundColor READ foregroundColor) + Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor) + Q_PROPERTY(QColor overlayColor WRITE setOverlayColor READ overlayColor) + Q_PROPERTY(QColor disabledForegroundColor WRITE setDisabledForegroundColor READ + disabledForegroundColor) + Q_PROPERTY(QColor disabledBackgroundColor WRITE setDisabledBackgroundColor READ + disabledBackgroundColor) + Q_PROPERTY(qreal fontSize WRITE setFontSize READ fontSize) public: - explicit FlatButton(QWidget *parent = 0, ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset); - explicit FlatButton(const QString &text, - QWidget *parent = 0, - ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset); - FlatButton(const QString &text, - ui::Role role, - QWidget *parent = 0, - ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset); - ~FlatButton(); + explicit FlatButton(QWidget *parent = 0, + ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset); + explicit FlatButton(const QString &text, + QWidget *parent = 0, + ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset); + FlatButton(const QString &text, + ui::Role role, + QWidget *parent = 0, + ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset); + ~FlatButton(); - void applyPreset(ui::ButtonPreset preset); + void applyPreset(ui::ButtonPreset preset); - void setBackgroundColor(const QColor &color); - void setBackgroundMode(Qt::BGMode mode); - void setBaseOpacity(qreal opacity); - void setCheckable(bool value); - void setCornerRadius(qreal radius); - void setDisabledBackgroundColor(const QColor &color); - void setDisabledForegroundColor(const QColor &color); - void setFixedRippleRadius(qreal radius); - void setFontSize(qreal size); - void setForegroundColor(const QColor &color); - void setHasFixedRippleRadius(bool value); - void setIconPlacement(ui::ButtonIconPlacement placement); - void setOverlayColor(const QColor &color); - void setOverlayStyle(ui::OverlayStyle style); - void setRippleStyle(ui::RippleStyle style); - void setRole(ui::Role role); + void setBackgroundColor(const QColor &color); + void setBackgroundMode(Qt::BGMode mode); + void setBaseOpacity(qreal opacity); + void setCheckable(bool value); + void setCornerRadius(qreal radius); + void setDisabledBackgroundColor(const QColor &color); + void setDisabledForegroundColor(const QColor &color); + void setFixedRippleRadius(qreal radius); + void setFontSize(qreal size); + void setForegroundColor(const QColor &color); + void setHasFixedRippleRadius(bool value); + void setIconPlacement(ui::ButtonIconPlacement placement); + void setOverlayColor(const QColor &color); + void setOverlayStyle(ui::OverlayStyle style); + void setRippleStyle(ui::RippleStyle style); + void setRole(ui::Role role); - QColor foregroundColor() const; - QColor backgroundColor() const; - QColor overlayColor() const; - QColor disabledForegroundColor() const; - QColor disabledBackgroundColor() const; + QColor foregroundColor() const; + QColor backgroundColor() const; + QColor overlayColor() const; + QColor disabledForegroundColor() const; + QColor disabledBackgroundColor() const; - qreal fontSize() const; - qreal cornerRadius() const; - qreal baseOpacity() const; + qreal fontSize() const; + qreal cornerRadius() const; + qreal baseOpacity() const; - bool hasFixedRippleRadius() const; + bool hasFixedRippleRadius() const; - ui::Role role() const; - ui::OverlayStyle overlayStyle() const; - ui::RippleStyle rippleStyle() const; - ui::ButtonIconPlacement iconPlacement() const; + ui::Role role() const; + ui::OverlayStyle overlayStyle() const; + ui::RippleStyle rippleStyle() const; + ui::ButtonIconPlacement iconPlacement() const; - Qt::BGMode backgroundMode() const; + Qt::BGMode backgroundMode() const; - QSize sizeHint() const override; + QSize sizeHint() const override; protected: - int IconPadding = 0; + int IconPadding = 0; - void checkStateSet() override; - void mousePressEvent(QMouseEvent *event) override; - void mouseReleaseEvent(QMouseEvent *event) override; - void resizeEvent(QResizeEvent *event) override; - void paintEvent(QPaintEvent *event) override; + void checkStateSet() override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void resizeEvent(QResizeEvent *event) override; + void paintEvent(QPaintEvent *event) override; - virtual void paintBackground(QPainter *painter); - virtual void paintForeground(QPainter *painter); - virtual void updateClipPath(); + virtual void paintBackground(QPainter *painter); + virtual void paintForeground(QPainter *painter); + virtual void updateClipPath(); - void init(); + void init(); private: - RippleOverlay *ripple_overlay_; - FlatButtonStateMachine *state_machine_; + RippleOverlay *ripple_overlay_; + FlatButtonStateMachine *state_machine_; - ui::Role role_; - ui::RippleStyle ripple_style_; - ui::ButtonIconPlacement icon_placement_; - ui::OverlayStyle overlay_style_; + ui::Role role_; + ui::RippleStyle ripple_style_; + ui::ButtonIconPlacement icon_placement_; + ui::OverlayStyle overlay_style_; - Qt::BGMode bg_mode_; + Qt::BGMode bg_mode_; - QColor background_color_; - QColor foreground_color_; - QColor overlay_color_; - QColor disabled_color_; - QColor disabled_background_color_; + QColor background_color_; + QColor foreground_color_; + QColor overlay_color_; + QColor disabled_color_; + QColor disabled_background_color_; - qreal fixed_ripple_radius_; - qreal corner_radius_; - qreal base_opacity_; - qreal font_size_; + qreal fixed_ripple_radius_; + qreal corner_radius_; + qreal base_opacity_; + qreal font_size_; - bool use_fixed_ripple_radius_; + bool use_fixed_ripple_radius_; }; diff --git a/include/ui/Menu.h b/include/ui/Menu.h index 0b4eb6d5..2029b1fd 100644 --- a/include/ui/Menu.h +++ b/include/ui/Menu.h @@ -7,24 +7,26 @@ class Menu : public QMenu { public: - Menu(QWidget *parent = nullptr) - : QMenu(parent) - { - QFont font; - font.setPixelSize(conf::fontSize); + Menu(QWidget *parent = nullptr) + : QMenu(parent) + { + QFont font; + font.setPixelSize(conf::fontSize); - setFont(font); - setStyleSheet("QMenu { color: black; background-color: white; margin: 0px;}" - "QMenu::item { color: black; padding: 7px 20px; border: 1px solid transparent; margin: " - "2px 0px; }" - "QMenu::item:selected { color: black; background: rgba(180, 180, 180, 100); }"); - }; + setFont(font); + setStyleSheet( + "QMenu { color: black; background-color: white; margin: 0px;}" + "QMenu::item { color: black; padding: 7px 20px; border: 1px solid transparent; " + "margin: " + "2px 0px; }" + "QMenu::item:selected { color: black; background: rgba(180, 180, 180, 100); }"); + }; protected: - void leaveEvent(QEvent *e) - { - Q_UNUSED(e); + void leaveEvent(QEvent *e) + { + Q_UNUSED(e); - hide(); - } + hide(); + } }; diff --git a/include/ui/OverlayModal.h b/include/ui/OverlayModal.h index 4dea6513..167ba71a 100644 --- a/include/ui/OverlayModal.h +++ b/include/ui/OverlayModal.h @@ -26,35 +26,35 @@ class OverlayModal : public OverlayWidget { public: - explicit OverlayModal(QWidget *parent, QWidget *content); + explicit OverlayModal(QWidget *parent, QWidget *content); - void fadeIn(); - void fadeOut(); + void fadeIn(); + void fadeOut(); public: - inline void setDuration(int duration); - inline void setColor(QColor color); + inline void setDuration(int duration); + inline void setColor(QColor color); protected: - void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; private: - int duration_; - QColor color_; + int duration_; + QColor color_; - QGraphicsOpacityEffect *opacity_; - QPropertyAnimation *animation_; + QGraphicsOpacityEffect *opacity_; + QPropertyAnimation *animation_; }; inline void OverlayModal::setDuration(int duration) { - duration_ = duration; - animation_->setDuration(duration_); + duration_ = duration; + animation_->setDuration(duration_); } inline void OverlayModal::setColor(QColor color) { - color_ = color; + color_ = color; } diff --git a/include/ui/OverlayWidget.h b/include/ui/OverlayWidget.h index b9655cf6..2984e469 100644 --- a/include/ui/OverlayWidget.h +++ b/include/ui/OverlayWidget.h @@ -5,14 +5,14 @@ class OverlayWidget : public QWidget { - Q_OBJECT + Q_OBJECT public: - explicit OverlayWidget(QWidget *parent = nullptr); + explicit OverlayWidget(QWidget *parent = nullptr); protected: - bool event(QEvent *event) override; - bool eventFilter(QObject *obj, QEvent *event) override; + bool event(QEvent *event) override; + bool eventFilter(QObject *obj, QEvent *event) override; - QRect overlayGeometry() const; + QRect overlayGeometry() const; }; diff --git a/include/ui/RaisedButton.h b/include/ui/RaisedButton.h index 558d15eb..edd5ee4a 100644 --- a/include/ui/RaisedButton.h +++ b/include/ui/RaisedButton.h @@ -8,21 +8,21 @@ class RaisedButton : public FlatButton { - Q_OBJECT + Q_OBJECT public: - explicit RaisedButton(QWidget *parent = 0); - explicit RaisedButton(const QString &text, QWidget *parent = 0); - ~RaisedButton(); + explicit RaisedButton(QWidget *parent = 0); + explicit RaisedButton(const QString &text, QWidget *parent = 0); + ~RaisedButton(); protected: - bool event(QEvent *event) override; + bool event(QEvent *event) override; private: - void init(); + void init(); - QStateMachine *shadow_state_machine_; - QState *normal_state_; - QState *pressed_state_; - QGraphicsDropShadowEffect *effect_; + QStateMachine *shadow_state_machine_; + QState *normal_state_; + QState *pressed_state_; + QGraphicsDropShadowEffect *effect_; }; diff --git a/include/ui/Ripple.h b/include/ui/Ripple.h index 01e30698..0baebfd6 100644 --- a/include/ui/Ripple.h +++ b/include/ui/Ripple.h @@ -10,137 +10,137 @@ class RippleOverlay; class Ripple : public QParallelAnimationGroup { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(qreal radius WRITE setRadius READ radius) - Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity) + Q_PROPERTY(qreal radius WRITE setRadius READ radius) + Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity) public: - explicit Ripple(const QPoint ¢er, QObject *parent = 0); - Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent = 0); - ~Ripple(); + explicit Ripple(const QPoint ¢er, QObject *parent = 0); + Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent = 0); + ~Ripple(); - inline void setOverlay(RippleOverlay *overlay); + inline void setOverlay(RippleOverlay *overlay); - void setRadius(qreal radius); - void setOpacity(qreal opacity); - void setColor(const QColor &color); - void setBrush(const QBrush &brush); + void setRadius(qreal radius); + void setOpacity(qreal opacity); + void setColor(const QColor &color); + void setBrush(const QBrush &brush); - inline qreal radius() const; - inline qreal opacity() const; - inline QColor color() const; - inline QBrush brush() const; - inline QPoint center() const; + inline qreal radius() const; + inline qreal opacity() const; + inline QColor color() const; + inline QBrush brush() const; + inline QPoint center() const; - inline QPropertyAnimation *radiusAnimation() const; - inline QPropertyAnimation *opacityAnimation() const; + inline QPropertyAnimation *radiusAnimation() const; + inline QPropertyAnimation *opacityAnimation() const; - inline void setOpacityStartValue(qreal value); - inline void setOpacityEndValue(qreal value); - inline void setRadiusStartValue(qreal value); - inline void setRadiusEndValue(qreal value); - inline void setDuration(int msecs); + inline void setOpacityStartValue(qreal value); + inline void setOpacityEndValue(qreal value); + inline void setRadiusStartValue(qreal value); + inline void setRadiusEndValue(qreal value); + inline void setDuration(int msecs); protected slots: - void destroy(); + void destroy(); private: - Q_DISABLE_COPY(Ripple) + Q_DISABLE_COPY(Ripple) - QPropertyAnimation *animate(const QByteArray &property, - const QEasingCurve &easing = QEasingCurve::OutQuad, - int duration = 800); + QPropertyAnimation *animate(const QByteArray &property, + const QEasingCurve &easing = QEasingCurve::OutQuad, + int duration = 800); - void init(); + void init(); - RippleOverlay *overlay_; + RippleOverlay *overlay_; - QPropertyAnimation *const radius_anim_; - QPropertyAnimation *const opacity_anim_; + QPropertyAnimation *const radius_anim_; + QPropertyAnimation *const opacity_anim_; - qreal radius_; - qreal opacity_; + qreal radius_; + qreal opacity_; - QPoint center_; - QBrush brush_; + QPoint center_; + QBrush brush_; }; inline void Ripple::setOverlay(RippleOverlay *overlay) { - overlay_ = overlay; + overlay_ = overlay; } inline qreal Ripple::radius() const { - return radius_; + return radius_; } inline qreal Ripple::opacity() const { - return opacity_; + return opacity_; } inline QColor Ripple::color() const { - return brush_.color(); + return brush_.color(); } inline QBrush Ripple::brush() const { - return brush_; + return brush_; } inline QPoint Ripple::center() const { - return center_; + return center_; } inline QPropertyAnimation * Ripple::radiusAnimation() const { - return radius_anim_; + return radius_anim_; } inline QPropertyAnimation * Ripple::opacityAnimation() const { - return opacity_anim_; + return opacity_anim_; } inline void Ripple::setOpacityStartValue(qreal value) { - opacity_anim_->setStartValue(value); + opacity_anim_->setStartValue(value); } inline void Ripple::setOpacityEndValue(qreal value) { - opacity_anim_->setEndValue(value); + opacity_anim_->setEndValue(value); } inline void Ripple::setRadiusStartValue(qreal value) { - radius_anim_->setStartValue(value); + radius_anim_->setStartValue(value); } inline void Ripple::setRadiusEndValue(qreal value) { - radius_anim_->setEndValue(value); + radius_anim_->setEndValue(value); } inline void Ripple::setDuration(int msecs) { - radius_anim_->setDuration(msecs); - opacity_anim_->setDuration(msecs); + radius_anim_->setDuration(msecs); + opacity_anim_->setDuration(msecs); } diff --git a/include/ui/RippleOverlay.h b/include/ui/RippleOverlay.h index cc6fd05e..28a6b9e4 100644 --- a/include/ui/RippleOverlay.h +++ b/include/ui/RippleOverlay.h @@ -8,51 +8,51 @@ class Ripple; class RippleOverlay : public OverlayWidget { - Q_OBJECT + Q_OBJECT public: - explicit RippleOverlay(QWidget *parent = 0); - ~RippleOverlay(); + explicit RippleOverlay(QWidget *parent = 0); + ~RippleOverlay(); - void addRipple(Ripple *ripple); - void addRipple(const QPoint &position, qreal radius = 300); + void addRipple(Ripple *ripple); + void addRipple(const QPoint &position, qreal radius = 300); - void removeRipple(Ripple *ripple); + void removeRipple(Ripple *ripple); - inline void setClipping(bool enable); - inline bool hasClipping() const; + inline void setClipping(bool enable); + inline bool hasClipping() const; - inline void setClipPath(const QPainterPath &path); + inline void setClipPath(const QPainterPath &path); protected: - void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; private: - Q_DISABLE_COPY(RippleOverlay) + Q_DISABLE_COPY(RippleOverlay) - void paintRipple(QPainter *painter, Ripple *ripple); + void paintRipple(QPainter *painter, Ripple *ripple); - QList ripples_; - QPainterPath clip_path_; - bool use_clip_; + QList ripples_; + QPainterPath clip_path_; + bool use_clip_; }; inline void RippleOverlay::setClipping(bool enable) { - use_clip_ = enable; - update(); + use_clip_ = enable; + update(); } inline bool RippleOverlay::hasClipping() const { - return use_clip_; + return use_clip_; } inline void RippleOverlay::setClipPath(const QPainterPath &path) { - clip_path_ = path; - update(); + clip_path_ = path; + update(); } diff --git a/include/ui/ScrollBar.h b/include/ui/ScrollBar.h index 483a73c4..1c056409 100644 --- a/include/ui/ScrollBar.h +++ b/include/ui/ScrollBar.h @@ -25,29 +25,29 @@ class ScrollBar : public QScrollBar { - Q_OBJECT + Q_OBJECT public: - ScrollBar(QScrollArea *area, QWidget *parent = nullptr); + ScrollBar(QScrollArea *area, QWidget *parent = nullptr); - void fadeIn(); - void fadeOut(); + void fadeIn(); + void fadeOut(); protected: - void paintEvent(QPaintEvent *e) override; - void sliderChange(SliderChange change) override; + void paintEvent(QPaintEvent *e) override; + void sliderChange(SliderChange change) override; private: - int roundRadius_ = 4; - int handleWidth_ = 7; - int minHandleHeight_ = 20; - bool isActive; + int roundRadius_ = 4; + int handleWidth_ = 7; + int minHandleHeight_ = 20; + bool isActive; - const int AnimationDuration = 300; - const int Padding = 4; + const int AnimationDuration = 300; + const int Padding = 4; - QGraphicsOpacityEffect *eff; - QTimer hideTimer_; + QGraphicsOpacityEffect *eff; + QTimer hideTimer_; - QScrollArea *area_; - QRect handle_; + QScrollArea *area_; + QRect handle_; }; diff --git a/include/ui/TextField.h b/include/ui/TextField.h index ec761483..c215a1f8 100644 --- a/include/ui/TextField.h +++ b/include/ui/TextField.h @@ -13,163 +13,163 @@ class TextFieldStateMachine; class TextField : public QLineEdit { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor) - Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor) - Q_PROPERTY(QColor underlineColor WRITE setUnderlineColor READ underlineColor) + Q_PROPERTY(QColor textColor WRITE setTextColor READ textColor) + Q_PROPERTY(QColor inkColor WRITE setInkColor READ inkColor) + Q_PROPERTY(QColor underlineColor WRITE setUnderlineColor READ underlineColor) public: - explicit TextField(QWidget *parent = 0); - ~TextField(); + explicit TextField(QWidget *parent = 0); + ~TextField(); - void setInkColor(const QColor &color); - void setBackgroundColor(const QColor &color); - void setLabel(const QString &label); - void setLabelColor(const QColor &color); - void setLabelFontSize(qreal size); - void setShowLabel(bool value); - void setTextColor(const QColor &color); - void setUnderlineColor(const QColor &color); + void setInkColor(const QColor &color); + void setBackgroundColor(const QColor &color); + void setLabel(const QString &label); + void setLabelColor(const QColor &color); + void setLabelFontSize(qreal size); + void setShowLabel(bool value); + void setTextColor(const QColor &color); + void setUnderlineColor(const QColor &color); - QColor inkColor() const; - QColor labelColor() const; - QColor textColor() const; - QColor underlineColor() const; - QColor backgroundColor() const; - QString label() const; - bool hasLabel() const; - qreal labelFontSize() const; + QColor inkColor() const; + QColor labelColor() const; + QColor textColor() const; + QColor underlineColor() const; + QColor backgroundColor() const; + QString label() const; + bool hasLabel() const; + qreal labelFontSize() const; protected: - bool event(QEvent *event) override; - void paintEvent(QPaintEvent *event) override; + bool event(QEvent *event) override; + void paintEvent(QPaintEvent *event) override; private: - void init(); + void init(); - QColor ink_color_; - QColor background_color_; - QColor label_color_; - QColor text_color_; - QColor underline_color_; - QString label_text_; - TextFieldLabel *label_; - TextFieldStateMachine *state_machine_; - bool show_label_; - qreal label_font_size_; + QColor ink_color_; + QColor background_color_; + QColor label_color_; + QColor text_color_; + QColor underline_color_; + QString label_text_; + TextFieldLabel *label_; + TextFieldStateMachine *state_machine_; + bool show_label_; + qreal label_font_size_; }; class TextFieldLabel : public QWidget { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(qreal scale WRITE setScale READ scale) - Q_PROPERTY(QPointF offset WRITE setOffset READ offset) - Q_PROPERTY(QColor color WRITE setColor READ color) + Q_PROPERTY(qreal scale WRITE setScale READ scale) + Q_PROPERTY(QPointF offset WRITE setOffset READ offset) + Q_PROPERTY(QColor color WRITE setColor READ color) public: - TextFieldLabel(TextField *parent); - ~TextFieldLabel(); + TextFieldLabel(TextField *parent); + ~TextFieldLabel(); - inline void setColor(const QColor &color); - inline void setOffset(const QPointF &pos); - inline void setScale(qreal scale); + inline void setColor(const QColor &color); + inline void setOffset(const QPointF &pos); + inline void setScale(qreal scale); - inline QColor color() const; - inline QPointF offset() const; - inline qreal scale() const; + inline QColor color() const; + inline QPointF offset() const; + inline qreal scale() const; protected: - void paintEvent(QPaintEvent *event) override; + void paintEvent(QPaintEvent *event) override; private: - TextField *const text_field_; + TextField *const text_field_; - QColor color_; - qreal scale_; - qreal x_; - qreal y_; + QColor color_; + qreal scale_; + qreal x_; + qreal y_; }; inline void TextFieldLabel::setColor(const QColor &color) { - color_ = color; - update(); + color_ = color; + update(); } inline void TextFieldLabel::setOffset(const QPointF &pos) { - x_ = pos.x(); - y_ = pos.y(); - update(); + x_ = pos.x(); + y_ = pos.y(); + update(); } inline void TextFieldLabel::setScale(qreal scale) { - scale_ = scale; - update(); + scale_ = scale; + update(); } inline QPointF TextFieldLabel::offset() const { - return QPointF(x_, y_); + return QPointF(x_, y_); } inline qreal TextFieldLabel::scale() const { - return scale_; + return scale_; } inline QColor TextFieldLabel::color() const { - return color_; + return color_; } class TextFieldStateMachine : public QStateMachine { - Q_OBJECT + Q_OBJECT - Q_PROPERTY(qreal progress WRITE setProgress READ progress) + Q_PROPERTY(qreal progress WRITE setProgress READ progress) public: - TextFieldStateMachine(TextField *parent); - ~TextFieldStateMachine(); + TextFieldStateMachine(TextField *parent); + ~TextFieldStateMachine(); - inline void setProgress(qreal progress); - void setLabel(TextFieldLabel *label); + inline void setProgress(qreal progress); + void setLabel(TextFieldLabel *label); - inline qreal progress() const; + inline qreal progress() const; public slots: - void setupProperties(); + void setupProperties(); private: - QPropertyAnimation *color_anim_; - QPropertyAnimation *offset_anim_; + QPropertyAnimation *color_anim_; + QPropertyAnimation *offset_anim_; - QState *focused_state_; - QState *normal_state_; + QState *focused_state_; + QState *normal_state_; - TextField *text_field_; - TextFieldLabel *label_; + TextField *text_field_; + TextFieldLabel *label_; - qreal progress_; + qreal progress_; }; inline void TextFieldStateMachine::setProgress(qreal progress) { - progress_ = progress; - text_field_->update(); + progress_ = progress; + text_field_->update(); } inline qreal TextFieldStateMachine::progress() const { - return progress_; + return progress_; } diff --git a/include/ui/Theme.h b/include/ui/Theme.h index 9806686c..c2e809e5 100644 --- a/include/ui/Theme.h +++ b/include/ui/Theme.h @@ -10,7 +10,7 @@ enum class AvatarType { Icon, Image, Letter }; namespace sidebar { -static const int SmallSize = 60; +static const int SmallSize = 60; static const int NormalSize = 300; } // Default font size. @@ -32,35 +32,35 @@ enum class ButtonIconPlacement { LeftIcon, RightIcon }; enum class ProgressType { DeterminateProgress, IndeterminateProgress }; enum class Color { - Black, - BrightWhite, - FadedWhite, - MediumWhite, - DarkGreen, - LightGreen, - BrightGreen, - Gray, - Red, - Blue, - Transparent + Black, + BrightWhite, + FadedWhite, + MediumWhite, + DarkGreen, + LightGreen, + BrightGreen, + Gray, + Red, + Blue, + Transparent }; } // namespace ui class Theme : public QObject { - Q_OBJECT + Q_OBJECT public: - explicit Theme(QObject *parent = 0); - ~Theme(); + explicit Theme(QObject *parent = 0); + ~Theme(); - QColor getColor(const QString &key) const; + QColor getColor(const QString &key) const; - void setColor(const QString &key, const QColor &color); - void setColor(const QString &key, ui::Color color); + void setColor(const QString &key, const QColor &color); + void setColor(const QString &key, ui::Color color); private: - QColor rgba(int r, int g, int b, qreal a) const; + QColor rgba(int r, int g, int b, qreal a) const; - QHash colors_; + QHash colors_; }; diff --git a/include/ui/ThemeManager.h b/include/ui/ThemeManager.h index a6947bc9..d35ff754 100644 --- a/include/ui/ThemeManager.h +++ b/include/ui/ThemeManager.h @@ -6,26 +6,26 @@ class ThemeManager : public QCommonStyle { - Q_OBJECT + Q_OBJECT public: - inline static ThemeManager &instance(); + inline static ThemeManager &instance(); - void setTheme(Theme *theme); - QColor themeColor(const QString &key) const; + void setTheme(Theme *theme); + QColor themeColor(const QString &key) const; private: - ThemeManager(); + ThemeManager(); - ThemeManager(ThemeManager const &); - void operator=(ThemeManager const &); + ThemeManager(ThemeManager const &); + void operator=(ThemeManager const &); - Theme *theme_; + Theme *theme_; }; inline ThemeManager & ThemeManager::instance() { - static ThemeManager instance; - return instance; + static ThemeManager instance; + return instance; } diff --git a/src/AvatarProvider.cc b/src/AvatarProvider.cc index bf84295f..c4e5d19e 100644 --- a/src/AvatarProvider.cc +++ b/src/AvatarProvider.cc @@ -26,63 +26,63 @@ QMap> AvatarProvider::toBeResolved_; void AvatarProvider::init(QSharedPointer client) { - client_ = client; + client_ = client; - connect(client_.data(), &MatrixClient::userAvatarRetrieved, &AvatarProvider::updateAvatar); + connect(client_.data(), &MatrixClient::userAvatarRetrieved, &AvatarProvider::updateAvatar); } void AvatarProvider::updateAvatar(const QString &uid, const QImage &img) { - if (toBeResolved_.contains(uid)) { - auto items = toBeResolved_[uid]; + if (toBeResolved_.contains(uid)) { + auto items = toBeResolved_[uid]; - // Update all the timeline items with the resolved avatar. - for (const auto item : items) - item->setUserAvatar(img); + // Update all the timeline items with the resolved avatar. + for (const auto item : items) + item->setUserAvatar(img); - toBeResolved_.remove(uid); - } + toBeResolved_.remove(uid); + } - userAvatars_.insert(uid, img); + userAvatars_.insert(uid, img); } void AvatarProvider::resolve(const QString &userId, TimelineItem *item) { - if (userAvatars_.contains(userId)) { - auto img = userAvatars_[userId]; + if (userAvatars_.contains(userId)) { + auto img = userAvatars_[userId]; - item->setUserAvatar(img); + item->setUserAvatar(img); - return; - } + return; + } - if (avatarUrls_.contains(userId)) { - // Add the current timeline item to the waiting list for this avatar. - if (!toBeResolved_.contains(userId)) { - client_->fetchUserAvatar(userId, avatarUrls_[userId]); + if (avatarUrls_.contains(userId)) { + // Add the current timeline item to the waiting list for this avatar. + if (!toBeResolved_.contains(userId)) { + client_->fetchUserAvatar(userId, avatarUrls_[userId]); - QList timelineItems; - timelineItems.push_back(item); + QList timelineItems; + timelineItems.push_back(item); - toBeResolved_.insert(userId, timelineItems); - } else { - toBeResolved_[userId].push_back(item); - } - } + toBeResolved_.insert(userId, timelineItems); + } else { + toBeResolved_[userId].push_back(item); + } + } } void AvatarProvider::setAvatarUrl(const QString &userId, const QUrl &url) { - avatarUrls_.insert(userId, url); + avatarUrls_.insert(userId, url); } void AvatarProvider::clear() { - userAvatars_.clear(); - avatarUrls_.clear(); - toBeResolved_.clear(); + userAvatars_.clear(); + avatarUrls_.clear(); + toBeResolved_.clear(); } diff --git a/src/Deserializable.cc b/src/Deserializable.cc index 331beeba..9bef7d68 100644 --- a/src/Deserializable.cc +++ b/src/Deserializable.cc @@ -29,5 +29,5 @@ DeserializationException::DeserializationException(const std::string &msg) const char * DeserializationException::what() const noexcept { - return msg_.c_str(); + return msg_.c_str(); } diff --git a/src/EmojiCategory.cc b/src/EmojiCategory.cc index 66394de1..9de86d6b 100644 --- a/src/EmojiCategory.cc +++ b/src/EmojiCategory.cc @@ -24,60 +24,60 @@ EmojiCategory::EmojiCategory(QString category, QList emoji, QWidget *parent) : QWidget(parent) { - mainLayout_ = new QVBoxLayout(this); - mainLayout_->setMargin(0); + mainLayout_ = new QVBoxLayout(this); + mainLayout_->setMargin(0); - emojiListView_ = new QListView(); - itemModel_ = new QStandardItemModel(this); + emojiListView_ = new QListView(); + itemModel_ = new QStandardItemModel(this); - delegate_ = new EmojiItemDelegate(this); - data_ = new Emoji; + delegate_ = new EmojiItemDelegate(this); + data_ = new Emoji; - emojiListView_->setItemDelegate(delegate_); - emojiListView_->setSpacing(5); - emojiListView_->setModel(itemModel_); - emojiListView_->setViewMode(QListView::IconMode); - emojiListView_->setFlow(QListView::LeftToRight); - emojiListView_->setResizeMode(QListView::Adjust); - emojiListView_->verticalScrollBar()->setEnabled(false); - emojiListView_->horizontalScrollBar()->setEnabled(false); + emojiListView_->setItemDelegate(delegate_); + emojiListView_->setSpacing(5); + emojiListView_->setModel(itemModel_); + emojiListView_->setViewMode(QListView::IconMode); + emojiListView_->setFlow(QListView::LeftToRight); + emojiListView_->setResizeMode(QListView::Adjust); + emojiListView_->verticalScrollBar()->setEnabled(false); + emojiListView_->horizontalScrollBar()->setEnabled(false); - const int cols = 7; - const int rows = emoji.size() / 7; + const int cols = 7; + const int rows = emoji.size() / 7; - // TODO: Be precise here. Take the parent into consideration. - emojiListView_->setFixedSize(cols * 50 + 20, rows * 50 + 20); - emojiListView_->setGridSize(QSize(50, 50)); - emojiListView_->setDragEnabled(false); - emojiListView_->setEditTriggers(QAbstractItemView::NoEditTriggers); + // TODO: Be precise here. Take the parent into consideration. + emojiListView_->setFixedSize(cols * 50 + 20, rows * 50 + 20); + emojiListView_->setGridSize(QSize(50, 50)); + emojiListView_->setDragEnabled(false); + emojiListView_->setEditTriggers(QAbstractItemView::NoEditTriggers); - for (const auto &e : emoji) { - data_->unicode = e.unicode; + for (const auto &e : emoji) { + data_->unicode = e.unicode; - auto item = new QStandardItem; - item->setSizeHint(QSize(24, 24)); + auto item = new QStandardItem; + item->setSizeHint(QSize(24, 24)); - QVariant unicode(data_->unicode); - item->setData(unicode.toString(), Qt::UserRole); + QVariant unicode(data_->unicode); + item->setData(unicode.toString(), Qt::UserRole); - itemModel_->appendRow(item); - } + itemModel_->appendRow(item); + } - QFont font("Open Sans SemiBold"); - font.setPixelSize(conf::fontSize); + QFont font("Open Sans SemiBold"); + font.setPixelSize(conf::fontSize); - category_ = new QLabel(category, this); - category_->setFont(font); - category_->setStyleSheet("color: #ccc; margin: 20px 0px 15px 8px;"); + category_ = new QLabel(category, this); + category_->setFont(font); + category_->setStyleSheet("color: #ccc; margin: 20px 0px 15px 8px;"); - auto labelLayout_ = new QHBoxLayout(); - labelLayout_->addWidget(category_); - labelLayout_->addStretch(1); + auto labelLayout_ = new QHBoxLayout(); + labelLayout_->addWidget(category_); + labelLayout_->addStretch(1); - mainLayout_->addLayout(labelLayout_); - mainLayout_->addWidget(emojiListView_); + mainLayout_->addLayout(labelLayout_); + mainLayout_->addWidget(emojiListView_); - connect(emojiListView_, &QListView::clicked, this, &EmojiCategory::clickIndex); + connect(emojiListView_, &QListView::clicked, this, &EmojiCategory::clickIndex); } EmojiCategory::~EmojiCategory() diff --git a/src/EmojiItemDelegate.cc b/src/EmojiItemDelegate.cc index 763aabd2..9fd4600d 100644 --- a/src/EmojiItemDelegate.cc +++ b/src/EmojiItemDelegate.cc @@ -23,26 +23,28 @@ EmojiItemDelegate::EmojiItemDelegate(QObject *parent) : QStyledItemDelegate(parent) { - data_ = new Emoji; + data_ = new Emoji; } EmojiItemDelegate::~EmojiItemDelegate() { - delete data_; + delete data_; } void -EmojiItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const +EmojiItemDelegate::paint(QPainter *painter, + const QStyleOptionViewItem &option, + const QModelIndex &index) const { - Q_UNUSED(index); + Q_UNUSED(index); - QStyleOptionViewItem viewOption(option); + QStyleOptionViewItem viewOption(option); - auto emoji = index.data(Qt::UserRole).toString(); + auto emoji = index.data(Qt::UserRole).toString(); - QFont font("Emoji One"); - font.setPixelSize(19); + QFont font("Emoji One"); + font.setPixelSize(19); - painter->setFont(font); - painter->drawText(viewOption.rect, Qt::AlignCenter, emoji); + painter->setFont(font); + painter->drawText(viewOption.rect, Qt::AlignCenter, emoji); } diff --git a/src/EmojiPanel.cc b/src/EmojiPanel.cc index f75bc1fc..512888ee 100644 --- a/src/EmojiPanel.cc +++ b/src/EmojiPanel.cc @@ -34,225 +34,238 @@ EmojiPanel::EmojiPanel(QWidget *parent) , animationDuration_{ 100 } , categoryIconSize_{ 20 } { - setStyleSheet("QWidget {background: #f8fbfe; color: #e8e8e8; border: none;}" - "QScrollBar:vertical { background-color: #f8fbfe; width: 8px; margin: 0px 2px 0 2px; }" - "QScrollBar::handle:vertical { background-color: #d6dde3; min-height: 20px; }" - "QScrollBar::add-line:vertical { border: none; background: none; }" - "QScrollBar::sub-line:vertical { border: none; background: none; }"); + setStyleSheet( + "QWidget {background: #f8fbfe; color: #e8e8e8; border: none;}" + "QScrollBar:vertical { background-color: #f8fbfe; width: 8px; margin: 0px 2px 0 2px; }" + "QScrollBar::handle:vertical { background-color: #d6dde3; min-height: 20px; }" + "QScrollBar::add-line:vertical { border: none; background: none; }" + "QScrollBar::sub-line:vertical { border: none; background: none; }"); - setAttribute(Qt::WA_TranslucentBackground, true); - setAttribute(Qt::WA_ShowWithoutActivating, true); - setWindowFlags(Qt::FramelessWindowHint | Qt::ToolTip); + setAttribute(Qt::WA_TranslucentBackground, true); + setAttribute(Qt::WA_ShowWithoutActivating, true); + setWindowFlags(Qt::FramelessWindowHint | Qt::ToolTip); - auto mainWidget = new QWidget(this); - mainWidget->setMaximumSize(width_, height_); + auto mainWidget = new QWidget(this); + mainWidget->setMaximumSize(width_, height_); - auto topLayout = new QVBoxLayout(this); - topLayout->addWidget(mainWidget); - topLayout->setMargin(shadowMargin_); + auto topLayout = new QVBoxLayout(this); + topLayout->addWidget(mainWidget); + topLayout->setMargin(shadowMargin_); - auto contentLayout = new QVBoxLayout(mainWidget); - contentLayout->setMargin(0); + auto contentLayout = new QVBoxLayout(mainWidget); + contentLayout->setMargin(0); - auto emojiCategories = new QFrame(mainWidget); - emojiCategories->setStyleSheet("background-color: #f2f2f2"); + auto emojiCategories = new QFrame(mainWidget); + emojiCategories->setStyleSheet("background-color: #f2f2f2"); - auto categoriesLayout = new QHBoxLayout(emojiCategories); - categoriesLayout->setSpacing(6); - categoriesLayout->setMargin(5); + auto categoriesLayout = new QHBoxLayout(emojiCategories); + categoriesLayout->setSpacing(6); + categoriesLayout->setMargin(5); - auto peopleCategory = new FlatButton(emojiCategories); - peopleCategory->setIcon(QIcon(":/icons/icons/emoji-categories/people.png")); - peopleCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); - peopleCategory->setForegroundColor("gray"); + auto peopleCategory = new FlatButton(emojiCategories); + peopleCategory->setIcon(QIcon(":/icons/icons/emoji-categories/people.png")); + peopleCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); + peopleCategory->setForegroundColor("gray"); - auto natureCategory_ = new FlatButton(emojiCategories); - natureCategory_->setIcon(QIcon(":/icons/icons/emoji-categories/nature.png")); - natureCategory_->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); - natureCategory_->setForegroundColor("gray"); + auto natureCategory_ = new FlatButton(emojiCategories); + natureCategory_->setIcon(QIcon(":/icons/icons/emoji-categories/nature.png")); + natureCategory_->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); + natureCategory_->setForegroundColor("gray"); - auto foodCategory_ = new FlatButton(emojiCategories); - foodCategory_->setIcon(QIcon(":/icons/icons/emoji-categories/foods.png")); - foodCategory_->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); - foodCategory_->setForegroundColor("gray"); + auto foodCategory_ = new FlatButton(emojiCategories); + foodCategory_->setIcon(QIcon(":/icons/icons/emoji-categories/foods.png")); + foodCategory_->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); + foodCategory_->setForegroundColor("gray"); - auto activityCategory = new FlatButton(emojiCategories); - activityCategory->setIcon(QIcon(":/icons/icons/emoji-categories/activity.png")); - activityCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); - activityCategory->setForegroundColor("gray"); + auto activityCategory = new FlatButton(emojiCategories); + activityCategory->setIcon(QIcon(":/icons/icons/emoji-categories/activity.png")); + activityCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); + activityCategory->setForegroundColor("gray"); - auto travelCategory = new FlatButton(emojiCategories); - travelCategory->setIcon(QIcon(":/icons/icons/emoji-categories/travel.png")); - travelCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); - travelCategory->setForegroundColor("gray"); + auto travelCategory = new FlatButton(emojiCategories); + travelCategory->setIcon(QIcon(":/icons/icons/emoji-categories/travel.png")); + travelCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); + travelCategory->setForegroundColor("gray"); - auto objectsCategory = new FlatButton(emojiCategories); - objectsCategory->setIcon(QIcon(":/icons/icons/emoji-categories/objects.png")); - objectsCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); - objectsCategory->setForegroundColor("gray"); + auto objectsCategory = new FlatButton(emojiCategories); + objectsCategory->setIcon(QIcon(":/icons/icons/emoji-categories/objects.png")); + objectsCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); + objectsCategory->setForegroundColor("gray"); - auto symbolsCategory = new FlatButton(emojiCategories); - symbolsCategory->setIcon(QIcon(":/icons/icons/emoji-categories/symbols.png")); - symbolsCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); - symbolsCategory->setForegroundColor("gray"); + auto symbolsCategory = new FlatButton(emojiCategories); + symbolsCategory->setIcon(QIcon(":/icons/icons/emoji-categories/symbols.png")); + symbolsCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); + symbolsCategory->setForegroundColor("gray"); - auto flagsCategory = new FlatButton(emojiCategories); - flagsCategory->setIcon(QIcon(":/icons/icons/emoji-categories/flags.png")); - flagsCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); - flagsCategory->setForegroundColor("gray"); + auto flagsCategory = new FlatButton(emojiCategories); + flagsCategory->setIcon(QIcon(":/icons/icons/emoji-categories/flags.png")); + flagsCategory->setIconSize(QSize(categoryIconSize_, categoryIconSize_)); + flagsCategory->setForegroundColor("gray"); - categoriesLayout->addWidget(peopleCategory); - categoriesLayout->addWidget(natureCategory_); - categoriesLayout->addWidget(foodCategory_); - categoriesLayout->addWidget(activityCategory); - categoriesLayout->addWidget(travelCategory); - categoriesLayout->addWidget(objectsCategory); - categoriesLayout->addWidget(symbolsCategory); - categoriesLayout->addWidget(flagsCategory); + categoriesLayout->addWidget(peopleCategory); + categoriesLayout->addWidget(natureCategory_); + categoriesLayout->addWidget(foodCategory_); + categoriesLayout->addWidget(activityCategory); + categoriesLayout->addWidget(travelCategory); + categoriesLayout->addWidget(objectsCategory); + categoriesLayout->addWidget(symbolsCategory); + categoriesLayout->addWidget(flagsCategory); - scrollArea_ = new QScrollArea(this); - scrollArea_->setWidgetResizable(true); - scrollArea_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + scrollArea_ = new QScrollArea(this); + scrollArea_->setWidgetResizable(true); + scrollArea_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - auto scrollWidget = new QWidget(this); - auto scrollLayout = new QVBoxLayout(scrollWidget); + auto scrollWidget = new QWidget(this); + auto scrollLayout = new QVBoxLayout(scrollWidget); - scrollLayout->setMargin(0); - scrollArea_->setWidget(scrollWidget); + scrollLayout->setMargin(0); + scrollArea_->setWidget(scrollWidget); - auto peopleEmoji = new EmojiCategory(tr("Smileys & People"), emoji_provider_.people, scrollWidget); - scrollLayout->addWidget(peopleEmoji); + auto peopleEmoji = + new EmojiCategory(tr("Smileys & People"), emoji_provider_.people, scrollWidget); + scrollLayout->addWidget(peopleEmoji); - auto natureEmoji = new EmojiCategory(tr("Animals & Nature"), emoji_provider_.nature, scrollWidget); - scrollLayout->addWidget(natureEmoji); + auto natureEmoji = + new EmojiCategory(tr("Animals & Nature"), emoji_provider_.nature, scrollWidget); + scrollLayout->addWidget(natureEmoji); - auto foodEmoji = new EmojiCategory(tr("Food & Drink"), emoji_provider_.food, scrollWidget); - scrollLayout->addWidget(foodEmoji); + auto foodEmoji = new EmojiCategory(tr("Food & Drink"), emoji_provider_.food, scrollWidget); + scrollLayout->addWidget(foodEmoji); - auto activityEmoji = new EmojiCategory(tr("Activity"), emoji_provider_.activity, scrollWidget); - scrollLayout->addWidget(activityEmoji); + auto activityEmoji = + new EmojiCategory(tr("Activity"), emoji_provider_.activity, scrollWidget); + scrollLayout->addWidget(activityEmoji); - auto travelEmoji = new EmojiCategory(tr("Travel & Places"), emoji_provider_.travel, scrollWidget); - scrollLayout->addWidget(travelEmoji); + auto travelEmoji = + new EmojiCategory(tr("Travel & Places"), emoji_provider_.travel, scrollWidget); + scrollLayout->addWidget(travelEmoji); - auto objectsEmoji = new EmojiCategory(tr("Objects"), emoji_provider_.objects, scrollWidget); - scrollLayout->addWidget(objectsEmoji); + auto objectsEmoji = new EmojiCategory(tr("Objects"), emoji_provider_.objects, scrollWidget); + scrollLayout->addWidget(objectsEmoji); - auto symbolsEmoji = new EmojiCategory(tr("Symbols"), emoji_provider_.symbols, scrollWidget); - scrollLayout->addWidget(symbolsEmoji); + auto symbolsEmoji = new EmojiCategory(tr("Symbols"), emoji_provider_.symbols, scrollWidget); + scrollLayout->addWidget(symbolsEmoji); - auto flagsEmoji = new EmojiCategory(tr("Flags"), emoji_provider_.flags, scrollWidget); - scrollLayout->addWidget(flagsEmoji); + auto flagsEmoji = new EmojiCategory(tr("Flags"), emoji_provider_.flags, scrollWidget); + scrollLayout->addWidget(flagsEmoji); - contentLayout->addStretch(1); - contentLayout->addWidget(scrollArea_); - contentLayout->addWidget(emojiCategories); + contentLayout->addStretch(1); + contentLayout->addWidget(scrollArea_); + contentLayout->addWidget(emojiCategories); - opacity_ = new QGraphicsOpacityEffect(this); - opacity_->setOpacity(1.0); + opacity_ = new QGraphicsOpacityEffect(this); + opacity_->setOpacity(1.0); - setGraphicsEffect(opacity_); + setGraphicsEffect(opacity_); - animation_ = new QPropertyAnimation(opacity_, "opacity", this); - animation_->setDuration(animationDuration_); - animation_->setStartValue(1); - animation_->setEndValue(0); + animation_ = new QPropertyAnimation(opacity_, "opacity", this); + animation_->setDuration(animationDuration_); + animation_->setStartValue(1); + animation_->setEndValue(0); - connect(peopleEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); - connect(peopleCategory, &QPushButton::clicked, [this, peopleEmoji]() { this->showEmojiCategory(peopleEmoji); }); + connect(peopleEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); + connect(peopleCategory, &QPushButton::clicked, [this, peopleEmoji]() { + this->showEmojiCategory(peopleEmoji); + }); - connect(natureEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); - connect(natureCategory_, &QPushButton::clicked, [this, natureEmoji]() { - this->showEmojiCategory(natureEmoji); - }); + connect(natureEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); + connect(natureCategory_, &QPushButton::clicked, [this, natureEmoji]() { + this->showEmojiCategory(natureEmoji); + }); - connect(foodEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); - connect(foodCategory_, &QPushButton::clicked, [this, foodEmoji]() { this->showEmojiCategory(foodEmoji); }); + connect(foodEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); + connect(foodCategory_, &QPushButton::clicked, [this, foodEmoji]() { + this->showEmojiCategory(foodEmoji); + }); - connect(activityEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); - connect(activityCategory, &QPushButton::clicked, [this, activityEmoji]() { - this->showEmojiCategory(activityEmoji); - }); + connect(activityEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); + connect(activityCategory, &QPushButton::clicked, [this, activityEmoji]() { + this->showEmojiCategory(activityEmoji); + }); - connect(travelEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); - connect(travelCategory, &QPushButton::clicked, [this, travelEmoji]() { this->showEmojiCategory(travelEmoji); }); + connect(travelEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); + connect(travelCategory, &QPushButton::clicked, [this, travelEmoji]() { + this->showEmojiCategory(travelEmoji); + }); - connect(objectsEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); - connect(objectsCategory, &QPushButton::clicked, [this, objectsEmoji]() { - this->showEmojiCategory(objectsEmoji); - }); + connect(objectsEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); + connect(objectsCategory, &QPushButton::clicked, [this, objectsEmoji]() { + this->showEmojiCategory(objectsEmoji); + }); - connect(symbolsEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); - connect(symbolsCategory, &QPushButton::clicked, [this, symbolsEmoji]() { - this->showEmojiCategory(symbolsEmoji); - }); + connect(symbolsEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); + connect(symbolsCategory, &QPushButton::clicked, [this, symbolsEmoji]() { + this->showEmojiCategory(symbolsEmoji); + }); - connect(flagsEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); - connect(flagsCategory, &QPushButton::clicked, [this, flagsEmoji]() { this->showEmojiCategory(flagsEmoji); }); + connect(flagsEmoji, &EmojiCategory::emojiSelected, this, &EmojiPanel::emojiSelected); + connect(flagsCategory, &QPushButton::clicked, [this, flagsEmoji]() { + this->showEmojiCategory(flagsEmoji); + }); - connect(animation_, &QAbstractAnimation::finished, [this]() { - if (animation_->direction() == QAbstractAnimation::Forward) - this->hide(); - }); + connect(animation_, &QAbstractAnimation::finished, [this]() { + if (animation_->direction() == QAbstractAnimation::Forward) + this->hide(); + }); } void EmojiPanel::showEmojiCategory(const EmojiCategory *category) { - auto posToGo = category->mapToParent(QPoint()).y(); - auto current = scrollArea_->verticalScrollBar()->value(); + auto posToGo = category->mapToParent(QPoint()).y(); + auto current = scrollArea_->verticalScrollBar()->value(); - if (current == posToGo) - return; + if (current == posToGo) + return; - // HACK - // If we want to go to a previous category and position the label at the top - // the 6*50 offset won't work because not all the categories have the same height. - // To ensure the category is at the top, we move to the top - // and go as normal to the next category. - if (current > posToGo) - this->scrollArea_->ensureVisible(0, 0, 0, 0); + // HACK + // If we want to go to a previous category and position the label at the top + // the 6*50 offset won't work because not all the categories have the same height. + // To ensure the category is at the top, we move to the top + // and go as normal to the next category. + if (current > posToGo) + this->scrollArea_->ensureVisible(0, 0, 0, 0); - posToGo += 6 * 50; - this->scrollArea_->ensureVisible(0, posToGo, 0, 0); + posToGo += 6 * 50; + this->scrollArea_->ensureVisible(0, posToGo, 0, 0); } void EmojiPanel::leaveEvent(QEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event); - fadeOut(); + fadeOut(); } void EmojiPanel::paintEvent(QPaintEvent *event) { - QPainter p(this); - DropShadow::draw(p, - shadowMargin_, - 4.0, - QColor(120, 120, 120, 92), - QColor(255, 255, 255, 0), - 0.0, - 1.0, - 0.6, - width(), - height()); + QPainter p(this); + DropShadow::draw(p, + shadowMargin_, + 4.0, + QColor(120, 120, 120, 92), + QColor(255, 255, 255, 0), + 0.0, + 1.0, + 0.6, + width(), + height()); - QWidget::paintEvent(event); + QWidget::paintEvent(event); } void EmojiPanel::fadeOut() { - animation_->setDirection(QAbstractAnimation::Forward); - animation_->start(); + animation_->setDirection(QAbstractAnimation::Forward); + animation_->start(); } void EmojiPanel::fadeIn() { - animation_->setDirection(QAbstractAnimation::Backward); - animation_->start(); + animation_->setDirection(QAbstractAnimation::Backward); + animation_->start(); } diff --git a/src/EmojiPickButton.cc b/src/EmojiPickButton.cc index 820c96a7..f3e30661 100644 --- a/src/EmojiPickButton.cc +++ b/src/EmojiPickButton.cc @@ -28,40 +28,40 @@ EmojiPickButton::EmojiPickButton(QWidget *parent) void EmojiPickButton::enterEvent(QEvent *e) { - Q_UNUSED(e); + Q_UNUSED(e); - if (panel_ == nullptr) { - panel_ = new EmojiPanel(this); - connect(panel_, &EmojiPanel::emojiSelected, this, &EmojiPickButton::emojiSelected); - } + if (panel_ == nullptr) { + panel_ = new EmojiPanel(this); + connect(panel_, &EmojiPanel::emojiSelected, this, &EmojiPickButton::emojiSelected); + } - QPoint pos(rect().x(), rect().y()); - pos = this->mapToGlobal(pos); + QPoint pos(rect().x(), rect().y()); + pos = this->mapToGlobal(pos); - auto panel_size = panel_->sizeHint(); + auto panel_size = panel_->sizeHint(); - auto x = pos.x() - panel_size.width() + horizontal_distance_; - auto y = pos.y() - panel_size.height() - vertical_distance_; + auto x = pos.x() - panel_size.width() + horizontal_distance_; + auto y = pos.y() - panel_size.height() - vertical_distance_; - panel_->move(x, y); - panel_->fadeIn(); - panel_->show(); + panel_->move(x, y); + panel_->fadeIn(); + panel_->show(); } void EmojiPickButton::leaveEvent(QEvent *e) { - Q_UNUSED(e); + Q_UNUSED(e); - if (panel_->underMouse()) - return; + if (panel_->underMouse()) + return; - auto pos = QCursor::pos(); - auto panel_geometry = panel_->geometry(); - panel_geometry.adjust(0, 0, 0, vertical_distance_); + auto pos = QCursor::pos(); + auto panel_geometry = panel_->geometry(); + panel_geometry.adjust(0, 0, 0, vertical_distance_); - if (panel_geometry.contains(pos)) - return; + if (panel_geometry.contains(pos)) + return; - panel_->fadeOut(); + panel_->fadeOut(); } diff --git a/src/EmojiProvider.cc b/src/EmojiProvider.cc index 55f30c07..11cdffcb 100644 --- a/src/EmojiProvider.cc +++ b/src/EmojiProvider.cc @@ -25,1446 +25,1451 @@ #include "EmojiProvider.h" const QList EmojiProvider::people = { - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x80"), ":grinning:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x81"), ":grin:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x82"), ":joy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa3"), ":rofl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x83"), ":smiley:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x84"), ":smile:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x85"), ":sweat_smile:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x86"), ":laughing:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x89"), ":wink:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8a"), ":blush:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8b"), ":yum:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8e"), ":sunglasses:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8d"), ":heart_eyes:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x98"), ":kissing_heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x97"), ":kissing:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x99"), ":kissing_smiling_eyes:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9a"), ":kissing_closed_eyes:" }, - Emoji{ QString::fromUtf8("\xe2\x98\xba"), ":relaxed:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x82"), ":slight_smile:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x97"), ":hugging:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x94"), ":thinking:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x90"), ":neutral_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x91"), ":expressionless:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb6"), ":no_mouth:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x84"), ":rolling_eyes:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8f"), ":smirk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa3"), ":persevere:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa5"), ":disappointed_relieved:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xae"), ":open_mouth:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x90"), ":zipper_mouth:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xaf"), ":hushed:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xaa"), ":sleepy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xab"), ":tired_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb4"), ":sleeping:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8c"), ":relieved:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x93"), ":nerd:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9b"), ":stuck_out_tongue:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9c"), ":stuck_out_tongue_winking_eye:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9d"), ":stuck_out_tongue_closed_eyes:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa4"), ":drooling_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x92"), ":unamused:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x93"), ":sweat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x94"), ":pensive:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x95"), ":confused:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x83"), ":upside_down:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x91"), ":money_mouth:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb2"), ":astonished:" }, - Emoji{ QString::fromUtf8("\xe2\x98\xb9"), ":frowning2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x81"), ":slight_frown:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x96"), ":confounded:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9e"), ":disappointed:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9f"), ":worried:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa4"), ":triumph:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa2"), ":cry:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xad"), ":sob:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa6"), ":frowning:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa7"), ":anguished:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa8"), ":fearful:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa9"), ":weary:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xac"), ":grimacing:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb0"), ":cold_sweat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb1"), ":scream:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb3"), ":flushed:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb5"), ":dizzy_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa1"), ":rage:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa0"), ":angry:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x87"), ":innocent:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa0"), ":cowboy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa1"), ":clown:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa5"), ":lying_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb7"), ":mask:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x92"), ":thermometer_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x95"), ":head_bandage:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa2"), ":nauseated_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa7"), ":sneezing_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\x88"), ":smiling_imp:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xbf"), ":imp:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb9"), ":japanese_ogre:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xba"), ":japanese_goblin:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x80"), ":skull:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xbb"), ":ghost:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xbd"), ":alien:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x96"), ":robot:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa9"), ":poop:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xba"), ":smiley_cat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb8"), ":smile_cat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb9"), ":joy_cat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xbb"), ":heart_eyes_cat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xbc"), ":smirk_cat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xbd"), ":kissing_cat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x80"), ":scream_cat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xbf"), ":crying_cat_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x98\xbe"), ":pouting_cat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa6"), ":boy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa7"), ":girl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa8"), ":man:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa9"), ":woman:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb4"), ":older_man:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb5"), ":older_woman:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb6"), ":baby:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xbc"), ":angel:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xae"), ":cop:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb5"), ":spy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x82"), ":guardsman:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb7"), ":construction_worker:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb3"), ":man_with_turban:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb1"), ":person_with_blond_hair:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x85"), ":santa:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb6"), ":mrs_claus:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb8"), ":princess:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb4"), ":prince:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb0"), ":bride_with_veil:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb5"), ":man_in_tuxedo:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb0"), ":pregnant_woman:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb2"), ":man_with_gua_pi_mao:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8d"), ":person_frowning:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8e"), ":person_with_pouting_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x85"), ":no_good:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x86"), ":ok_woman:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x81"), ":information_desk_person:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8b"), ":raising_hand:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x87"), ":bow:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa6"), ":face_palm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb7"), ":shrug:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x86"), ":massage:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x87"), ":haircut:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb6"), ":walking:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x83"), ":runner:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x83"), ":dancer:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xba"), ":man_dancing:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xaf"), ":dancers:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xa3"), ":speaking_head:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa4"), ":bust_in_silhouette:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa5"), ":busts_in_silhouette:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xab"), ":couple:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xac"), ":two_men_holding_hands:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xad"), ":two_women_holding_hands:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8f"), ":couplekiss:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x91"), ":couple_with_heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xaa"), ":family:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xaa"), ":muscle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb3"), ":selfie:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x88"), ":point_left:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x89"), ":point_right:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x9d"), ":point_up:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x86"), ":point_up_2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\x95"), ":middle_finger:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x87"), ":point_down:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x8c"), ":v:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x9e"), ":fingers_crossed:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\x96"), ":vulcan:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x98"), ":metal:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x99"), ":call_me:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\x90"), ":hand_splayed:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x8b"), ":raised_hand:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8c"), ":ok_hand:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8d"), ":thumbsup:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8e"), ":thumbsdown:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x8a"), ":fist:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8a"), ":punch:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x9b"), ":left_facing_fist:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x9c"), ":right_facing_fist:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x9a"), ":raised_back_of_hand:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8b"), ":wave:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8f"), ":clap:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x8d"), ":writing_hand:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x90"), ":open_hands:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8c"), ":raised_hands:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8f"), ":pray:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x9d"), ":handshake:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x85"), ":nail_care:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x82"), ":ear:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x83"), ":nose:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa3"), ":footprints:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x80"), ":eyes:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x81"), ":eye:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x85"), ":tongue:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x84"), ":lips:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8b"), ":kiss:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa4"), ":zzz:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x93"), ":eyeglasses:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb6"), ":dark_sunglasses:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x94"), ":necktie:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x95"), ":shirt:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x96"), ":jeans:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x97"), ":dress:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x98"), ":kimono:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x99"), ":bikini:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9a"), ":womans_clothes:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9b"), ":purse:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9c"), ":handbag:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9d"), ":pouch:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x92"), ":school_satchel:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9e"), ":mans_shoe:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9f"), ":athletic_shoe:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa0"), ":high_heel:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa1"), ":sandal:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa2"), ":boot:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x91"), ":crown:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x92"), ":womans_hat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa9"), ":tophat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x93"), ":mortar_board:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\x91"), ":helmet_with_cross:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x84"), ":lipstick:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8d"), ":ring:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x82"), ":closed_umbrella:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xbc"), ":briefcase:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x80"), ":grinning:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x81"), ":grin:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x82"), ":joy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa3"), ":rofl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x83"), ":smiley:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x84"), ":smile:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x85"), ":sweat_smile:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x86"), ":laughing:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x89"), ":wink:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8a"), ":blush:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8b"), ":yum:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8e"), ":sunglasses:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8d"), ":heart_eyes:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x98"), ":kissing_heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x97"), ":kissing:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x99"), ":kissing_smiling_eyes:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9a"), ":kissing_closed_eyes:" }, + Emoji{ QString::fromUtf8("\xe2\x98\xba"), ":relaxed:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x82"), ":slight_smile:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x97"), ":hugging:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x94"), ":thinking:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x90"), ":neutral_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x91"), ":expressionless:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb6"), ":no_mouth:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x84"), ":rolling_eyes:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8f"), ":smirk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa3"), ":persevere:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa5"), ":disappointed_relieved:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xae"), ":open_mouth:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x90"), ":zipper_mouth:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xaf"), ":hushed:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xaa"), ":sleepy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xab"), ":tired_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb4"), ":sleeping:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x8c"), ":relieved:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x93"), ":nerd:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9b"), ":stuck_out_tongue:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9c"), ":stuck_out_tongue_winking_eye:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9d"), ":stuck_out_tongue_closed_eyes:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa4"), ":drooling_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x92"), ":unamused:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x93"), ":sweat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x94"), ":pensive:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x95"), ":confused:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x83"), ":upside_down:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x91"), ":money_mouth:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb2"), ":astonished:" }, + Emoji{ QString::fromUtf8("\xe2\x98\xb9"), ":frowning2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x81"), ":slight_frown:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x96"), ":confounded:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9e"), ":disappointed:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x9f"), ":worried:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa4"), ":triumph:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa2"), ":cry:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xad"), ":sob:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa6"), ":frowning:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa7"), ":anguished:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa8"), ":fearful:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa9"), ":weary:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xac"), ":grimacing:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb0"), ":cold_sweat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb1"), ":scream:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb3"), ":flushed:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb5"), ":dizzy_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa1"), ":rage:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xa0"), ":angry:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x87"), ":innocent:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa0"), ":cowboy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa1"), ":clown:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa5"), ":lying_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb7"), ":mask:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x92"), ":thermometer_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x95"), ":head_bandage:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa2"), ":nauseated_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa7"), ":sneezing_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\x88"), ":smiling_imp:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xbf"), ":imp:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb9"), ":japanese_ogre:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xba"), ":japanese_goblin:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x80"), ":skull:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xbb"), ":ghost:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xbd"), ":alien:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x96"), ":robot:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa9"), ":poop:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xba"), ":smiley_cat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb8"), ":smile_cat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xb9"), ":joy_cat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xbb"), ":heart_eyes_cat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xbc"), ":smirk_cat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xbd"), ":kissing_cat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x80"), ":scream_cat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xbf"), ":crying_cat_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x98\xbe"), ":pouting_cat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa6"), ":boy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa7"), ":girl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa8"), ":man:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa9"), ":woman:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb4"), ":older_man:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb5"), ":older_woman:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb6"), ":baby:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xbc"), ":angel:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xae"), ":cop:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb5"), ":spy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x82"), ":guardsman:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb7"), ":construction_worker:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb3"), ":man_with_turban:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb1"), ":person_with_blond_hair:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x85"), ":santa:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb6"), ":mrs_claus:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb8"), ":princess:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb4"), ":prince:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb0"), ":bride_with_veil:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb5"), ":man_in_tuxedo:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb0"), ":pregnant_woman:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xb2"), ":man_with_gua_pi_mao:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8d"), ":person_frowning:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8e"), ":person_with_pouting_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x85"), ":no_good:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x86"), ":ok_woman:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x81"), ":information_desk_person:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8b"), ":raising_hand:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x87"), ":bow:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xa6"), ":face_palm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb7"), ":shrug:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x86"), ":massage:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x87"), ":haircut:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb6"), ":walking:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x83"), ":runner:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x83"), ":dancer:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xba"), ":man_dancing:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xaf"), ":dancers:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xa3"), ":speaking_head:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa4"), ":bust_in_silhouette:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa5"), ":busts_in_silhouette:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xab"), ":couple:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xac"), ":two_men_holding_hands:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xad"), ":two_women_holding_hands:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8f"), ":couplekiss:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x91"), ":couple_with_heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xaa"), ":family:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xaa"), ":muscle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb3"), ":selfie:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x88"), ":point_left:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x89"), ":point_right:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x9d"), ":point_up:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x86"), ":point_up_2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\x95"), ":middle_finger:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x87"), ":point_down:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x8c"), ":v:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x9e"), ":fingers_crossed:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\x96"), ":vulcan:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x98"), ":metal:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x99"), ":call_me:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\x90"), ":hand_splayed:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x8b"), ":raised_hand:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8c"), ":ok_hand:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8d"), ":thumbsup:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8e"), ":thumbsdown:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x8a"), ":fist:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8a"), ":punch:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x9b"), ":left_facing_fist:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x9c"), ":right_facing_fist:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x9a"), ":raised_back_of_hand:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8b"), ":wave:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x8f"), ":clap:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x8d"), ":writing_hand:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x90"), ":open_hands:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8c"), ":raised_hands:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8f"), ":pray:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\x9d"), ":handshake:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x85"), ":nail_care:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x82"), ":ear:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x83"), ":nose:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa3"), ":footprints:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x80"), ":eyes:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x81"), ":eye:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x85"), ":tongue:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x84"), ":lips:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8b"), ":kiss:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa4"), ":zzz:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x93"), ":eyeglasses:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb6"), ":dark_sunglasses:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x94"), ":necktie:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x95"), ":shirt:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x96"), ":jeans:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x97"), ":dress:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x98"), ":kimono:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x99"), ":bikini:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9a"), ":womans_clothes:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9b"), ":purse:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9c"), ":handbag:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9d"), ":pouch:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x92"), ":school_satchel:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9e"), ":mans_shoe:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x9f"), ":athletic_shoe:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa0"), ":high_heel:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa1"), ":sandal:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xa2"), ":boot:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x91"), ":crown:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x92"), ":womans_hat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa9"), ":tophat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x93"), ":mortar_board:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\x91"), ":helmet_with_cross:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x84"), ":lipstick:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8d"), ":ring:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x82"), ":closed_umbrella:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xbc"), ":briefcase:" }, }; const QList EmojiProvider::nature = { - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x88"), ":see_no_evil:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x89"), ":hear_no_evil:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8a"), ":speak_no_evil:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa6"), ":sweat_drops:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa8"), ":dash:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb5"), ":monkey_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x92"), ":monkey:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8d"), ":gorilla:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb6"), ":dog:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x95"), ":dog2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa9"), ":poodle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xba"), ":wolf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8a"), ":fox:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb1"), ":cat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x88"), ":cat2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x81"), ":lion_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xaf"), ":tiger:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x85"), ":tiger2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x86"), ":leopard:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb4"), ":horse:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8e"), ":racehorse:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8c"), ":deer:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x84"), ":unicorn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xae"), ":cow:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x82"), ":ox:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x83"), ":water_buffalo:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x84"), ":cow2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb7"), ":pig:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x96"), ":pig2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x97"), ":boar:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xbd"), ":pig_nose:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8f"), ":ram:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x91"), ":sheep:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x90"), ":goat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xaa"), ":dromedary_camel:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xab"), ":camel:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x98"), ":elephant:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8f"), ":rhino:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xad"), ":mouse:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x81"), ":mouse2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x80"), ":rat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb9"), ":hamster:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb0"), ":rabbit:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x87"), ":rabbit2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xbf"), ":chipmunk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x87"), ":bat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xbb"), ":bear:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa8"), ":koala:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xbc"), ":panda_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xbe"), ":feet:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x83"), ":turkey:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x94"), ":chicken:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x93"), ":rooster:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa3"), ":hatching_chick:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa4"), ":baby_chick:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa5"), ":hatched_chick:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa6"), ":bird:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa7"), ":penguin:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x8a"), ":dove:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x85"), ":eagle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x86"), ":duck:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x89"), ":owl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb8"), ":frog:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8a"), ":crocodile:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa2"), ":turtle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8e"), ":lizard:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8d"), ":snake:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb2"), ":dragon_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x89"), ":dragon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb3"), ":whale:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8b"), ":whale2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xac"), ":dolphin:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9f"), ":fish:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa0"), ":tropical_fish:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa1"), ":blowfish:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x88"), ":shark:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x99"), ":octopus:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9a"), ":shell:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x80"), ":crab:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x90"), ":shrimp:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x91"), ":squid:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8b"), ":butterfly:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8c"), ":snail:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9b"), ":bug:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9c"), ":ant:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9d"), ":bee:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9e"), ":beetle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb7"), ":spider:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb8"), ":spider_web:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x82"), ":scorpion:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x90"), ":bouquet:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb8"), ":cherry_blossom:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb5"), ":rosette:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb9"), ":rose:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x80"), ":wilted_rose:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xba"), ":hibiscus:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xbb"), ":sunflower:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xbc"), ":blossom:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb7"), ":tulip:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb1"), ":seedling:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb2"), ":evergreen_tree:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb3"), ":deciduous_tree:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb4"), ":palm_tree:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb5"), ":cactus:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xbe"), ":ear_of_rice:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xbf"), ":herb:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x98"), ":shamrock:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x80"), ":four_leaf_clover:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x81"), ":maple_leaf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x82"), ":fallen_leaf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x83"), ":leaves:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x84"), ":mushroom:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb0"), ":chestnut:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8d"), ":earth_africa:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8e"), ":earth_americas:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8f"), ":earth_asia:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x91"), ":new_moon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x92"), ":waxing_crescent_moon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x93"), ":first_quarter_moon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x94"), ":waxing_gibbous_moon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x95"), ":full_moon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x96"), ":waning_gibbous_moon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x97"), ":last_quarter_moon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x98"), ":waning_crescent_moon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x99"), ":crescent_moon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9a"), ":new_moon_with_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9b"), ":first_quarter_moon_with_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9c"), ":last_quarter_moon_with_face:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x80"), ":sunny:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9d"), ":full_moon_with_face:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9e"), ":sun_with_face:" }, - Emoji{ QString::fromUtf8("\xe2\xad\x90"), ":star:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9f"), ":star2:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x81"), ":cloud:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\x85"), ":partly_sunny:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\x88"), ":thunder_cloud_rain:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa4"), ":white_sun_small_cloud:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa5"), ":white_sun_cloud:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa6"), ":white_sun_rain_cloud:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa7"), ":cloud_rain:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa8"), ":cloud_snow:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa9"), ":cloud_lightning:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xaa"), ":cloud_tornado:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xab"), ":fog:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xac"), ":wind_blowing_face:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x82"), ":umbrella2:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x94"), ":umbrella:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\xa1"), ":zap:" }, - Emoji{ QString::fromUtf8("\xe2\x9d\x84"), ":snowflake:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x83"), ":snowman2:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\x84"), ":snowman:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x84"), ":comet:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa5"), ":fire:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa7"), ":droplet:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8a"), ":ocean:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x83"), ":jack_o_lantern:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x84"), ":christmas_tree:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\xa8"), ":sparkles:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8b"), ":tanabata_tree:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8d"), ":bamboo:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x88"), ":see_no_evil:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x89"), ":hear_no_evil:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x99\x8a"), ":speak_no_evil:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa6"), ":sweat_drops:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa8"), ":dash:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb5"), ":monkey_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x92"), ":monkey:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8d"), ":gorilla:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb6"), ":dog:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x95"), ":dog2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa9"), ":poodle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xba"), ":wolf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8a"), ":fox:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb1"), ":cat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x88"), ":cat2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x81"), ":lion_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xaf"), ":tiger:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x85"), ":tiger2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x86"), ":leopard:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb4"), ":horse:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8e"), ":racehorse:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8c"), ":deer:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x84"), ":unicorn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xae"), ":cow:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x82"), ":ox:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x83"), ":water_buffalo:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x84"), ":cow2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb7"), ":pig:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x96"), ":pig2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x97"), ":boar:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xbd"), ":pig_nose:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8f"), ":ram:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x91"), ":sheep:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x90"), ":goat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xaa"), ":dromedary_camel:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xab"), ":camel:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x98"), ":elephant:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8f"), ":rhino:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xad"), ":mouse:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x81"), ":mouse2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x80"), ":rat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb9"), ":hamster:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb0"), ":rabbit:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x87"), ":rabbit2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xbf"), ":chipmunk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x87"), ":bat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xbb"), ":bear:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa8"), ":koala:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xbc"), ":panda_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xbe"), ":feet:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x83"), ":turkey:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x94"), ":chicken:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x93"), ":rooster:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa3"), ":hatching_chick:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa4"), ":baby_chick:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa5"), ":hatched_chick:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa6"), ":bird:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa7"), ":penguin:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x8a"), ":dove:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x85"), ":eagle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x86"), ":duck:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x89"), ":owl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb8"), ":frog:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8a"), ":crocodile:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa2"), ":turtle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8e"), ":lizard:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8d"), ":snake:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb2"), ":dragon_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x89"), ":dragon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xb3"), ":whale:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8b"), ":whale2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xac"), ":dolphin:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9f"), ":fish:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa0"), ":tropical_fish:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\xa1"), ":blowfish:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x88"), ":shark:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x99"), ":octopus:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9a"), ":shell:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x80"), ":crab:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x90"), ":shrimp:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x91"), ":squid:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x8b"), ":butterfly:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x8c"), ":snail:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9b"), ":bug:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9c"), ":ant:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9d"), ":bee:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x90\x9e"), ":beetle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb7"), ":spider:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb8"), ":spider_web:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa6\x82"), ":scorpion:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x90"), ":bouquet:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb8"), ":cherry_blossom:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb5"), ":rosette:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb9"), ":rose:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x80"), ":wilted_rose:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xba"), ":hibiscus:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xbb"), ":sunflower:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xbc"), ":blossom:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb7"), ":tulip:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb1"), ":seedling:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb2"), ":evergreen_tree:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb3"), ":deciduous_tree:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb4"), ":palm_tree:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb5"), ":cactus:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xbe"), ":ear_of_rice:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xbf"), ":herb:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x98"), ":shamrock:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x80"), ":four_leaf_clover:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x81"), ":maple_leaf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x82"), ":fallen_leaf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x83"), ":leaves:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x84"), ":mushroom:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb0"), ":chestnut:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8d"), ":earth_africa:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8e"), ":earth_americas:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8f"), ":earth_asia:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x91"), ":new_moon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x92"), ":waxing_crescent_moon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x93"), ":first_quarter_moon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x94"), ":waxing_gibbous_moon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x95"), ":full_moon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x96"), ":waning_gibbous_moon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x97"), ":last_quarter_moon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x98"), ":waning_crescent_moon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x99"), ":crescent_moon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9a"), ":new_moon_with_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9b"), ":first_quarter_moon_with_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9c"), ":last_quarter_moon_with_face:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x80"), ":sunny:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9d"), ":full_moon_with_face:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9e"), ":sun_with_face:" }, + Emoji{ QString::fromUtf8("\xe2\xad\x90"), ":star:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x9f"), ":star2:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x81"), ":cloud:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\x85"), ":partly_sunny:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\x88"), ":thunder_cloud_rain:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa4"), ":white_sun_small_cloud:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa5"), ":white_sun_cloud:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa6"), ":white_sun_rain_cloud:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa7"), ":cloud_rain:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa8"), ":cloud_snow:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa9"), ":cloud_lightning:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xaa"), ":cloud_tornado:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xab"), ":fog:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xac"), ":wind_blowing_face:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x82"), ":umbrella2:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x94"), ":umbrella:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\xa1"), ":zap:" }, + Emoji{ QString::fromUtf8("\xe2\x9d\x84"), ":snowflake:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x83"), ":snowman2:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\x84"), ":snowman:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x84"), ":comet:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa5"), ":fire:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa7"), ":droplet:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8a"), ":ocean:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x83"), ":jack_o_lantern:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x84"), ":christmas_tree:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\xa8"), ":sparkles:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8b"), ":tanabata_tree:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8d"), ":bamboo:" }, }; const QList EmojiProvider::food = { - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x87"), ":grapes:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x88"), ":melon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x89"), ":watermelon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8a"), ":tangerine:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8b"), ":lemon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8c"), ":banana:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8d"), ":pineapple:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8e"), ":apple:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8f"), ":green_apple:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x90"), ":pear:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x91"), ":peach:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x92"), ":cherries:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x93"), ":strawberry:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x9d"), ":kiwi:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x85"), ":tomato:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x91"), ":avocado:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x86"), ":eggplant:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x94"), ":potato:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x95"), ":carrot:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xbd"), ":corn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb6"), ":hot_pepper:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x92"), ":cucumber:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x9c"), ":peanuts:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9e"), ":bread:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x90"), ":croissant:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x96"), ":french_bread:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x9e"), ":pancakes:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa7\x80"), ":cheese:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x96"), ":meat_on_bone:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x97"), ":poultry_leg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x93"), ":bacon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x94"), ":hamburger:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9f"), ":fries:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x95"), ":pizza:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xad"), ":hotdog:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xae"), ":taco:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xaf"), ":burrito:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x99"), ":stuffed_flatbread:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x9a"), ":egg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb3"), ":cooking:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x98"), ":shallow_pan_of_food:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb2"), ":stew:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x97"), ":salad:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xbf"), ":popcorn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb1"), ":bento:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x98"), ":rice_cracker:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x99"), ":rice_ball:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9a"), ":rice:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9b"), ":curry:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9c"), ":ramen:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9d"), ":spaghetti:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa0"), ":sweet_potato:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa2"), ":oden:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa3"), ":sushi:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa4"), ":fried_shrimp:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa5"), ":fish_cake:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa1"), ":dango:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa6"), ":icecream:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa7"), ":shaved_ice:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa8"), ":ice_cream:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa9"), ":doughnut:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xaa"), ":cookie:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x82"), ":birthday:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb0"), ":cake:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xab"), ":chocolate_bar:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xac"), ":candy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xad"), ":lollipop:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xae"), ":custard:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xaf"), ":honey_pot:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xbc"), ":baby_bottle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x9b"), ":milk:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x95"), ":coffee:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb5"), ":tea:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb6"), ":sake:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xbe"), ":champagne:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb7"), ":wine_glass:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb8"), ":cocktail:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb9"), ":tropical_drink:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xba"), ":beer:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xbb"), ":beers:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x82"), ":champagne_glass:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x83"), ":tumbler_glass:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xbd"), ":fork_knife_plate:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb4"), ":fork_and_knife:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x84"), ":spoon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x87"), ":grapes:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x88"), ":melon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x89"), ":watermelon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8a"), ":tangerine:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8b"), ":lemon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8c"), ":banana:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8d"), ":pineapple:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8e"), ":apple:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x8f"), ":green_apple:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x90"), ":pear:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x91"), ":peach:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x92"), ":cherries:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x93"), ":strawberry:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x9d"), ":kiwi:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x85"), ":tomato:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x91"), ":avocado:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x86"), ":eggplant:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x94"), ":potato:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x95"), ":carrot:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xbd"), ":corn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xb6"), ":hot_pepper:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x92"), ":cucumber:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x9c"), ":peanuts:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9e"), ":bread:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x90"), ":croissant:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x96"), ":french_bread:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x9e"), ":pancakes:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa7\x80"), ":cheese:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x96"), ":meat_on_bone:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x97"), ":poultry_leg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x93"), ":bacon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x94"), ":hamburger:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9f"), ":fries:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x95"), ":pizza:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xad"), ":hotdog:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xae"), ":taco:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xaf"), ":burrito:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x99"), ":stuffed_flatbread:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x9a"), ":egg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb3"), ":cooking:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x98"), ":shallow_pan_of_food:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb2"), ":stew:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x97"), ":salad:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xbf"), ":popcorn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb1"), ":bento:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x98"), ":rice_cracker:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x99"), ":rice_ball:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9a"), ":rice:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9b"), ":curry:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9c"), ":ramen:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\x9d"), ":spaghetti:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa0"), ":sweet_potato:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa2"), ":oden:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa3"), ":sushi:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa4"), ":fried_shrimp:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa5"), ":fish_cake:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa1"), ":dango:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa6"), ":icecream:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa7"), ":shaved_ice:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa8"), ":ice_cream:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xa9"), ":doughnut:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xaa"), ":cookie:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x82"), ":birthday:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb0"), ":cake:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xab"), ":chocolate_bar:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xac"), ":candy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xad"), ":lollipop:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xae"), ":custard:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xaf"), ":honey_pot:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xbc"), ":baby_bottle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x9b"), ":milk:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x95"), ":coffee:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb5"), ":tea:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb6"), ":sake:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xbe"), ":champagne:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb7"), ":wine_glass:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb8"), ":cocktail:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb9"), ":tropical_drink:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xba"), ":beer:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xbb"), ":beers:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x82"), ":champagne_glass:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x83"), ":tumbler_glass:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xbd"), ":fork_knife_plate:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8d\xb4"), ":fork_and_knife:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x84"), ":spoon:" }, }; const QList EmojiProvider::activity = { - Emoji{ QString::fromUtf8("\xf0\x9f\x91\xbe"), ":space_invader:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb4"), ":levitate:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xba"), ":fencer:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87"), ":horse_racing:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87\xf0\x9f\x8f\xbb"), ":horse_racing_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87\xf0\x9f\x8f\xbc"), ":horse_racing_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87\xf0\x9f\x8f\xbd"), ":horse_racing_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87\xf0\x9f\x8f\xbe"), ":horse_racing_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87\xf0\x9f\x8f\xbf"), ":horse_racing_tone5:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb7"), ":skier:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x82"), ":snowboarder:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8c"), ":golfer:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84"), ":surfer:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84\xf0\x9f\x8f\xbb"), ":surfer_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84\xf0\x9f\x8f\xbc"), ":surfer_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84\xf0\x9f\x8f\xbd"), ":surfer_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84\xf0\x9f\x8f\xbe"), ":surfer_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84\xf0\x9f\x8f\xbf"), ":surfer_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3"), ":rowboat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3\xf0\x9f\x8f\xbb"), ":rowboat_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3\xf0\x9f\x8f\xbc"), ":rowboat_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3\xf0\x9f\x8f\xbd"), ":rowboat_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3\xf0\x9f\x8f\xbe"), ":rowboat_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3\xf0\x9f\x8f\xbf"), ":rowboat_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a"), ":swimmer:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a\xf0\x9f\x8f\xbb"), ":swimmer_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a\xf0\x9f\x8f\xbc"), ":swimmer_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a\xf0\x9f\x8f\xbd"), ":swimmer_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a\xf0\x9f\x8f\xbe"), ":swimmer_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a\xf0\x9f\x8f\xbf"), ":swimmer_tone5:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb9"), ":basketball_player:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb9\xf0\x9f\x8f\xbb"), ":basketball_player_tone1:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb9\xf0\x9f\x8f\xbc"), ":basketball_player_tone2:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb9\xf0\x9f\x8f\xbd"), ":basketball_player_tone3:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb9\xf0\x9f\x8f\xbe"), ":basketball_player_tone4:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb9\xf0\x9f\x8f\xbf"), ":basketball_player_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b"), ":lifter:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b\xf0\x9f\x8f\xbb"), ":lifter_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b\xf0\x9f\x8f\xbc"), ":lifter_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b\xf0\x9f\x8f\xbd"), ":lifter_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b\xf0\x9f\x8f\xbe"), ":lifter_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b\xf0\x9f\x8f\xbf"), ":lifter_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4"), ":bicyclist:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4\xf0\x9f\x8f\xbb"), ":bicyclist_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4\xf0\x9f\x8f\xbc"), ":bicyclist_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4\xf0\x9f\x8f\xbd"), ":bicyclist_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4\xf0\x9f\x8f\xbe"), ":bicyclist_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4\xf0\x9f\x8f\xbf"), ":bicyclist_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5"), ":mountain_bicyclist:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5\xf0\x9f\x8f\xbb"), ":mountain_bicyclist_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5\xf0\x9f\x8f\xbc"), ":mountain_bicyclist_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5\xf0\x9f\x8f\xbd"), ":mountain_bicyclist_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5\xf0\x9f\x8f\xbe"), ":mountain_bicyclist_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5\xf0\x9f\x8f\xbf"), ":mountain_bicyclist_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8"), ":cartwheel:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8\xf0\x9f\x8f\xbb"), ":cartwheel_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8\xf0\x9f\x8f\xbc"), ":cartwheel_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8\xf0\x9f\x8f\xbd"), ":cartwheel_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8\xf0\x9f\x8f\xbe"), ":cartwheel_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8\xf0\x9f\x8f\xbf"), ":cartwheel_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc"), ":wrestlers:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc\xf0\x9f\x8f\xbb"), ":wrestlers_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc\xf0\x9f\x8f\xbc"), ":wrestlers_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc\xf0\x9f\x8f\xbd"), ":wrestlers_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc\xf0\x9f\x8f\xbe"), ":wrestlers_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc\xf0\x9f\x8f\xbf"), ":wrestlers_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd"), ":water_polo:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd\xf0\x9f\x8f\xbb"), ":water_polo_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd\xf0\x9f\x8f\xbc"), ":water_polo_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd\xf0\x9f\x8f\xbd"), ":water_polo_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd\xf0\x9f\x8f\xbe"), ":water_polo_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd\xf0\x9f\x8f\xbf"), ":water_polo_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe"), ":handball:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe\xf0\x9f\x8f\xbb"), ":handball_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe\xf0\x9f\x8f\xbc"), ":handball_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe\xf0\x9f\x8f\xbd"), ":handball_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe\xf0\x9f\x8f\xbe"), ":handball_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe\xf0\x9f\x8f\xbf"), ":handball_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9"), ":juggling:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9\xf0\x9f\x8f\xbb"), ":juggling_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9\xf0\x9f\x8f\xbc"), ":juggling_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9\xf0\x9f\x8f\xbd"), ":juggling_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9\xf0\x9f\x8f\xbe"), ":juggling_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9\xf0\x9f\x8f\xbf"), ":juggling_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xaa"), ":circus_tent:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xad"), ":performing_arts:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa8"), ":art:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb0"), ":slot_machine:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80"), ":bath:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80\xf0\x9f\x8f\xbb"), ":bath_tone1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80\xf0\x9f\x8f\xbc"), ":bath_tone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80\xf0\x9f\x8f\xbd"), ":bath_tone3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80\xf0\x9f\x8f\xbe"), ":bath_tone4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80\xf0\x9f\x8f\xbf"), ":bath_tone5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x97"), ":reminder_ribbon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x9f"), ":tickets:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xab"), ":ticket:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x96"), ":military_medal:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x86"), ":trophy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x85"), ":medal:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x87"), ":first_place:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x88"), ":second_place:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x89"), ":third_place:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\xbd"), ":soccer:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\xbe"), ":baseball:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x80"), ":basketball:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x90"), ":volleyball:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x88"), ":football:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x89"), ":rugby_football:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xbe"), ":tennis:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb1"), ":8ball:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb3"), ":bowling:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8f"), ":cricket:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x91"), ":field_hockey:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x92"), ":hockey:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x93"), ":ping_pong:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb8"), ":badminton:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x8a"), ":boxing_glove:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x8b"), ":martial_arts_uniform:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x85"), ":goal:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xaf"), ":dart:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb3"), ":golf:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb8"), ":ice_skate:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa3"), ":fishing_pole_and_fish:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xbd"), ":running_shirt_with_sash:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xbf"), ":ski:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xae"), ":video_game:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb2"), ":game_die:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xbc"), ":musical_score:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa4"), ":microphone:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa7"), ":headphones:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb7"), ":saxophone:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb8"), ":guitar:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb9"), ":musical_keyboard:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xba"), ":trumpet:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xbb"), ":violin:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x81"), ":drum:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xac"), ":clapper:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb9"), ":bow_and_arrow:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\xbe"), ":space_invader:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb4"), ":levitate:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xba"), ":fencer:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87"), ":horse_racing:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87\xf0\x9f\x8f\xbb"), ":horse_racing_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87\xf0\x9f\x8f\xbc"), ":horse_racing_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87\xf0\x9f\x8f\xbd"), ":horse_racing_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87\xf0\x9f\x8f\xbe"), ":horse_racing_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x87\xf0\x9f\x8f\xbf"), ":horse_racing_tone5:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb7"), ":skier:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x82"), ":snowboarder:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8c"), ":golfer:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84"), ":surfer:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84\xf0\x9f\x8f\xbb"), ":surfer_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84\xf0\x9f\x8f\xbc"), ":surfer_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84\xf0\x9f\x8f\xbd"), ":surfer_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84\xf0\x9f\x8f\xbe"), ":surfer_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x84\xf0\x9f\x8f\xbf"), ":surfer_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3"), ":rowboat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3\xf0\x9f\x8f\xbb"), ":rowboat_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3\xf0\x9f\x8f\xbc"), ":rowboat_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3\xf0\x9f\x8f\xbd"), ":rowboat_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3\xf0\x9f\x8f\xbe"), ":rowboat_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa3\xf0\x9f\x8f\xbf"), ":rowboat_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a"), ":swimmer:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a\xf0\x9f\x8f\xbb"), ":swimmer_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a\xf0\x9f\x8f\xbc"), ":swimmer_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a\xf0\x9f\x8f\xbd"), ":swimmer_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a\xf0\x9f\x8f\xbe"), ":swimmer_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8a\xf0\x9f\x8f\xbf"), ":swimmer_tone5:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb9"), ":basketball_player:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb9\xf0\x9f\x8f\xbb"), ":basketball_player_tone1:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb9\xf0\x9f\x8f\xbc"), ":basketball_player_tone2:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb9\xf0\x9f\x8f\xbd"), ":basketball_player_tone3:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb9\xf0\x9f\x8f\xbe"), ":basketball_player_tone4:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb9\xf0\x9f\x8f\xbf"), ":basketball_player_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b"), ":lifter:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b\xf0\x9f\x8f\xbb"), ":lifter_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b\xf0\x9f\x8f\xbc"), ":lifter_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b\xf0\x9f\x8f\xbd"), ":lifter_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b\xf0\x9f\x8f\xbe"), ":lifter_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8b\xf0\x9f\x8f\xbf"), ":lifter_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4"), ":bicyclist:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4\xf0\x9f\x8f\xbb"), ":bicyclist_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4\xf0\x9f\x8f\xbc"), ":bicyclist_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4\xf0\x9f\x8f\xbd"), ":bicyclist_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4\xf0\x9f\x8f\xbe"), ":bicyclist_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb4\xf0\x9f\x8f\xbf"), ":bicyclist_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5"), ":mountain_bicyclist:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5\xf0\x9f\x8f\xbb"), + ":mountain_bicyclist_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5\xf0\x9f\x8f\xbc"), + ":mountain_bicyclist_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5\xf0\x9f\x8f\xbd"), + ":mountain_bicyclist_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5\xf0\x9f\x8f\xbe"), + ":mountain_bicyclist_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb5\xf0\x9f\x8f\xbf"), + ":mountain_bicyclist_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8"), ":cartwheel:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8\xf0\x9f\x8f\xbb"), ":cartwheel_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8\xf0\x9f\x8f\xbc"), ":cartwheel_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8\xf0\x9f\x8f\xbd"), ":cartwheel_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8\xf0\x9f\x8f\xbe"), ":cartwheel_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb8\xf0\x9f\x8f\xbf"), ":cartwheel_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc"), ":wrestlers:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc\xf0\x9f\x8f\xbb"), ":wrestlers_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc\xf0\x9f\x8f\xbc"), ":wrestlers_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc\xf0\x9f\x8f\xbd"), ":wrestlers_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc\xf0\x9f\x8f\xbe"), ":wrestlers_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbc\xf0\x9f\x8f\xbf"), ":wrestlers_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd"), ":water_polo:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd\xf0\x9f\x8f\xbb"), ":water_polo_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd\xf0\x9f\x8f\xbc"), ":water_polo_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd\xf0\x9f\x8f\xbd"), ":water_polo_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd\xf0\x9f\x8f\xbe"), ":water_polo_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbd\xf0\x9f\x8f\xbf"), ":water_polo_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe"), ":handball:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe\xf0\x9f\x8f\xbb"), ":handball_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe\xf0\x9f\x8f\xbc"), ":handball_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe\xf0\x9f\x8f\xbd"), ":handball_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe\xf0\x9f\x8f\xbe"), ":handball_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xbe\xf0\x9f\x8f\xbf"), ":handball_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9"), ":juggling:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9\xf0\x9f\x8f\xbb"), ":juggling_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9\xf0\x9f\x8f\xbc"), ":juggling_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9\xf0\x9f\x8f\xbd"), ":juggling_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9\xf0\x9f\x8f\xbe"), ":juggling_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa4\xb9\xf0\x9f\x8f\xbf"), ":juggling_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xaa"), ":circus_tent:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xad"), ":performing_arts:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa8"), ":art:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb0"), ":slot_machine:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80"), ":bath:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80\xf0\x9f\x8f\xbb"), ":bath_tone1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80\xf0\x9f\x8f\xbc"), ":bath_tone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80\xf0\x9f\x8f\xbd"), ":bath_tone3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80\xf0\x9f\x8f\xbe"), ":bath_tone4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x80\xf0\x9f\x8f\xbf"), ":bath_tone5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x97"), ":reminder_ribbon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x9f"), ":tickets:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xab"), ":ticket:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x96"), ":military_medal:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x86"), ":trophy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x85"), ":medal:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x87"), ":first_place:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x88"), ":second_place:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x89"), ":third_place:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\xbd"), ":soccer:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\xbe"), ":baseball:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x80"), ":basketball:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x90"), ":volleyball:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x88"), ":football:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x89"), ":rugby_football:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xbe"), ":tennis:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb1"), ":8ball:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb3"), ":bowling:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8f"), ":cricket:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x91"), ":field_hockey:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x92"), ":hockey:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x93"), ":ping_pong:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb8"), ":badminton:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x8a"), ":boxing_glove:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x8b"), ":martial_arts_uniform:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x85"), ":goal:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xaf"), ":dart:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb3"), ":golf:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb8"), ":ice_skate:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa3"), ":fishing_pole_and_fish:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xbd"), ":running_shirt_with_sash:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xbf"), ":ski:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xae"), ":video_game:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb2"), ":game_die:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xbc"), ":musical_score:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa4"), ":microphone:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa7"), ":headphones:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb7"), ":saxophone:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb8"), ":guitar:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb9"), ":musical_keyboard:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xba"), ":trumpet:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xbb"), ":violin:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\xa5\x81"), ":drum:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xac"), ":clapper:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb9"), ":bow_and_arrow:" }, }; const QList EmojiProvider::travel = { - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8e"), ":race_car:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8d"), ":motorcycle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xbe"), ":japan:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x94"), ":mountain_snow:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb0"), ":mountain:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8b"), ":volcano:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xbb"), ":mount_fuji:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x95"), ":camping:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x96"), ":beach:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9c"), ":desert:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9d"), ":island:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9e"), ":park:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9f"), ":stadium:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9b"), ":classical_building:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x97"), ":construction_site:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x98"), ":homes:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x99"), ":cityscape:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9a"), ":house_abandoned:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa0"), ":house:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa1"), ":house_with_garden:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa2"), ":office:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa3"), ":post_office:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa4"), ":european_post_office:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa5"), ":hospital:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa6"), ":bank:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa8"), ":hotel:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa9"), ":love_hotel:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xaa"), ":convenience_store:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xab"), ":school:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xac"), ":department_store:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xad"), ":factory:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xaf"), ":japanese_castle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb0"), ":european_castle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x92"), ":wedding:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xbc"), ":tokyo_tower:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xbd"), ":statue_of_liberty:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xaa"), ":church:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x8c"), ":mosque:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x8d"), ":synagogue:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xa9"), ":shinto_shrine:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x8b"), ":kaaba:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb2"), ":fountain:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xba"), ":tent:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x81"), ":foggy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x83"), ":night_with_stars:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x84"), ":sunrise_over_mountains:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x85"), ":sunrise:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x86"), ":city_dusk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x87"), ":city_sunset:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x89"), ":bridge_at_night:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8c"), ":milky_way:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa0"), ":carousel_horse:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa1"), ":ferris_wheel:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa2"), ":roller_coaster:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x82"), ":steam_locomotive:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x83"), ":railway_car:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x84"), ":bullettrain_side:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x85"), ":bullettrain_front:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x86"), ":train2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x87"), ":metro:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x88"), ":light_rail:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x89"), ":station:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8a"), ":tram:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9d"), ":monorail:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9e"), ":mountain_railway:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8b"), ":train:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8c"), ":bus:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8d"), ":oncoming_bus:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8e"), ":trolleybus:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x90"), ":minibus:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x91"), ":ambulance:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x92"), ":fire_engine:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x93"), ":police_car:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x94"), ":oncoming_police_car:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x95"), ":taxi:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x96"), ":oncoming_taxi:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x97"), ":red_car:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x98"), ":oncoming_automobile:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x99"), ":blue_car:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9a"), ":truck:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9b"), ":articulated_lorry:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9c"), ":tractor:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb2"), ":bike:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xb4"), ":scooter:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xb5"), ":motor_scooter:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8f"), ":busstop:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa3"), ":motorway:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa4"), ":railway_track:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xbd"), ":fuelpump:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa8"), ":rotating_light:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa5"), ":traffic_light:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa6"), ":vertical_traffic_light:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa7"), ":construction:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\x93"), ":anchor:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb5"), ":sailboat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xb6"), ":canoe:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa4"), ":speedboat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xb3"), ":cruise_ship:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb4"), ":ferry:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa5"), ":motorboat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa2"), ":ship:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x88"), ":airplane:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa9"), ":airplane_small:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xab"), ":airplane_departure:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xac"), ":airplane_arriving:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xba"), ":seat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x81"), ":helicopter:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9f"), ":suspension_railway:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa0"), ":mountain_cableway:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa1"), ":aerial_tramway:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x80"), ":rocket:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xb0"), ":satellite_orbital:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa0"), ":stars:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x88"), ":rainbow:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x86"), ":fireworks:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x87"), ":sparkler:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x91"), ":rice_scene:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x81"), ":checkered_flag:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8e"), ":race_car:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x8d"), ":motorcycle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xbe"), ":japan:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x94"), ":mountain_snow:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb0"), ":mountain:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8b"), ":volcano:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xbb"), ":mount_fuji:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x95"), ":camping:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x96"), ":beach:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9c"), ":desert:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9d"), ":island:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9e"), ":park:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9f"), ":stadium:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9b"), ":classical_building:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x97"), ":construction_site:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x98"), ":homes:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x99"), ":cityscape:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x9a"), ":house_abandoned:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa0"), ":house:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa1"), ":house_with_garden:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa2"), ":office:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa3"), ":post_office:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa4"), ":european_post_office:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa5"), ":hospital:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa6"), ":bank:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa8"), ":hotel:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa9"), ":love_hotel:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xaa"), ":convenience_store:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xab"), ":school:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xac"), ":department_store:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xad"), ":factory:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xaf"), ":japanese_castle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb0"), ":european_castle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x92"), ":wedding:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xbc"), ":tokyo_tower:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xbd"), ":statue_of_liberty:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xaa"), ":church:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x8c"), ":mosque:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x8d"), ":synagogue:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xa9"), ":shinto_shrine:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x8b"), ":kaaba:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb2"), ":fountain:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xba"), ":tent:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x81"), ":foggy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x83"), ":night_with_stars:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x84"), ":sunrise_over_mountains:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x85"), ":sunrise:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x86"), ":city_dusk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x87"), ":city_sunset:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x89"), ":bridge_at_night:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x8c"), ":milky_way:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa0"), ":carousel_horse:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa1"), ":ferris_wheel:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa2"), ":roller_coaster:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x82"), ":steam_locomotive:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x83"), ":railway_car:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x84"), ":bullettrain_side:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x85"), ":bullettrain_front:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x86"), ":train2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x87"), ":metro:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x88"), ":light_rail:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x89"), ":station:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8a"), ":tram:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9d"), ":monorail:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9e"), ":mountain_railway:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8b"), ":train:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8c"), ":bus:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8d"), ":oncoming_bus:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8e"), ":trolleybus:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x90"), ":minibus:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x91"), ":ambulance:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x92"), ":fire_engine:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x93"), ":police_car:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x94"), ":oncoming_police_car:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x95"), ":taxi:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x96"), ":oncoming_taxi:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x97"), ":red_car:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x98"), ":oncoming_automobile:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x99"), ":blue_car:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9a"), ":truck:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9b"), ":articulated_lorry:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9c"), ":tractor:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb2"), ":bike:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xb4"), ":scooter:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xb5"), ":motor_scooter:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x8f"), ":busstop:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa3"), ":motorway:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa4"), ":railway_track:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xbd"), ":fuelpump:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa8"), ":rotating_light:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa5"), ":traffic_light:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa6"), ":vertical_traffic_light:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa7"), ":construction:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\x93"), ":anchor:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb5"), ":sailboat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xb6"), ":canoe:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa4"), ":speedboat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xb3"), ":cruise_ship:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb4"), ":ferry:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa5"), ":motorboat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa2"), ":ship:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x88"), ":airplane:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa9"), ":airplane_small:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xab"), ":airplane_departure:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xac"), ":airplane_arriving:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xba"), ":seat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x81"), ":helicopter:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x9f"), ":suspension_railway:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa0"), ":mountain_cableway:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa1"), ":aerial_tramway:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\x80"), ":rocket:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xb0"), ":satellite_orbital:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa0"), ":stars:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x88"), ":rainbow:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x86"), ":fireworks:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x87"), ":sparkler:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x91"), ":rice_scene:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\x81"), ":checkered_flag:" }, }; const QList EmojiProvider::objects = { - Emoji{ QString::fromUtf8("\xe2\x98\xa0"), ":skull_crossbones:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8c"), ":love_letter:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa3"), ":bomb:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb3"), ":hole:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x8d"), ":shopping_bags:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xbf"), ":prayer_beads:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8e"), ":gem:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xaa"), ":knife:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xba"), ":amphora:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xba"), ":map:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x88"), ":barber:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\xbc"), ":frame_photo:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x8e"), ":bellhop:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xaa"), ":door:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x8c"), ":sleeping_accommodation:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x8f"), ":bed:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x8b"), ":couch:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xbd"), ":toilet:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xbf"), ":shower:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x81"), ":bathtub:" }, - Emoji{ QString::fromUtf8("\xe2\x8c\x9b"), ":hourglass:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xb3"), ":hourglass_flowing_sand:" }, - Emoji{ QString::fromUtf8("\xe2\x8c\x9a"), ":watch:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xb0"), ":alarm_clock:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xb1"), ":stopwatch:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xb2"), ":timer:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb0"), ":clock:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa1"), ":thermometer:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\xb1"), ":beach_umbrella:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x88"), ":balloon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x89"), ":tada:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8a"), ":confetti_ball:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8e"), ":dolls:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8f"), ":flags:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x90"), ":wind_chime:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x80"), ":ribbon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x81"), ":gift:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb9"), ":joystick:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xaf"), ":postal_horn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x99"), ":microphone2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x9a"), ":level_slider:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x9b"), ":control_knobs:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xbb"), ":radio:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb1"), ":iphone:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb2"), ":calling:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x8e"), ":telephone:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9e"), ":telephone_receiver:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9f"), ":pager:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa0"), ":fax:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8b"), ":battery:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8c"), ":electric_plug:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xbb"), ":computer:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\xa5"), ":desktop:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\xa8"), ":printer:" }, - Emoji{ QString::fromUtf8("\xe2\x8c\xa8"), ":keyboard:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\xb1"), ":mouse_three_button:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\xb2"), ":trackball:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xbd"), ":minidisc:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xbe"), ":floppy_disk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xbf"), ":cd:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x80"), ":dvd:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa5"), ":movie_camera:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x9e"), ":film_frames:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xbd"), ":projector:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xba"), ":tv:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb7"), ":camera:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb8"), ":camera_with_flash:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb9"), ":video_camera:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xbc"), ":vhs:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8d"), ":mag:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8e"), ":mag_right:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xac"), ":microscope:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xad"), ":telescope:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa1"), ":satellite:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xaf"), ":candle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa1"), ":bulb:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa6"), ":flashlight:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xae"), ":izakaya_lantern:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x94"), ":notebook_with_decorative_cover:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x95"), ":closed_book:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x96"), ":book:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x97"), ":green_book:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x98"), ":blue_book:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x99"), ":orange_book:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9a"), ":books:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x93"), ":notebook:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x92"), ":ledger:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x83"), ":page_with_curl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9c"), ":scroll:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x84"), ":page_facing_up:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb0"), ":newspaper:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\x9e"), ":newspaper2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x91"), ":bookmark_tabs:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x96"), ":bookmark:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb7"), ":label:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb0"), ":moneybag:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb4"), ":yen:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb5"), ":dollar:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb6"), ":euro:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb7"), ":pound:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb8"), ":money_with_wings:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb3"), ":credit_card:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x89"), ":envelope:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa7"), ":e-mail:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa8"), ":incoming_envelope:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa9"), ":envelope_with_arrow:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa4"), ":outbox_tray:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa5"), ":inbox_tray:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa6"), ":package:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xab"), ":mailbox:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xaa"), ":mailbox_closed:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xac"), ":mailbox_with_mail:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xad"), ":mailbox_with_no_mail:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xae"), ":postbox:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xb3"), ":ballot_box:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x8f"), ":pencil2:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x92"), ":black_nib:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\x8b"), ":pen_fountain:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\x8a"), ":pen_ballpoint:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\x8c"), ":paintbrush:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\x8d"), ":crayon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9d"), ":pencil:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x81"), ":file_folder:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x82"), ":open_file_folder:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\x82"), ":dividers:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x85"), ":date:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x86"), ":calendar:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\x92"), ":notepad_spiral:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\x93"), ":calendar_spiral:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x87"), ":card_index:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x88"), ":chart_with_upwards_trend:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x89"), ":chart_with_downwards_trend:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8a"), ":bar_chart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8b"), ":clipboard:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8c"), ":pushpin:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8d"), ":round_pushpin:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8e"), ":paperclip:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\x87"), ":paperclips:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8f"), ":straight_ruler:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x90"), ":triangular_ruler:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x82"), ":scissors:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\x83"), ":card_box:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\x84"), ":file_cabinet:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\x91"), ":wastebasket:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x92"), ":lock:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x93"), ":unlock:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8f"), ":lock_with_ink_pen:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x90"), ":closed_lock_with_key:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x91"), ":key:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\x9d"), ":key2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa8"), ":hammer:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\x8f"), ":pick:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\x92"), ":hammer_pick:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa0"), ":tools:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xa1"), ":dagger:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\x94"), ":crossed_swords:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xab"), ":gun:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa1"), ":shield:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa7"), ":wrench:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa9"), ":nut_and_bolt:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\x99"), ":gear:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\x9c"), ":compression:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\x97"), ":alembic:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\x96"), ":scales:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x97"), ":link:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\x93"), ":chains:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x89"), ":syringe:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8a"), ":pill:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xac"), ":smoking:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\xb0"), ":coffin:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\xb1"), ":urn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xbf"), ":moyai:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa2"), ":oil:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xae"), ":crystal_ball:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x92"), ":shopping_cart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa9"), ":triangular_flag_on_post:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8c"), ":crossed_flags:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb4"), ":flag_black:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb3"), ":flag_white:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb3\xf0\x9f\x8c\x88"), ":rainbow_flag:" }, + Emoji{ QString::fromUtf8("\xe2\x98\xa0"), ":skull_crossbones:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8c"), ":love_letter:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa3"), ":bomb:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb3"), ":hole:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x8d"), ":shopping_bags:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xbf"), ":prayer_beads:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8e"), ":gem:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xaa"), ":knife:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xba"), ":amphora:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xba"), ":map:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x88"), ":barber:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\xbc"), ":frame_photo:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x8e"), ":bellhop:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xaa"), ":door:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x8c"), ":sleeping_accommodation:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x8f"), ":bed:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x8b"), ":couch:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xbd"), ":toilet:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xbf"), ":shower:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x81"), ":bathtub:" }, + Emoji{ QString::fromUtf8("\xe2\x8c\x9b"), ":hourglass:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xb3"), ":hourglass_flowing_sand:" }, + Emoji{ QString::fromUtf8("\xe2\x8c\x9a"), ":watch:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xb0"), ":alarm_clock:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xb1"), ":stopwatch:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xb2"), ":timer:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb0"), ":clock:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\xa1"), ":thermometer:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\xb1"), ":beach_umbrella:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x88"), ":balloon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x89"), ":tada:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8a"), ":confetti_ball:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8e"), ":dolls:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8f"), ":flags:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x90"), ":wind_chime:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x80"), ":ribbon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x81"), ":gift:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xb9"), ":joystick:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xaf"), ":postal_horn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x99"), ":microphone2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x9a"), ":level_slider:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x9b"), ":control_knobs:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xbb"), ":radio:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb1"), ":iphone:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb2"), ":calling:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x8e"), ":telephone:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9e"), ":telephone_receiver:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9f"), ":pager:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa0"), ":fax:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8b"), ":battery:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8c"), ":electric_plug:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xbb"), ":computer:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\xa5"), ":desktop:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\xa8"), ":printer:" }, + Emoji{ QString::fromUtf8("\xe2\x8c\xa8"), ":keyboard:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\xb1"), ":mouse_three_button:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\xb2"), ":trackball:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xbd"), ":minidisc:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xbe"), ":floppy_disk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xbf"), ":cd:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x80"), ":dvd:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa5"), ":movie_camera:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x9e"), ":film_frames:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xbd"), ":projector:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xba"), ":tv:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb7"), ":camera:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb8"), ":camera_with_flash:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb9"), ":video_camera:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xbc"), ":vhs:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8d"), ":mag:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8e"), ":mag_right:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xac"), ":microscope:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xad"), ":telescope:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa1"), ":satellite:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xaf"), ":candle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa1"), ":bulb:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa6"), ":flashlight:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xae"), ":izakaya_lantern:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x94"), ":notebook_with_decorative_cover:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x95"), ":closed_book:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x96"), ":book:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x97"), ":green_book:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x98"), ":blue_book:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x99"), ":orange_book:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9a"), ":books:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x93"), ":notebook:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x92"), ":ledger:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x83"), ":page_with_curl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9c"), ":scroll:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x84"), ":page_facing_up:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb0"), ":newspaper:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\x9e"), ":newspaper2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x91"), ":bookmark_tabs:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x96"), ":bookmark:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb7"), ":label:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb0"), ":moneybag:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb4"), ":yen:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb5"), ":dollar:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb6"), ":euro:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb7"), ":pound:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb8"), ":money_with_wings:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb3"), ":credit_card:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x89"), ":envelope:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa7"), ":e-mail:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa8"), ":incoming_envelope:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa9"), ":envelope_with_arrow:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa4"), ":outbox_tray:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa5"), ":inbox_tray:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa6"), ":package:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xab"), ":mailbox:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xaa"), ":mailbox_closed:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xac"), ":mailbox_with_mail:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xad"), ":mailbox_with_no_mail:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xae"), ":postbox:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xb3"), ":ballot_box:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x8f"), ":pencil2:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x92"), ":black_nib:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\x8b"), ":pen_fountain:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\x8a"), ":pen_ballpoint:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\x8c"), ":paintbrush:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\x8d"), ":crayon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9d"), ":pencil:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x81"), ":file_folder:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x82"), ":open_file_folder:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\x82"), ":dividers:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x85"), ":date:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x86"), ":calendar:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\x92"), ":notepad_spiral:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\x93"), ":calendar_spiral:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x87"), ":card_index:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x88"), ":chart_with_upwards_trend:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x89"), ":chart_with_downwards_trend:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8a"), ":bar_chart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8b"), ":clipboard:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8c"), ":pushpin:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8d"), ":round_pushpin:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8e"), ":paperclip:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\x87"), ":paperclips:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x8f"), ":straight_ruler:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x90"), ":triangular_ruler:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x82"), ":scissors:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\x83"), ":card_box:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\x84"), ":file_cabinet:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\x91"), ":wastebasket:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x92"), ":lock:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x93"), ":unlock:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8f"), ":lock_with_ink_pen:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x90"), ":closed_lock_with_key:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x91"), ":key:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\x9d"), ":key2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa8"), ":hammer:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\x8f"), ":pick:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\x92"), ":hammer_pick:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa0"), ":tools:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xa1"), ":dagger:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\x94"), ":crossed_swords:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xab"), ":gun:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa1"), ":shield:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa7"), ":wrench:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa9"), ":nut_and_bolt:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\x99"), ":gear:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\x9c"), ":compression:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\x97"), ":alembic:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\x96"), ":scales:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x97"), ":link:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\x93"), ":chains:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x89"), ":syringe:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x8a"), ":pill:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xac"), ":smoking:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\xb0"), ":coffin:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\xb1"), ":urn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xbf"), ":moyai:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\xa2"), ":oil:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xae"), ":crystal_ball:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x92"), ":shopping_cart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xa9"), ":triangular_flag_on_post:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\x8c"), ":crossed_flags:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb4"), ":flag_black:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb3"), ":flag_white:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xb3\xf0\x9f\x8c\x88"), ":rainbow_flag:" }, }; const QList EmojiProvider::symbols = { - Emoji{ QString::fromUtf8("\xf0\x9f\x91\x81\xf0\x9f\x97\xa8"), ":eye_in_speech_bubble:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x98"), ":cupid:" }, - Emoji{ QString::fromUtf8("\xe2\x9d\xa4"), ":heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x93"), ":heartbeat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x94"), ":broken_heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x95"), ":two_hearts:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x96"), ":sparkling_heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x97"), ":heartpulse:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x99"), ":blue_heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9a"), ":green_heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9b"), ":yellow_heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9c"), ":purple_heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x96\xa4"), ":black_heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9d"), ":gift_heart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9e"), ":revolving_hearts:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9f"), ":heart_decoration:" }, - Emoji{ QString::fromUtf8("\xe2\x9d\xa3"), ":heart_exclamation:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa2"), ":anger:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa5"), ":boom:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xab"), ":dizzy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xac"), ":speech_balloon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xa8"), ":speech_left:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x97\xaf"), ":anger_right:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xad"), ":thought_balloon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xae"), ":white_flower:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x90"), ":globe_with_meridians:" }, - Emoji{ QString::fromUtf8("\xe2\x99\xa8"), ":hotsprings:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x91"), ":octagonal_sign:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9b"), ":clock12:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa7"), ":clock1230:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x90"), ":clock1:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9c"), ":clock130:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x91"), ":clock2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9d"), ":clock230:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x92"), ":clock3:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9e"), ":clock330:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x93"), ":clock4:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9f"), ":clock430:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x94"), ":clock5:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa0"), ":clock530:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x95"), ":clock6:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa1"), ":clock630:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x96"), ":clock7:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa2"), ":clock730:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x97"), ":clock8:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa3"), ":clock830:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x98"), ":clock9:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa4"), ":clock930:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x99"), ":clock10:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa5"), ":clock1030:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9a"), ":clock11:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa6"), ":clock1130:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x80"), ":cyclone:" }, - Emoji{ QString::fromUtf8("\xe2\x99\xa0"), ":spades:" }, - Emoji{ QString::fromUtf8("\xe2\x99\xa5"), ":hearts:" }, - Emoji{ QString::fromUtf8("\xe2\x99\xa6"), ":diamonds:" }, - Emoji{ QString::fromUtf8("\xe2\x99\xa3"), ":clubs:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x83\x8f"), ":black_joker:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x80\x84"), ":mahjong:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb4"), ":flower_playing_cards:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x87"), ":mute:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x88"), ":speaker:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x89"), ":sound:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8a"), ":loud_sound:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa2"), ":loudspeaker:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa3"), ":mega:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x94"), ":bell:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x95"), ":no_bell:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb5"), ":musical_note:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb6"), ":notes:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb9"), ":chart:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb1"), ":currency_exchange:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb2"), ":heavy_dollar_sign:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa7"), ":atm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xae"), ":put_litter_in_its_place:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb0"), ":potable_water:" }, - Emoji{ QString::fromUtf8("\xe2\x99\xbf"), ":wheelchair:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb9"), ":mens:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xba"), ":womens:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xbb"), ":restroom:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xbc"), ":baby_symbol:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xbe"), ":wc:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x82"), ":passport_control:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x83"), ":customs:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x84"), ":baggage_claim:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x85"), ":left_luggage:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\xa0"), ":warning:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb8"), ":children_crossing:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\x94"), ":no_entry:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xab"), ":no_entry_sign:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb3"), ":no_bicycles:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xad"), ":no_smoking:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xaf"), ":do_not_litter:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb1"), ":non-potable_water:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb7"), ":no_pedestrians:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb5"), ":no_mobile_phones:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9e"), ":underage:" }, - Emoji{ QString::fromUtf8("\xe2\x98\xa2"), ":radioactive:" }, - Emoji{ QString::fromUtf8("\xe2\x98\xa3"), ":biohazard:" }, - Emoji{ QString::fromUtf8("\xe2\xac\x86"), ":arrow_up:" }, - Emoji{ QString::fromUtf8("\xe2\x86\x97"), ":arrow_upper_right:" }, - Emoji{ QString::fromUtf8("\xe2\x9e\xa1"), ":arrow_right:" }, - Emoji{ QString::fromUtf8("\xe2\x86\x98"), ":arrow_lower_right:" }, - Emoji{ QString::fromUtf8("\xe2\xac\x87"), ":arrow_down:" }, - Emoji{ QString::fromUtf8("\xe2\x86\x99"), ":arrow_lower_left:" }, - Emoji{ QString::fromUtf8("\xe2\xac\x85"), ":arrow_left:" }, - Emoji{ QString::fromUtf8("\xe2\x86\x96"), ":arrow_upper_left:" }, - Emoji{ QString::fromUtf8("\xe2\x86\x95"), ":arrow_up_down:" }, - Emoji{ QString::fromUtf8("\xe2\x86\x94"), ":left_right_arrow:" }, - Emoji{ QString::fromUtf8("\xe2\x86\xa9"), ":leftwards_arrow_with_hook:" }, - Emoji{ QString::fromUtf8("\xe2\x86\xaa"), ":arrow_right_hook:" }, - Emoji{ QString::fromUtf8("\xe2\xa4\xb4"), ":arrow_heading_up:" }, - Emoji{ QString::fromUtf8("\xe2\xa4\xb5"), ":arrow_heading_down:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x83"), ":arrows_clockwise:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x84"), ":arrows_counterclockwise:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x99"), ":back:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9a"), ":end:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9b"), ":on:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9c"), ":soon:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9d"), ":top:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x90"), ":place_of_worship:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\x9b"), ":atom:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x89"), ":om_symbol:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\xa1"), ":star_of_david:" }, - Emoji{ QString::fromUtf8("\xe2\x98\xb8"), ":wheel_of_dharma:" }, - Emoji{ QString::fromUtf8("\xe2\x98\xaf"), ":yin_yang:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x9d"), ":cross:" }, - Emoji{ QString::fromUtf8("\xe2\x98\xa6"), ":orthodox_cross:" }, - Emoji{ QString::fromUtf8("\xe2\x98\xaa"), ":star_and_crescent:" }, - Emoji{ QString::fromUtf8("\xe2\x98\xae"), ":peace:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x95\x8e"), ":menorah:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xaf"), ":six_pointed_star:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x88"), ":aries:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x89"), ":taurus:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x8a"), ":gemini:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x8b"), ":cancer:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x8c"), ":leo:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x8d"), ":virgo:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x8e"), ":libra:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x8f"), ":scorpius:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x90"), ":sagittarius:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x91"), ":capricorn:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x92"), ":aquarius:" }, - Emoji{ QString::fromUtf8("\xe2\x99\x93"), ":pisces:" }, - Emoji{ QString::fromUtf8("\xe2\x9b\x8e"), ":ophiuchus:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x80"), ":twisted_rightwards_arrows:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x81"), ":repeat:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x82"), ":repeat_one:" }, - Emoji{ QString::fromUtf8("\xe2\x96\xb6"), ":arrow_forward:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xa9"), ":fast_forward:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xad"), ":track_next:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xaf"), ":play_pause:" }, - Emoji{ QString::fromUtf8("\xe2\x97\x80"), ":arrow_backward:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xaa"), ":rewind:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xae"), ":track_previous:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xbc"), ":arrow_up_small:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xab"), ":arrow_double_up:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xbd"), ":arrow_down_small:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xac"), ":arrow_double_down:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xb8"), ":pause_button:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xb9"), ":stop_button:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\xba"), ":record_button:" }, - Emoji{ QString::fromUtf8("\xe2\x8f\x8f"), ":eject:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa6"), ":cinema:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x85"), ":low_brightness:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x86"), ":high_brightness:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb6"), ":signal_strength:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb3"), ":vibration_mode:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb4"), ":mobile_phone_off:" }, - Emoji{ QString::fromUtf8("\xe2\x99\xbb"), ":recycle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9b"), ":name_badge:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\x9c"), ":fleur-de-lis:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb0"), ":beginner:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb1"), ":trident:" }, - Emoji{ QString::fromUtf8("\xe2\xad\x95"), ":o:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x85"), ":white_check_mark:" }, - Emoji{ QString::fromUtf8("\xe2\x98\x91"), ":ballot_box_with_check:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x94"), ":heavy_check_mark:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\x96"), ":heavy_multiplication_x:" }, - Emoji{ QString::fromUtf8("\xe2\x9d\x8c"), ":x:" }, - Emoji{ QString::fromUtf8("\xe2\x9d\x8e"), ":negative_squared_cross_mark:" }, - Emoji{ QString::fromUtf8("\xe2\x9e\x95"), ":heavy_plus_sign:" }, - Emoji{ QString::fromUtf8("\xe2\x9e\x96"), ":heavy_minus_sign:" }, - Emoji{ QString::fromUtf8("\xe2\x9e\x97"), ":heavy_division_sign:" }, - Emoji{ QString::fromUtf8("\xe2\x9e\xb0"), ":curly_loop:" }, - Emoji{ QString::fromUtf8("\xe2\x9e\xbf"), ":loop:" }, - Emoji{ QString::fromUtf8("\xe3\x80\xbd"), ":part_alternation_mark:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\xb3"), ":eight_spoked_asterisk:" }, - Emoji{ QString::fromUtf8("\xe2\x9c\xb4"), ":eight_pointed_black_star:" }, - Emoji{ QString::fromUtf8("\xe2\x9d\x87"), ":sparkle:" }, - Emoji{ QString::fromUtf8("\xe2\x80\xbc"), ":bangbang:" }, - Emoji{ QString::fromUtf8("\xe2\x81\x89"), ":interrobang:" }, - Emoji{ QString::fromUtf8("\xe2\x9d\x93"), ":question:" }, - Emoji{ QString::fromUtf8("\xe2\x9d\x94"), ":grey_question:" }, - Emoji{ QString::fromUtf8("\xe2\x9d\x95"), ":grey_exclamation:" }, - Emoji{ QString::fromUtf8("\xe2\x9d\x97"), ":exclamation:" }, - Emoji{ QString::fromUtf8("\xe3\x80\xb0"), ":wavy_dash:" }, - Emoji{ QString::fromUtf8("\xc2\xa9"), ":copyright:" }, - Emoji{ QString::fromUtf8("\xc2\xae"), ":registered:" }, - Emoji{ QString::fromUtf8("\xe2\x84\xa2"), ":tm:" }, - Emoji{ QString::fromUtf8("#\xe2\x83\xa3"), ":hash:" }, - Emoji{ QString::fromUtf8("*\xe2\x83\xa3"), ":asterisk:" }, - Emoji{ QString::fromUtf8("0\xe2\x83\xa3"), ":zero:" }, - Emoji{ QString::fromUtf8("1\xe2\x83\xa3"), ":one:" }, - Emoji{ QString::fromUtf8("2\xe2\x83\xa3"), ":two:" }, - Emoji{ QString::fromUtf8("3\xe2\x83\xa3"), ":three:" }, - Emoji{ QString::fromUtf8("4\xe2\x83\xa3"), ":four:" }, - Emoji{ QString::fromUtf8("5\xe2\x83\xa3"), ":five:" }, - Emoji{ QString::fromUtf8("6\xe2\x83\xa3"), ":six:" }, - Emoji{ QString::fromUtf8("7\xe2\x83\xa3"), ":seven:" }, - Emoji{ QString::fromUtf8("8\xe2\x83\xa3"), ":eight:" }, - Emoji{ QString::fromUtf8("9\xe2\x83\xa3"), ":nine:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9f"), ":keycap_ten:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xaf"), ":100:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa0"), ":capital_abcd:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa1"), ":abcd:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa2"), ":1234:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa3"), ":symbols:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa4"), ":abc:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x85\xb0"), ":a:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x8e"), ":ab:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x85\xb1"), ":b:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x91"), ":cl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x92"), ":cool:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x93"), ":free:" }, - Emoji{ QString::fromUtf8("\xe2\x84\xb9"), ":information_source:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x94"), ":id:" }, - Emoji{ QString::fromUtf8("\xe2\x93\x82"), ":m:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x95"), ":new:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x96"), ":ng:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x85\xbe"), ":o2:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x97"), ":ok:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x85\xbf"), ":parking:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x98"), ":sos:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x99"), ":up:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x86\x9a"), ":vs:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\x81"), ":koko:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\x82"), ":sa:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb7"), ":u6708:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb6"), ":u6709:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\xaf"), ":u6307:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x89\x90"), ":ideograph_advantage:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb9"), ":u5272:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\x9a"), ":u7121:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb2"), ":u7981:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x89\x91"), ":accept:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb8"), ":u7533:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb4"), ":u5408:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb3"), ":u7a7a:" }, - Emoji{ QString::fromUtf8("\xe3\x8a\x97"), ":congratulations:" }, - Emoji{ QString::fromUtf8("\xe3\x8a\x99"), ":secret:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\xba"), ":u55b6:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb5"), ":u6e80:" }, - Emoji{ QString::fromUtf8("\xe2\x96\xaa"), ":black_small_square:" }, - Emoji{ QString::fromUtf8("\xe2\x96\xab"), ":white_small_square:" }, - Emoji{ QString::fromUtf8("\xe2\x97\xbb"), ":white_medium_square:" }, - Emoji{ QString::fromUtf8("\xe2\x97\xbc"), ":black_medium_square:" }, - Emoji{ QString::fromUtf8("\xe2\x97\xbd"), ":white_medium_small_square:" }, - Emoji{ QString::fromUtf8("\xe2\x97\xbe"), ":black_medium_small_square:" }, - Emoji{ QString::fromUtf8("\xe2\xac\x9b"), ":black_large_square:" }, - Emoji{ QString::fromUtf8("\xe2\xac\x9c"), ":white_large_square:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb6"), ":large_orange_diamond:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb7"), ":large_blue_diamond:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb8"), ":small_orange_diamond:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb9"), ":small_blue_diamond:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xba"), ":small_red_triangle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xbb"), ":small_red_triangle_down:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa0"), ":diamond_shape_with_a_dot_inside:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\x98"), ":radio_button:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb2"), ":black_square_button:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb3"), ":white_square_button:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\xaa"), ":white_circle:" }, - Emoji{ QString::fromUtf8("\xe2\x9a\xab"), ":black_circle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb4"), ":red_circle:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb5"), ":blue_circle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x91\x81\xf0\x9f\x97\xa8"), ":eye_in_speech_bubble:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x98"), ":cupid:" }, + Emoji{ QString::fromUtf8("\xe2\x9d\xa4"), ":heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x93"), ":heartbeat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x94"), ":broken_heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x95"), ":two_hearts:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x96"), ":sparkling_heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x97"), ":heartpulse:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x99"), ":blue_heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9a"), ":green_heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9b"), ":yellow_heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9c"), ":purple_heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x96\xa4"), ":black_heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9d"), ":gift_heart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9e"), ":revolving_hearts:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\x9f"), ":heart_decoration:" }, + Emoji{ QString::fromUtf8("\xe2\x9d\xa3"), ":heart_exclamation:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa2"), ":anger:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa5"), ":boom:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xab"), ":dizzy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xac"), ":speech_balloon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xa8"), ":speech_left:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x97\xaf"), ":anger_right:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xad"), ":thought_balloon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xae"), ":white_flower:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x90"), ":globe_with_meridians:" }, + Emoji{ QString::fromUtf8("\xe2\x99\xa8"), ":hotsprings:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x91"), ":octagonal_sign:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9b"), ":clock12:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa7"), ":clock1230:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x90"), ":clock1:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9c"), ":clock130:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x91"), ":clock2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9d"), ":clock230:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x92"), ":clock3:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9e"), ":clock330:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x93"), ":clock4:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9f"), ":clock430:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x94"), ":clock5:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa0"), ":clock530:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x95"), ":clock6:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa1"), ":clock630:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x96"), ":clock7:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa2"), ":clock730:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x97"), ":clock8:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa3"), ":clock830:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x98"), ":clock9:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa4"), ":clock930:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x99"), ":clock10:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa5"), ":clock1030:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x9a"), ":clock11:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\xa6"), ":clock1130:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8c\x80"), ":cyclone:" }, + Emoji{ QString::fromUtf8("\xe2\x99\xa0"), ":spades:" }, + Emoji{ QString::fromUtf8("\xe2\x99\xa5"), ":hearts:" }, + Emoji{ QString::fromUtf8("\xe2\x99\xa6"), ":diamonds:" }, + Emoji{ QString::fromUtf8("\xe2\x99\xa3"), ":clubs:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x83\x8f"), ":black_joker:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x80\x84"), ":mahjong:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb4"), ":flower_playing_cards:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x87"), ":mute:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x88"), ":speaker:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x89"), ":sound:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x8a"), ":loud_sound:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa2"), ":loudspeaker:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xa3"), ":mega:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x94"), ":bell:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x95"), ":no_bell:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb5"), ":musical_note:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xb6"), ":notes:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb9"), ":chart:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb1"), ":currency_exchange:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xb2"), ":heavy_dollar_sign:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8f\xa7"), ":atm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xae"), ":put_litter_in_its_place:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb0"), ":potable_water:" }, + Emoji{ QString::fromUtf8("\xe2\x99\xbf"), ":wheelchair:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb9"), ":mens:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xba"), ":womens:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xbb"), ":restroom:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xbc"), ":baby_symbol:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xbe"), ":wc:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x82"), ":passport_control:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x83"), ":customs:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x84"), ":baggage_claim:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x85"), ":left_luggage:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\xa0"), ":warning:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb8"), ":children_crossing:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\x94"), ":no_entry:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xab"), ":no_entry_sign:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb3"), ":no_bicycles:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xad"), ":no_smoking:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xaf"), ":do_not_litter:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb1"), ":non-potable_water:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9a\xb7"), ":no_pedestrians:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb5"), ":no_mobile_phones:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9e"), ":underage:" }, + Emoji{ QString::fromUtf8("\xe2\x98\xa2"), ":radioactive:" }, + Emoji{ QString::fromUtf8("\xe2\x98\xa3"), ":biohazard:" }, + Emoji{ QString::fromUtf8("\xe2\xac\x86"), ":arrow_up:" }, + Emoji{ QString::fromUtf8("\xe2\x86\x97"), ":arrow_upper_right:" }, + Emoji{ QString::fromUtf8("\xe2\x9e\xa1"), ":arrow_right:" }, + Emoji{ QString::fromUtf8("\xe2\x86\x98"), ":arrow_lower_right:" }, + Emoji{ QString::fromUtf8("\xe2\xac\x87"), ":arrow_down:" }, + Emoji{ QString::fromUtf8("\xe2\x86\x99"), ":arrow_lower_left:" }, + Emoji{ QString::fromUtf8("\xe2\xac\x85"), ":arrow_left:" }, + Emoji{ QString::fromUtf8("\xe2\x86\x96"), ":arrow_upper_left:" }, + Emoji{ QString::fromUtf8("\xe2\x86\x95"), ":arrow_up_down:" }, + Emoji{ QString::fromUtf8("\xe2\x86\x94"), ":left_right_arrow:" }, + Emoji{ QString::fromUtf8("\xe2\x86\xa9"), ":leftwards_arrow_with_hook:" }, + Emoji{ QString::fromUtf8("\xe2\x86\xaa"), ":arrow_right_hook:" }, + Emoji{ QString::fromUtf8("\xe2\xa4\xb4"), ":arrow_heading_up:" }, + Emoji{ QString::fromUtf8("\xe2\xa4\xb5"), ":arrow_heading_down:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x83"), ":arrows_clockwise:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x84"), ":arrows_counterclockwise:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x99"), ":back:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9a"), ":end:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9b"), ":on:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9c"), ":soon:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9d"), ":top:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x9b\x90"), ":place_of_worship:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\x9b"), ":atom:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x89"), ":om_symbol:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\xa1"), ":star_of_david:" }, + Emoji{ QString::fromUtf8("\xe2\x98\xb8"), ":wheel_of_dharma:" }, + Emoji{ QString::fromUtf8("\xe2\x98\xaf"), ":yin_yang:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x9d"), ":cross:" }, + Emoji{ QString::fromUtf8("\xe2\x98\xa6"), ":orthodox_cross:" }, + Emoji{ QString::fromUtf8("\xe2\x98\xaa"), ":star_and_crescent:" }, + Emoji{ QString::fromUtf8("\xe2\x98\xae"), ":peace:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x95\x8e"), ":menorah:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xaf"), ":six_pointed_star:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x88"), ":aries:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x89"), ":taurus:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x8a"), ":gemini:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x8b"), ":cancer:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x8c"), ":leo:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x8d"), ":virgo:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x8e"), ":libra:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x8f"), ":scorpius:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x90"), ":sagittarius:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x91"), ":capricorn:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x92"), ":aquarius:" }, + Emoji{ QString::fromUtf8("\xe2\x99\x93"), ":pisces:" }, + Emoji{ QString::fromUtf8("\xe2\x9b\x8e"), ":ophiuchus:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x80"), ":twisted_rightwards_arrows:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x81"), ":repeat:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x82"), ":repeat_one:" }, + Emoji{ QString::fromUtf8("\xe2\x96\xb6"), ":arrow_forward:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xa9"), ":fast_forward:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xad"), ":track_next:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xaf"), ":play_pause:" }, + Emoji{ QString::fromUtf8("\xe2\x97\x80"), ":arrow_backward:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xaa"), ":rewind:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xae"), ":track_previous:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xbc"), ":arrow_up_small:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xab"), ":arrow_double_up:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xbd"), ":arrow_down_small:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xac"), ":arrow_double_down:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xb8"), ":pause_button:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xb9"), ":stop_button:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\xba"), ":record_button:" }, + Emoji{ QString::fromUtf8("\xe2\x8f\x8f"), ":eject:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x8e\xa6"), ":cinema:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x85"), ":low_brightness:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x86"), ":high_brightness:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb6"), ":signal_strength:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb3"), ":vibration_mode:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\xb4"), ":mobile_phone_off:" }, + Emoji{ QString::fromUtf8("\xe2\x99\xbb"), ":recycle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x93\x9b"), ":name_badge:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\x9c"), ":fleur-de-lis:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb0"), ":beginner:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb1"), ":trident:" }, + Emoji{ QString::fromUtf8("\xe2\xad\x95"), ":o:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x85"), ":white_check_mark:" }, + Emoji{ QString::fromUtf8("\xe2\x98\x91"), ":ballot_box_with_check:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x94"), ":heavy_check_mark:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\x96"), ":heavy_multiplication_x:" }, + Emoji{ QString::fromUtf8("\xe2\x9d\x8c"), ":x:" }, + Emoji{ QString::fromUtf8("\xe2\x9d\x8e"), ":negative_squared_cross_mark:" }, + Emoji{ QString::fromUtf8("\xe2\x9e\x95"), ":heavy_plus_sign:" }, + Emoji{ QString::fromUtf8("\xe2\x9e\x96"), ":heavy_minus_sign:" }, + Emoji{ QString::fromUtf8("\xe2\x9e\x97"), ":heavy_division_sign:" }, + Emoji{ QString::fromUtf8("\xe2\x9e\xb0"), ":curly_loop:" }, + Emoji{ QString::fromUtf8("\xe2\x9e\xbf"), ":loop:" }, + Emoji{ QString::fromUtf8("\xe3\x80\xbd"), ":part_alternation_mark:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\xb3"), ":eight_spoked_asterisk:" }, + Emoji{ QString::fromUtf8("\xe2\x9c\xb4"), ":eight_pointed_black_star:" }, + Emoji{ QString::fromUtf8("\xe2\x9d\x87"), ":sparkle:" }, + Emoji{ QString::fromUtf8("\xe2\x80\xbc"), ":bangbang:" }, + Emoji{ QString::fromUtf8("\xe2\x81\x89"), ":interrobang:" }, + Emoji{ QString::fromUtf8("\xe2\x9d\x93"), ":question:" }, + Emoji{ QString::fromUtf8("\xe2\x9d\x94"), ":grey_question:" }, + Emoji{ QString::fromUtf8("\xe2\x9d\x95"), ":grey_exclamation:" }, + Emoji{ QString::fromUtf8("\xe2\x9d\x97"), ":exclamation:" }, + Emoji{ QString::fromUtf8("\xe3\x80\xb0"), ":wavy_dash:" }, + Emoji{ QString::fromUtf8("\xc2\xa9"), ":copyright:" }, + Emoji{ QString::fromUtf8("\xc2\xae"), ":registered:" }, + Emoji{ QString::fromUtf8("\xe2\x84\xa2"), ":tm:" }, + Emoji{ QString::fromUtf8("#\xe2\x83\xa3"), ":hash:" }, + Emoji{ QString::fromUtf8("*\xe2\x83\xa3"), ":asterisk:" }, + Emoji{ QString::fromUtf8("0\xe2\x83\xa3"), ":zero:" }, + Emoji{ QString::fromUtf8("1\xe2\x83\xa3"), ":one:" }, + Emoji{ QString::fromUtf8("2\xe2\x83\xa3"), ":two:" }, + Emoji{ QString::fromUtf8("3\xe2\x83\xa3"), ":three:" }, + Emoji{ QString::fromUtf8("4\xe2\x83\xa3"), ":four:" }, + Emoji{ QString::fromUtf8("5\xe2\x83\xa3"), ":five:" }, + Emoji{ QString::fromUtf8("6\xe2\x83\xa3"), ":six:" }, + Emoji{ QString::fromUtf8("7\xe2\x83\xa3"), ":seven:" }, + Emoji{ QString::fromUtf8("8\xe2\x83\xa3"), ":eight:" }, + Emoji{ QString::fromUtf8("9\xe2\x83\xa3"), ":nine:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x9f"), ":keycap_ten:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xaf"), ":100:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa0"), ":capital_abcd:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa1"), ":abcd:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa2"), ":1234:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa3"), ":symbols:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xa4"), ":abc:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x85\xb0"), ":a:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x8e"), ":ab:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x85\xb1"), ":b:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x91"), ":cl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x92"), ":cool:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x93"), ":free:" }, + Emoji{ QString::fromUtf8("\xe2\x84\xb9"), ":information_source:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x94"), ":id:" }, + Emoji{ QString::fromUtf8("\xe2\x93\x82"), ":m:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x95"), ":new:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x96"), ":ng:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x85\xbe"), ":o2:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x97"), ":ok:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x85\xbf"), ":parking:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x98"), ":sos:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x99"), ":up:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x86\x9a"), ":vs:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\x81"), ":koko:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\x82"), ":sa:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb7"), ":u6708:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb6"), ":u6709:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\xaf"), ":u6307:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x89\x90"), ":ideograph_advantage:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb9"), ":u5272:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\x9a"), ":u7121:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb2"), ":u7981:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x89\x91"), ":accept:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb8"), ":u7533:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb4"), ":u5408:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb3"), ":u7a7a:" }, + Emoji{ QString::fromUtf8("\xe3\x8a\x97"), ":congratulations:" }, + Emoji{ QString::fromUtf8("\xe3\x8a\x99"), ":secret:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\xba"), ":u55b6:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x88\xb5"), ":u6e80:" }, + Emoji{ QString::fromUtf8("\xe2\x96\xaa"), ":black_small_square:" }, + Emoji{ QString::fromUtf8("\xe2\x96\xab"), ":white_small_square:" }, + Emoji{ QString::fromUtf8("\xe2\x97\xbb"), ":white_medium_square:" }, + Emoji{ QString::fromUtf8("\xe2\x97\xbc"), ":black_medium_square:" }, + Emoji{ QString::fromUtf8("\xe2\x97\xbd"), ":white_medium_small_square:" }, + Emoji{ QString::fromUtf8("\xe2\x97\xbe"), ":black_medium_small_square:" }, + Emoji{ QString::fromUtf8("\xe2\xac\x9b"), ":black_large_square:" }, + Emoji{ QString::fromUtf8("\xe2\xac\x9c"), ":white_large_square:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb6"), ":large_orange_diamond:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb7"), ":large_blue_diamond:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb8"), ":small_orange_diamond:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb9"), ":small_blue_diamond:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xba"), ":small_red_triangle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xbb"), ":small_red_triangle_down:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x92\xa0"), ":diamond_shape_with_a_dot_inside:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\x98"), ":radio_button:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb2"), ":black_square_button:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb3"), ":white_square_button:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\xaa"), ":white_circle:" }, + Emoji{ QString::fromUtf8("\xe2\x9a\xab"), ":black_circle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb4"), ":red_circle:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x94\xb5"), ":blue_circle:" }, }; const QList EmojiProvider::flags = { - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xa8"), ":flag_ac:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xa9"), ":flag_ad:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xaa"), ":flag_ae:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xab"), ":flag_af:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xac"), ":flag_ag:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xae"), ":flag_ai:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb1"), ":flag_al:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb2"), ":flag_am:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb4"), ":flag_ao:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb6"), ":flag_aq:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb7"), ":flag_ar:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb8"), ":flag_as:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb9"), ":flag_at:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xba"), ":flag_au:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbc"), ":flag_aw:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbd"), ":flag_ax:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbf"), ":flag_az:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa6"), ":flag_ba:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa7"), ":flag_bb:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa9"), ":flag_bd:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xaa"), ":flag_be:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xab"), ":flag_bf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xac"), ":flag_bg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xad"), ":flag_bh:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xae"), ":flag_bi:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xaf"), ":flag_bj:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb1"), ":flag_bl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb2"), ":flag_bm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb3"), ":flag_bn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb4"), ":flag_bo:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb6"), ":flag_bq:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb7"), ":flag_br:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb8"), ":flag_bs:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb9"), ":flag_bt:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbb"), ":flag_bv:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbc"), ":flag_bw:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbe"), ":flag_by:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbf"), ":flag_bz:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa6"), ":flag_ca:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa8"), ":flag_cc:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa9"), ":flag_cd:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xab"), ":flag_cf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xac"), ":flag_cg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xad"), ":flag_ch:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xae"), ":flag_ci:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb0"), ":flag_ck:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb1"), ":flag_cl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb2"), ":flag_cm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb3"), ":flag_cn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb4"), ":flag_co:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb5"), ":flag_cp:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb7"), ":flag_cr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xba"), ":flag_cu:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbb"), ":flag_cv:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbc"), ":flag_cw:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbd"), ":flag_cx:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbe"), ":flag_cy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbf"), ":flag_cz:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xaa"), ":flag_de:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xac"), ":flag_dg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xaf"), ":flag_dj:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb0"), ":flag_dk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb2"), ":flag_dm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb4"), ":flag_do:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xbf"), ":flag_dz:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xa6"), ":flag_ea:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xa8"), ":flag_ec:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xaa"), ":flag_ee:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xac"), ":flag_eg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xad"), ":flag_eh:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb7"), ":flag_er:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb8"), ":flag_es:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb9"), ":flag_et:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xba"), ":flag_eu:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xae"), ":flag_fi:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xaf"), ":flag_fj:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb0"), ":flag_fk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb2"), ":flag_fm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb4"), ":flag_fo:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb7"), ":flag_fr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa6"), ":flag_ga:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa7"), ":flag_gb:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa9"), ":flag_gd:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xaa"), ":flag_ge:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xab"), ":flag_gf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xac"), ":flag_gg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xad"), ":flag_gh:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xae"), ":flag_gi:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb1"), ":flag_gl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb2"), ":flag_gm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb3"), ":flag_gn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb5"), ":flag_gp:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb6"), ":flag_gq:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb7"), ":flag_gr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb8"), ":flag_gs:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb9"), ":flag_gt:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xba"), ":flag_gu:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xbc"), ":flag_gw:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xbe"), ":flag_gy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb0"), ":flag_hk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb2"), ":flag_hm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb3"), ":flag_hn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb7"), ":flag_hr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb9"), ":flag_ht:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xba"), ":flag_hu:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xa8"), ":flag_ic:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xa9"), ":flag_id:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xaa"), ":flag_ie:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb1"), ":flag_il:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb2"), ":flag_im:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb3"), ":flag_in:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb4"), ":flag_io:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb6"), ":flag_iq:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb7"), ":flag_ir:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb8"), ":flag_is:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb9"), ":flag_it:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xaa"), ":flag_je:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb2"), ":flag_jm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb4"), ":flag_jo:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb5"), ":flag_jp:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xaa"), ":flag_ke:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xac"), ":flag_kg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xad"), ":flag_kh:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xae"), ":flag_ki:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb2"), ":flag_km:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb3"), ":flag_kn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb5"), ":flag_kp:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb7"), ":flag_kr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbc"), ":flag_kw:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbe"), ":flag_ky:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbf"), ":flag_kz:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa6"), ":flag_la:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa7"), ":flag_lb:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa8"), ":flag_lc:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xae"), ":flag_li:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb0"), ":flag_lk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb7"), ":flag_lr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb8"), ":flag_ls:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb9"), ":flag_lt:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xba"), ":flag_lu:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xbb"), ":flag_lv:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xbe"), ":flag_ly:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa6"), ":flag_ma:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa8"), ":flag_mc:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa9"), ":flag_md:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xaa"), ":flag_me:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xab"), ":flag_mf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xac"), ":flag_mg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xad"), ":flag_mh:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb0"), ":flag_mk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb1"), ":flag_ml:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb2"), ":flag_mm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb3"), ":flag_mn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb4"), ":flag_mo:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb5"), ":flag_mp:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb6"), ":flag_mq:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb7"), ":flag_mr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb8"), ":flag_ms:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb9"), ":flag_mt:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xba"), ":flag_mu:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbb"), ":flag_mv:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbc"), ":flag_mw:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbd"), ":flag_mx:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbe"), ":flag_my:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbf"), ":flag_mz:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xa6"), ":flag_na:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xa8"), ":flag_nc:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xaa"), ":flag_ne:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xab"), ":flag_nf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xac"), ":flag_ng:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xae"), ":flag_ni:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb1"), ":flag_nl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb4"), ":flag_no:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb5"), ":flag_np:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb7"), ":flag_nr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xba"), ":flag_nu:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xbf"), ":flag_nz:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb4\xf0\x9f\x87\xb2"), ":flag_om:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xa6"), ":flag_pa:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xaa"), ":flag_pe:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xab"), ":flag_pf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xac"), ":flag_pg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xad"), ":flag_ph:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb0"), ":flag_pk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb1"), ":flag_pl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb2"), ":flag_pm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb3"), ":flag_pn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb7"), ":flag_pr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb8"), ":flag_ps:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb9"), ":flag_pt:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xbc"), ":flag_pw:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xbe"), ":flag_py:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb6\xf0\x9f\x87\xa6"), ":flag_qa:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xaa"), ":flag_re:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xb4"), ":flag_ro:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xb8"), ":flag_rs:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xba"), ":flag_ru:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xbc"), ":flag_rw:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa6"), ":flag_sa:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa7"), ":flag_sb:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa8"), ":flag_sc:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa9"), ":flag_sd:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xaa"), ":flag_se:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xac"), ":flag_sg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xad"), ":flag_sh:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xae"), ":flag_si:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xaf"), ":flag_sj:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb0"), ":flag_sk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb1"), ":flag_sl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb2"), ":flag_sm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb3"), ":flag_sn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb4"), ":flag_so:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb7"), ":flag_sr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb8"), ":flag_ss:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb9"), ":flag_st:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbb"), ":flag_sv:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbd"), ":flag_sx:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbe"), ":flag_sy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbf"), ":flag_sz:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa6"), ":flag_ta:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa8"), ":flag_tc:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa9"), ":flag_td:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xab"), ":flag_tf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xac"), ":flag_tg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xad"), ":flag_th:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xaf"), ":flag_tj:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb0"), ":flag_tk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb1"), ":flag_tl:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb2"), ":flag_tm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb3"), ":flag_tn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb4"), ":flag_to:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb7"), ":flag_tr:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb9"), ":flag_tt:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbb"), ":flag_tv:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbc"), ":flag_tw:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbf"), ":flag_tz:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xa6"), ":flag_ua:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xac"), ":flag_ug:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xb2"), ":flag_um:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xb8"), ":flag_us:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xbe"), ":flag_uy:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xbf"), ":flag_uz:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xa6"), ":flag_va:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xa8"), ":flag_vc:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xaa"), ":flag_ve:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xac"), ":flag_vg:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xae"), ":flag_vi:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xb3"), ":flag_vn:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xba"), ":flag_vu:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbc\xf0\x9f\x87\xab"), ":flag_wf:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbc\xf0\x9f\x87\xb8"), ":flag_ws:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbd\xf0\x9f\x87\xb0"), ":flag_xk:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbe\xf0\x9f\x87\xaa"), ":flag_ye:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbe\xf0\x9f\x87\xb9"), ":flag_yt:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xa6"), ":flag_za:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xb2"), ":flag_zm:" }, - Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xbc"), ":flag_zw:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xa8"), ":flag_ac:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xa9"), ":flag_ad:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xaa"), ":flag_ae:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xab"), ":flag_af:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xac"), ":flag_ag:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xae"), ":flag_ai:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb1"), ":flag_al:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb2"), ":flag_am:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb4"), ":flag_ao:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb6"), ":flag_aq:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb7"), ":flag_ar:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb8"), ":flag_as:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xb9"), ":flag_at:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xba"), ":flag_au:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbc"), ":flag_aw:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbd"), ":flag_ax:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa6\xf0\x9f\x87\xbf"), ":flag_az:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa6"), ":flag_ba:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa7"), ":flag_bb:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xa9"), ":flag_bd:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xaa"), ":flag_be:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xab"), ":flag_bf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xac"), ":flag_bg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xad"), ":flag_bh:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xae"), ":flag_bi:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xaf"), ":flag_bj:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb1"), ":flag_bl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb2"), ":flag_bm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb3"), ":flag_bn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb4"), ":flag_bo:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb6"), ":flag_bq:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb7"), ":flag_br:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb8"), ":flag_bs:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xb9"), ":flag_bt:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbb"), ":flag_bv:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbc"), ":flag_bw:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbe"), ":flag_by:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa7\xf0\x9f\x87\xbf"), ":flag_bz:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa6"), ":flag_ca:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa8"), ":flag_cc:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xa9"), ":flag_cd:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xab"), ":flag_cf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xac"), ":flag_cg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xad"), ":flag_ch:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xae"), ":flag_ci:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb0"), ":flag_ck:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb1"), ":flag_cl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb2"), ":flag_cm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb3"), ":flag_cn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb4"), ":flag_co:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb5"), ":flag_cp:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xb7"), ":flag_cr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xba"), ":flag_cu:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbb"), ":flag_cv:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbc"), ":flag_cw:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbd"), ":flag_cx:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbe"), ":flag_cy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa8\xf0\x9f\x87\xbf"), ":flag_cz:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xaa"), ":flag_de:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xac"), ":flag_dg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xaf"), ":flag_dj:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb0"), ":flag_dk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb2"), ":flag_dm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xb4"), ":flag_do:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xa9\xf0\x9f\x87\xbf"), ":flag_dz:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xa6"), ":flag_ea:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xa8"), ":flag_ec:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xaa"), ":flag_ee:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xac"), ":flag_eg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xad"), ":flag_eh:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb7"), ":flag_er:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb8"), ":flag_es:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xb9"), ":flag_et:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaa\xf0\x9f\x87\xba"), ":flag_eu:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xae"), ":flag_fi:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xaf"), ":flag_fj:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb0"), ":flag_fk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb2"), ":flag_fm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb4"), ":flag_fo:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xab\xf0\x9f\x87\xb7"), ":flag_fr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa6"), ":flag_ga:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa7"), ":flag_gb:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xa9"), ":flag_gd:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xaa"), ":flag_ge:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xab"), ":flag_gf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xac"), ":flag_gg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xad"), ":flag_gh:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xae"), ":flag_gi:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb1"), ":flag_gl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb2"), ":flag_gm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb3"), ":flag_gn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb5"), ":flag_gp:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb6"), ":flag_gq:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb7"), ":flag_gr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb8"), ":flag_gs:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xb9"), ":flag_gt:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xba"), ":flag_gu:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xbc"), ":flag_gw:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xac\xf0\x9f\x87\xbe"), ":flag_gy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb0"), ":flag_hk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb2"), ":flag_hm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb3"), ":flag_hn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb7"), ":flag_hr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xb9"), ":flag_ht:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xad\xf0\x9f\x87\xba"), ":flag_hu:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xa8"), ":flag_ic:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xa9"), ":flag_id:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xaa"), ":flag_ie:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb1"), ":flag_il:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb2"), ":flag_im:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb3"), ":flag_in:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb4"), ":flag_io:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb6"), ":flag_iq:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb7"), ":flag_ir:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb8"), ":flag_is:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xae\xf0\x9f\x87\xb9"), ":flag_it:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xaa"), ":flag_je:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb2"), ":flag_jm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb4"), ":flag_jo:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xaf\xf0\x9f\x87\xb5"), ":flag_jp:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xaa"), ":flag_ke:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xac"), ":flag_kg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xad"), ":flag_kh:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xae"), ":flag_ki:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb2"), ":flag_km:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb3"), ":flag_kn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb5"), ":flag_kp:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xb7"), ":flag_kr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbc"), ":flag_kw:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbe"), ":flag_ky:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb0\xf0\x9f\x87\xbf"), ":flag_kz:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa6"), ":flag_la:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa7"), ":flag_lb:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xa8"), ":flag_lc:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xae"), ":flag_li:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb0"), ":flag_lk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb7"), ":flag_lr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb8"), ":flag_ls:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xb9"), ":flag_lt:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xba"), ":flag_lu:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xbb"), ":flag_lv:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb1\xf0\x9f\x87\xbe"), ":flag_ly:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa6"), ":flag_ma:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa8"), ":flag_mc:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xa9"), ":flag_md:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xaa"), ":flag_me:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xab"), ":flag_mf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xac"), ":flag_mg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xad"), ":flag_mh:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb0"), ":flag_mk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb1"), ":flag_ml:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb2"), ":flag_mm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb3"), ":flag_mn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb4"), ":flag_mo:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb5"), ":flag_mp:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb6"), ":flag_mq:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb7"), ":flag_mr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb8"), ":flag_ms:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xb9"), ":flag_mt:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xba"), ":flag_mu:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbb"), ":flag_mv:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbc"), ":flag_mw:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbd"), ":flag_mx:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbe"), ":flag_my:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb2\xf0\x9f\x87\xbf"), ":flag_mz:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xa6"), ":flag_na:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xa8"), ":flag_nc:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xaa"), ":flag_ne:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xab"), ":flag_nf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xac"), ":flag_ng:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xae"), ":flag_ni:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb1"), ":flag_nl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb4"), ":flag_no:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb5"), ":flag_np:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xb7"), ":flag_nr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xba"), ":flag_nu:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb3\xf0\x9f\x87\xbf"), ":flag_nz:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb4\xf0\x9f\x87\xb2"), ":flag_om:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xa6"), ":flag_pa:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xaa"), ":flag_pe:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xab"), ":flag_pf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xac"), ":flag_pg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xad"), ":flag_ph:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb0"), ":flag_pk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb1"), ":flag_pl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb2"), ":flag_pm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb3"), ":flag_pn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb7"), ":flag_pr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb8"), ":flag_ps:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xb9"), ":flag_pt:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xbc"), ":flag_pw:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb5\xf0\x9f\x87\xbe"), ":flag_py:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb6\xf0\x9f\x87\xa6"), ":flag_qa:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xaa"), ":flag_re:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xb4"), ":flag_ro:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xb8"), ":flag_rs:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xba"), ":flag_ru:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb7\xf0\x9f\x87\xbc"), ":flag_rw:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa6"), ":flag_sa:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa7"), ":flag_sb:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa8"), ":flag_sc:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xa9"), ":flag_sd:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xaa"), ":flag_se:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xac"), ":flag_sg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xad"), ":flag_sh:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xae"), ":flag_si:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xaf"), ":flag_sj:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb0"), ":flag_sk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb1"), ":flag_sl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb2"), ":flag_sm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb3"), ":flag_sn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb4"), ":flag_so:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb7"), ":flag_sr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb8"), ":flag_ss:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xb9"), ":flag_st:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbb"), ":flag_sv:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbd"), ":flag_sx:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbe"), ":flag_sy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb8\xf0\x9f\x87\xbf"), ":flag_sz:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa6"), ":flag_ta:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa8"), ":flag_tc:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xa9"), ":flag_td:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xab"), ":flag_tf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xac"), ":flag_tg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xad"), ":flag_th:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xaf"), ":flag_tj:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb0"), ":flag_tk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb1"), ":flag_tl:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb2"), ":flag_tm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb3"), ":flag_tn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb4"), ":flag_to:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb7"), ":flag_tr:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xb9"), ":flag_tt:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbb"), ":flag_tv:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbc"), ":flag_tw:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xb9\xf0\x9f\x87\xbf"), ":flag_tz:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xa6"), ":flag_ua:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xac"), ":flag_ug:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xb2"), ":flag_um:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xb8"), ":flag_us:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xbe"), ":flag_uy:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xba\xf0\x9f\x87\xbf"), ":flag_uz:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xa6"), ":flag_va:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xa8"), ":flag_vc:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xaa"), ":flag_ve:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xac"), ":flag_vg:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xae"), ":flag_vi:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xb3"), ":flag_vn:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbb\xf0\x9f\x87\xba"), ":flag_vu:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbc\xf0\x9f\x87\xab"), ":flag_wf:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbc\xf0\x9f\x87\xb8"), ":flag_ws:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbd\xf0\x9f\x87\xb0"), ":flag_xk:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbe\xf0\x9f\x87\xaa"), ":flag_ye:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbe\xf0\x9f\x87\xb9"), ":flag_yt:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xa6"), ":flag_za:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xb2"), ":flag_zm:" }, + Emoji{ QString::fromUtf8("\xf0\x9f\x87\xbf\xf0\x9f\x87\xbc"), ":flag_zw:" }, }; diff --git a/src/ImageItem.cc b/src/ImageItem.cc index 77523465..d4244317 100644 --- a/src/ImageItem.cc +++ b/src/ImageItem.cc @@ -26,169 +26,171 @@ #include "ImageOverlayDialog.h" namespace events = matrix::events; -namespace msgs = matrix::events::messages; +namespace msgs = matrix::events::messages; ImageItem::ImageItem(QSharedPointer client, - const events::MessageEvent &event, - QWidget *parent) + const events::MessageEvent &event, + QWidget *parent) : QWidget(parent) , event_{ event } , client_{ client } { - setMouseTracking(true); - setCursor(Qt::PointingHandCursor); - setAttribute(Qt::WA_Hover, true); + setMouseTracking(true); + setCursor(Qt::PointingHandCursor); + setAttribute(Qt::WA_Hover, true); - url_ = event.msgContent().url(); - text_ = event.content().body(); + url_ = event.msgContent().url(); + text_ = event.content().body(); - QList url_parts = url_.toString().split("mxc://"); + QList url_parts = url_.toString().split("mxc://"); - if (url_parts.size() != 2) { - qDebug() << "Invalid format for image" << url_.toString(); - return; - } + if (url_parts.size() != 2) { + qDebug() << "Invalid format for image" << url_.toString(); + return; + } - QString media_params = url_parts[1]; - url_ = QString("%1/_matrix/media/r0/download/%2").arg(client_.data()->getHomeServer().toString(), media_params); + QString media_params = url_parts[1]; + url_ = QString("%1/_matrix/media/r0/download/%2") + .arg(client_.data()->getHomeServer().toString(), media_params); - client_.data()->downloadImage(event.eventId(), url_); + client_.data()->downloadImage(event.eventId(), url_); - connect(client_.data(), - SIGNAL(imageDownloaded(const QString &, const QPixmap &)), - this, - SLOT(imageDownloaded(const QString &, const QPixmap &))); + connect(client_.data(), + SIGNAL(imageDownloaded(const QString &, const QPixmap &)), + this, + SLOT(imageDownloaded(const QString &, const QPixmap &))); } void ImageItem::imageDownloaded(const QString &event_id, const QPixmap &img) { - if (event_id != event_.eventId()) - return; + if (event_id != event_.eventId()) + return; - setImage(img); + setImage(img); } void ImageItem::openUrl() { - if (url_.toString().isEmpty()) - return; + if (url_.toString().isEmpty()) + return; - if (!QDesktopServices::openUrl(url_)) - qWarning() << "Could not open url" << url_.toString(); + if (!QDesktopServices::openUrl(url_)) + qWarning() << "Could not open url" << url_.toString(); } void ImageItem::scaleImage() { - if (image_.isNull()) - return; + if (image_.isNull()) + return; - auto width_ratio = (double)max_width_ / (double)image_.width(); - auto height_ratio = (double)max_height_ / (double)image_.height(); + auto width_ratio = (double)max_width_ / (double)image_.width(); + auto height_ratio = (double)max_height_ / (double)image_.height(); - auto min_aspect_ratio = std::min(width_ratio, height_ratio); + auto min_aspect_ratio = std::min(width_ratio, height_ratio); - if (min_aspect_ratio > 1) { - width_ = image_.width(); - height_ = image_.height(); - } else { - width_ = image_.width() * min_aspect_ratio; - height_ = image_.height() * min_aspect_ratio; - } + if (min_aspect_ratio > 1) { + width_ = image_.width(); + height_ = image_.height(); + } else { + width_ = image_.width() * min_aspect_ratio; + height_ = image_.height() * min_aspect_ratio; + } - setFixedSize(width_, height_); - scaled_image_ = image_.scaled(width_, height_, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + setFixedSize(width_, height_); + scaled_image_ = + image_.scaled(width_, height_, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); } QSize ImageItem::sizeHint() const { - if (image_.isNull()) - return QSize(max_width_, bottom_height_); + if (image_.isNull()) + return QSize(max_width_, bottom_height_); - return QSize(width_, height_); + return QSize(width_, height_); } void ImageItem::setImage(const QPixmap &image) { - image_ = image; - scaleImage(); - update(); + image_ = image; + scaleImage(); + update(); } void ImageItem::mousePressEvent(QMouseEvent *event) { - if (event->button() != Qt::LeftButton) - return; + if (event->button() != Qt::LeftButton) + return; - if (image_.isNull()) { - openUrl(); - return; - } + if (image_.isNull()) { + openUrl(); + return; + } - auto point = event->pos(); + auto point = event->pos(); - // Click on the text box. - if (QRect(0, height_ - bottom_height_, width_, bottom_height_).contains(point)) { - openUrl(); - } else { - auto image_dialog = new ImageOverlayDialog(image_, this); - image_dialog->show(); - } + // Click on the text box. + if (QRect(0, height_ - bottom_height_, width_, bottom_height_).contains(point)) { + openUrl(); + } else { + auto image_dialog = new ImageOverlayDialog(image_, this); + image_dialog->show(); + } } void ImageItem::resizeEvent(QResizeEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event); - scaleImage(); + scaleImage(); } void ImageItem::paintEvent(QPaintEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event); - QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); - QFont font("Open Sans"); - font.setPixelSize(12); + QFont font("Open Sans"); + font.setPixelSize(12); - QFontMetrics metrics(font); - int fontHeight = metrics.height(); + QFontMetrics metrics(font); + int fontHeight = metrics.height(); - if (image_.isNull()) { - int height = fontHeight + 10; + if (image_.isNull()) { + int height = fontHeight + 10; - QString elidedText = metrics.elidedText(text_, Qt::ElideRight, max_width_ - 10); + QString elidedText = metrics.elidedText(text_, Qt::ElideRight, max_width_ - 10); - setFixedSize(metrics.width(elidedText), fontHeight + 10); + setFixedSize(metrics.width(elidedText), fontHeight + 10); - painter.setFont(font); - painter.setPen(QPen(QColor(66, 133, 244))); - painter.drawText(QPoint(0, height / 2 + 2), elidedText); + painter.setFont(font); + painter.setPen(QPen(QColor(66, 133, 244))); + painter.drawText(QPoint(0, height / 2 + 2), elidedText); - return; - } + return; + } - painter.fillRect(QRect(0, 0, width_, height_), scaled_image_); + painter.fillRect(QRect(0, 0, width_, height_), scaled_image_); - if (underMouse()) { - // Bottom text section - painter.fillRect(QRect(0, height_ - bottom_height_, width_, bottom_height_), - QBrush(QColor(33, 33, 33, 128))); + if (underMouse()) { + // Bottom text section + painter.fillRect(QRect(0, height_ - bottom_height_, width_, bottom_height_), + QBrush(QColor(33, 33, 33, 128))); - QString elidedText = metrics.elidedText(text_, Qt::ElideRight, width_ - 10); + QString elidedText = metrics.elidedText(text_, Qt::ElideRight, width_ - 10); - font.setWeight(500); - painter.setFont(font); - painter.setPen(QPen(QColor("white"))); - painter.drawText(QPoint(5, height_ - fontHeight / 2), elidedText); - } + font.setWeight(500); + painter.setFont(font); + painter.setPen(QPen(QColor("white"))); + painter.drawText(QPoint(5, height_ - fontHeight / 2), elidedText); + } } diff --git a/src/ImageOverlayDialog.cc b/src/ImageOverlayDialog.cc index edb49a0a..56b5707c 100644 --- a/src/ImageOverlayDialog.cc +++ b/src/ImageOverlayDialog.cc @@ -28,103 +28,105 @@ ImageOverlayDialog::ImageOverlayDialog(QPixmap image, QWidget *parent) : QWidget{ parent } , originalImage_{ image } { - setMouseTracking(true); - setParent(0); + setMouseTracking(true); + setParent(0); - setWindowFlags(windowFlags() | Qt::FramelessWindowHint); + setWindowFlags(windowFlags() | Qt::FramelessWindowHint); - setAttribute(Qt::WA_NoSystemBackground, true); - setAttribute(Qt::WA_TranslucentBackground, true); - setAttribute(Qt::WA_DeleteOnClose, true); - setWindowState(Qt::WindowFullScreen); + setAttribute(Qt::WA_NoSystemBackground, true); + setAttribute(Qt::WA_TranslucentBackground, true); + setAttribute(Qt::WA_DeleteOnClose, true); + setWindowState(Qt::WindowFullScreen); - screen_ = QApplication::desktop()->availableGeometry(); + screen_ = QApplication::desktop()->availableGeometry(); - move(QApplication::desktop()->mapToGlobal(screen_.topLeft())); - resize(screen_.size()); + move(QApplication::desktop()->mapToGlobal(screen_.topLeft())); + resize(screen_.size()); - connect(this, SIGNAL(closing()), this, SLOT(close())); + connect(this, SIGNAL(closing()), this, SLOT(close())); - raise(); + raise(); } // TODO: Move this into Utils void ImageOverlayDialog::scaleImage(int max_width, int max_height) { - if (originalImage_.isNull()) - return; + if (originalImage_.isNull()) + return; - auto width_ratio = (double)max_width / (double)originalImage_.width(); - auto height_ratio = (double)max_height / (double)originalImage_.height(); + auto width_ratio = (double)max_width / (double)originalImage_.width(); + auto height_ratio = (double)max_height / (double)originalImage_.height(); - auto min_aspect_ratio = std::min(width_ratio, height_ratio); + auto min_aspect_ratio = std::min(width_ratio, height_ratio); - int final_width = 0; - int final_height = 0; + int final_width = 0; + int final_height = 0; - if (min_aspect_ratio > 1) { - final_width = originalImage_.width(); - final_height = originalImage_.height(); - } else { - final_width = originalImage_.width() * min_aspect_ratio; - final_height = originalImage_.height() * min_aspect_ratio; - } + if (min_aspect_ratio > 1) { + final_width = originalImage_.width(); + final_height = originalImage_.height(); + } else { + final_width = originalImage_.width() * min_aspect_ratio; + final_height = originalImage_.height() * min_aspect_ratio; + } - image_ = originalImage_.scaled(final_width, final_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + image_ = originalImage_.scaled( + final_width, final_height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); } void ImageOverlayDialog::paintEvent(QPaintEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event); - QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); - // Full screen overlay. - painter.fillRect(QRect(0, 0, screen_.width(), screen_.height()), QColor(55, 55, 55, 170)); + // Full screen overlay. + painter.fillRect(QRect(0, 0, screen_.width(), screen_.height()), QColor(55, 55, 55, 170)); - // Left and Right margins - int outer_margin = screen_.width() * 0.12; - int buttonSize = 36; - int margin = outer_margin * 0.1; + // Left and Right margins + int outer_margin = screen_.width() * 0.12; + int buttonSize = 36; + int margin = outer_margin * 0.1; - int max_width = screen_.width() - 2 * outer_margin; - int max_height = screen_.height(); + int max_width = screen_.width() - 2 * outer_margin; + int max_height = screen_.height(); - scaleImage(max_width, max_height); + scaleImage(max_width, max_height); - int diff_x = max_width - image_.width(); - int diff_y = max_height - image_.height(); + int diff_x = max_width - image_.width(); + int diff_y = max_height - image_.height(); - content_ = QRect(outer_margin + diff_x / 2, diff_y / 2, image_.width(), image_.height()); - close_button_ = QRect(screen_.width() - margin - buttonSize, margin, buttonSize, buttonSize); + content_ = QRect(outer_margin + diff_x / 2, diff_y / 2, image_.width(), image_.height()); + close_button_ = + QRect(screen_.width() - margin - buttonSize, margin, buttonSize, buttonSize); - // Draw main content_. - painter.drawPixmap(content_, image_); + // Draw main content_. + painter.drawPixmap(content_, image_); - // Draw top right corner X. - QPen pen; - pen.setCapStyle(Qt::RoundCap); - pen.setWidthF(5); - pen.setColor("gray"); + // Draw top right corner X. + QPen pen; + pen.setCapStyle(Qt::RoundCap); + pen.setWidthF(5); + pen.setColor("gray"); - auto center = close_button_.center(); + auto center = close_button_.center(); - painter.setPen(pen); - painter.drawLine(center - QPointF(15, 15), center + QPointF(15, 15)); - painter.drawLine(center + QPointF(15, -15), center - QPointF(15, -15)); + painter.setPen(pen); + painter.drawLine(center - QPointF(15, 15), center + QPointF(15, 15)); + painter.drawLine(center + QPointF(15, -15), center - QPointF(15, -15)); } void ImageOverlayDialog::mousePressEvent(QMouseEvent *event) { - if (event->button() != Qt::LeftButton) - return; + if (event->button() != Qt::LeftButton) + return; - if (close_button_.contains(event->pos())) - emit closing(); - else if (!content_.contains(event->pos())) - emit closing(); + if (close_button_.contains(event->pos())) + emit closing(); + else if (!content_.contains(event->pos())) + emit closing(); } diff --git a/src/InputValidator.cc b/src/InputValidator.cc index 2f24b3d9..6e343c71 100644 --- a/src/InputValidator.cc +++ b/src/InputValidator.cc @@ -20,7 +20,8 @@ const QRegExp MXID_REGEX("@[A-Za-z0-9._%+-]+:[A-Za-z0-9.-]{1,126}\\.[A-Za-z]{1,63}"); const QRegExp LOCALPART_REGEX("[A-za-z0-9._%+-]{3,}"); const QRegExp PASSWORD_REGEX(".{8,}"); -const QRegExp DOMAIN_REGEX("(?!\\-)(?:[a-zA-Z\\d\\-]{0,62}[a-zA-Z\\d]\\.){1,126}(?!\\d+)[a-zA-Z\\d]{1,63}"); +const QRegExp DOMAIN_REGEX( + "(?!\\-)(?:[a-zA-Z\\d\\-]{0,62}[a-zA-Z\\d]\\.){1,126}(?!\\d+)[a-zA-Z\\d]{1,63}"); QRegExpValidator InputValidator::Id(MXID_REGEX); QRegExpValidator InputValidator::Localpart(LOCALPART_REGEX); diff --git a/src/Login.cc b/src/Login.cc index 87be1003..7010e359 100644 --- a/src/Login.cc +++ b/src/Login.cc @@ -36,43 +36,43 @@ QByteArray LoginRequest::serialize() noexcept { #if defined(Q_OS_MAC) - QString initialDeviceName("nheko on Mac OS"); + QString initialDeviceName("nheko on Mac OS"); #elif defined(Q_OS_LINUX) - QString initialDeviceName("nheko on Linux"); + QString initialDeviceName("nheko on Linux"); #elif defined(Q_OS_WIN) - QString initialDeviceName("nheko on Windows"); + QString initialDeviceName("nheko on Windows"); #else - QString initialDeviceName("nheko"); + QString initialDeviceName("nheko"); #endif - QJsonObject body{ - { "type", "m.login.password" }, - { "user", user_ }, - { "password", password_ }, - { "initial_device_display_name", initialDeviceName }, - }; + QJsonObject body{ + { "type", "m.login.password" }, + { "user", user_ }, + { "password", password_ }, + { "initial_device_display_name", initialDeviceName }, + }; - return QJsonDocument(body).toJson(QJsonDocument::Compact); + return QJsonDocument(body).toJson(QJsonDocument::Compact); } void LoginResponse::deserialize(const QJsonDocument &data) { - if (!data.isObject()) - throw DeserializationException("Login response is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("Login response is not a JSON object"); - QJsonObject object = data.object(); + QJsonObject object = data.object(); - if (object.value("access_token") == QJsonValue::Undefined) - throw DeserializationException("Login: missing access_token param"); + if (object.value("access_token") == QJsonValue::Undefined) + throw DeserializationException("Login: missing access_token param"); - if (object.value("home_server") == QJsonValue::Undefined) - throw DeserializationException("Login: missing home_server param"); + if (object.value("home_server") == QJsonValue::Undefined) + throw DeserializationException("Login: missing home_server param"); - if (object.value("user_id") == QJsonValue::Undefined) - throw DeserializationException("Login: missing user_id param"); + if (object.value("user_id") == QJsonValue::Undefined) + throw DeserializationException("Login: missing user_id param"); - access_token_ = object.value("access_token").toString(); - home_server_ = object.value("home_server").toString(); - user_id_ = object.value("user_id").toString(); + access_token_ = object.value("access_token").toString(); + home_server_ = object.value("home_server").toString(); + user_id_ = object.value("user_id").toString(); } diff --git a/src/LoginPage.cc b/src/LoginPage.cc index c4048f98..b2614c0f 100644 --- a/src/LoginPage.cc +++ b/src/LoginPage.cc @@ -26,274 +26,275 @@ LoginPage::LoginPage(QSharedPointer client, QWidget *parent) , inferredServerAddress_() , client_{ client } { - setStyleSheet("background-color: #f9f9f9"); + setStyleSheet("background-color: #f9f9f9"); - top_layout_ = new QVBoxLayout(); + top_layout_ = new QVBoxLayout(); - top_bar_layout_ = new QHBoxLayout(); - top_bar_layout_->setSpacing(0); - top_bar_layout_->setMargin(0); + top_bar_layout_ = new QHBoxLayout(); + top_bar_layout_->setSpacing(0); + top_bar_layout_->setMargin(0); - back_button_ = new FlatButton(this); - back_button_->setMinimumSize(QSize(30, 30)); - back_button_->setForegroundColor("#333333"); + back_button_ = new FlatButton(this); + back_button_->setMinimumSize(QSize(30, 30)); + back_button_->setForegroundColor("#333333"); - top_bar_layout_->addWidget(back_button_, 0, Qt::AlignLeft | Qt::AlignVCenter); - top_bar_layout_->addStretch(1); + top_bar_layout_->addWidget(back_button_, 0, Qt::AlignLeft | Qt::AlignVCenter); + top_bar_layout_->addStretch(1); - QIcon icon; - icon.addFile(":/icons/icons/left-angle.png", QSize(), QIcon::Normal, QIcon::Off); + QIcon icon; + icon.addFile(":/icons/icons/left-angle.png", QSize(), QIcon::Normal, QIcon::Off); - back_button_->setIcon(icon); - back_button_->setIconSize(QSize(24, 24)); + back_button_->setIcon(icon); + back_button_->setIconSize(QSize(24, 24)); - QIcon advanced_settings_icon; - advanced_settings_icon.addFile(":/icons/icons/cog.png", QSize(), QIcon::Normal, QIcon::Off); + QIcon advanced_settings_icon; + advanced_settings_icon.addFile(":/icons/icons/cog.png", QSize(), QIcon::Normal, QIcon::Off); - logo_ = new QLabel(this); - logo_->setPixmap(QPixmap(":/logos/nheko-128.png")); + logo_ = new QLabel(this); + logo_->setPixmap(QPixmap(":/logos/nheko-128.png")); - logo_layout_ = new QHBoxLayout(); - logo_layout_->setContentsMargins(0, 0, 0, 20); - logo_layout_->addWidget(logo_, 0, Qt::AlignHCenter); + logo_layout_ = new QHBoxLayout(); + logo_layout_->setContentsMargins(0, 0, 0, 20); + logo_layout_->addWidget(logo_, 0, Qt::AlignHCenter); - form_wrapper_ = new QHBoxLayout(); - form_widget_ = new QWidget(); - form_widget_->setMinimumSize(QSize(350, 200)); + form_wrapper_ = new QHBoxLayout(); + form_widget_ = new QWidget(); + form_widget_->setMinimumSize(QSize(350, 200)); - form_layout_ = new QVBoxLayout(); - form_layout_->setSpacing(20); - form_layout_->setContentsMargins(0, 0, 0, 30); - form_widget_->setLayout(form_layout_); + form_layout_ = new QVBoxLayout(); + form_layout_->setSpacing(20); + form_layout_->setContentsMargins(0, 0, 0, 30); + form_widget_->setLayout(form_layout_); - form_wrapper_->addStretch(1); - form_wrapper_->addWidget(form_widget_); - form_wrapper_->addStretch(1); + form_wrapper_->addStretch(1); + form_wrapper_->addWidget(form_widget_); + form_wrapper_->addStretch(1); - matrixid_input_ = new TextField(this); - matrixid_input_->setTextColor("#333333"); - matrixid_input_->setLabel(tr("Matrix ID")); - matrixid_input_->setInkColor("#555459"); - matrixid_input_->setBackgroundColor("#f9f9f9"); - matrixid_input_->setPlaceholderText(tr("e.g @joe:matrix.org")); + matrixid_input_ = new TextField(this); + matrixid_input_->setTextColor("#333333"); + matrixid_input_->setLabel(tr("Matrix ID")); + matrixid_input_->setInkColor("#555459"); + matrixid_input_->setBackgroundColor("#f9f9f9"); + matrixid_input_->setPlaceholderText(tr("e.g @joe:matrix.org")); - spinner_ = new CircularProgress(this); - spinner_->setColor("#acc7dc"); - spinner_->setSize(32); - spinner_->setMaximumWidth(spinner_->width()); - spinner_->hide(); + spinner_ = new CircularProgress(this); + spinner_->setColor("#acc7dc"); + spinner_->setSize(32); + spinner_->setMaximumWidth(spinner_->width()); + spinner_->hide(); - errorIcon_ = new QLabel(this); - errorIcon_->setPixmap(QPixmap(":/icons/icons/error.png")); - errorIcon_->hide(); + errorIcon_ = new QLabel(this); + errorIcon_->setPixmap(QPixmap(":/icons/icons/error.png")); + errorIcon_->hide(); - matrixidLayout_ = new QHBoxLayout(); - matrixidLayout_->addWidget(matrixid_input_, 0, Qt::AlignVCenter); + matrixidLayout_ = new QHBoxLayout(); + matrixidLayout_->addWidget(matrixid_input_, 0, Qt::AlignVCenter); - password_input_ = new TextField(this); - password_input_->setTextColor("#333333"); - password_input_->setLabel(tr("Password")); - password_input_->setInkColor("#555459"); - password_input_->setBackgroundColor("#f9f9f9"); - password_input_->setEchoMode(QLineEdit::Password); + password_input_ = new TextField(this); + password_input_->setTextColor("#333333"); + password_input_->setLabel(tr("Password")); + password_input_->setInkColor("#555459"); + password_input_->setBackgroundColor("#f9f9f9"); + password_input_->setEchoMode(QLineEdit::Password); - serverInput_ = new TextField(this); - serverInput_->setTextColor("#333333"); - serverInput_->setLabel("Homeserver address"); - serverInput_->setInkColor("#555459"); - serverInput_->setBackgroundColor("#f9f9f9"); - serverInput_->setPlaceholderText("matrix.org"); - serverInput_->hide(); + serverInput_ = new TextField(this); + serverInput_->setTextColor("#333333"); + serverInput_->setLabel("Homeserver address"); + serverInput_->setInkColor("#555459"); + serverInput_->setBackgroundColor("#f9f9f9"); + serverInput_->setPlaceholderText("matrix.org"); + serverInput_->hide(); - serverLayout_ = new QHBoxLayout(); - serverLayout_->addWidget(serverInput_, 0, Qt::AlignVCenter); + serverLayout_ = new QHBoxLayout(); + serverLayout_->addWidget(serverInput_, 0, Qt::AlignVCenter); - form_layout_->addLayout(matrixidLayout_); - form_layout_->addWidget(password_input_, Qt::AlignHCenter, 0); - form_layout_->addLayout(serverLayout_); + form_layout_->addLayout(matrixidLayout_); + form_layout_->addWidget(password_input_, Qt::AlignHCenter, 0); + form_layout_->addLayout(serverLayout_); - button_layout_ = new QHBoxLayout(); - button_layout_->setSpacing(0); - button_layout_->setContentsMargins(0, 0, 0, 30); + button_layout_ = new QHBoxLayout(); + button_layout_->setSpacing(0); + button_layout_->setContentsMargins(0, 0, 0, 30); - login_button_ = new RaisedButton(tr("LOGIN"), this); - login_button_->setBackgroundColor(QColor("#333333")); - login_button_->setForegroundColor(QColor("white")); - login_button_->setMinimumSize(350, 65); - login_button_->setFontSize(20); - login_button_->setCornerRadius(3); + login_button_ = new RaisedButton(tr("LOGIN"), this); + login_button_->setBackgroundColor(QColor("#333333")); + login_button_->setForegroundColor(QColor("white")); + login_button_->setMinimumSize(350, 65); + login_button_->setFontSize(20); + login_button_->setCornerRadius(3); - button_layout_->addStretch(1); - button_layout_->addWidget(login_button_); - button_layout_->addStretch(1); + button_layout_->addStretch(1); + button_layout_->addWidget(login_button_); + button_layout_->addStretch(1); - QFont font; - font.setPixelSize(conf::fontSize); + QFont font; + font.setPixelSize(conf::fontSize); - error_label_ = new QLabel(this); - error_label_->setFont(font); - error_label_->setStyleSheet("color: #E22826"); + error_label_ = new QLabel(this); + error_label_->setFont(font); + error_label_->setStyleSheet("color: #E22826"); - top_layout_->addLayout(top_bar_layout_); - top_layout_->addStretch(1); - top_layout_->addLayout(logo_layout_); - top_layout_->addLayout(form_wrapper_); - top_layout_->addStretch(1); - top_layout_->addLayout(button_layout_); - top_layout_->addWidget(error_label_, 0, Qt::AlignHCenter); - top_layout_->addStretch(1); + top_layout_->addLayout(top_bar_layout_); + top_layout_->addStretch(1); + top_layout_->addLayout(logo_layout_); + top_layout_->addLayout(form_wrapper_); + top_layout_->addStretch(1); + top_layout_->addLayout(button_layout_); + top_layout_->addWidget(error_label_, 0, Qt::AlignHCenter); + top_layout_->addStretch(1); - setLayout(top_layout_); + setLayout(top_layout_); - connect(back_button_, SIGNAL(clicked()), this, SLOT(onBackButtonClicked())); - connect(login_button_, SIGNAL(clicked()), this, SLOT(onLoginButtonClicked())); - connect(matrixid_input_, SIGNAL(returnPressed()), login_button_, SLOT(click())); - connect(password_input_, SIGNAL(returnPressed()), login_button_, SLOT(click())); - connect(serverInput_, SIGNAL(returnPressed()), login_button_, SLOT(click())); - connect(client_.data(), SIGNAL(loginError(QString)), this, SLOT(loginError(QString))); - connect(matrixid_input_, SIGNAL(editingFinished()), this, SLOT(onMatrixIdEntered())); - connect(client_.data(), SIGNAL(versionError(QString)), this, SLOT(versionError(QString))); - connect(client_.data(), SIGNAL(versionSuccess()), this, SLOT(versionSuccess())); - connect(serverInput_, SIGNAL(editingFinished()), this, SLOT(onServerAddressEntered())); + connect(back_button_, SIGNAL(clicked()), this, SLOT(onBackButtonClicked())); + connect(login_button_, SIGNAL(clicked()), this, SLOT(onLoginButtonClicked())); + connect(matrixid_input_, SIGNAL(returnPressed()), login_button_, SLOT(click())); + connect(password_input_, SIGNAL(returnPressed()), login_button_, SLOT(click())); + connect(serverInput_, SIGNAL(returnPressed()), login_button_, SLOT(click())); + connect(client_.data(), SIGNAL(loginError(QString)), this, SLOT(loginError(QString))); + connect(matrixid_input_, SIGNAL(editingFinished()), this, SLOT(onMatrixIdEntered())); + connect(client_.data(), SIGNAL(versionError(QString)), this, SLOT(versionError(QString))); + connect(client_.data(), SIGNAL(versionSuccess()), this, SLOT(versionSuccess())); + connect(serverInput_, SIGNAL(editingFinished()), this, SLOT(onServerAddressEntered())); } void LoginPage::loginError(QString error) { - error_label_->setText(error); + error_label_->setText(error); } bool LoginPage::isMatrixIdValid() { - int pos = 0; - auto matrix_id = matrixid_input_->text(); + int pos = 0; + auto matrix_id = matrixid_input_->text(); - return InputValidator::Id.validate(matrix_id, pos) == QValidator::Acceptable; + return InputValidator::Id.validate(matrix_id, pos) == QValidator::Acceptable; } void LoginPage::onMatrixIdEntered() { - error_label_->setText(""); + error_label_->setText(""); - if (!isMatrixIdValid()) { - loginError("You have entered an invalid Matrix ID e.g @joe:matrix.org"); - return; - } else if (password_input_->text().isEmpty()) { - loginError(tr("Empty password")); - } + if (!isMatrixIdValid()) { + loginError("You have entered an invalid Matrix ID e.g @joe:matrix.org"); + return; + } else if (password_input_->text().isEmpty()) { + loginError(tr("Empty password")); + } - QString homeServer = matrixid_input_->text().split(":").at(1); - if (homeServer != inferredServerAddress_) { - serverInput_->hide(); - serverLayout_->removeWidget(errorIcon_); - errorIcon_->hide(); - if (serverInput_->isVisible()) { - matrixidLayout_->removeWidget(spinner_); - serverLayout_->addWidget(spinner_, 0, Qt::AlignVCenter | Qt::AlignRight); - spinner_->show(); - } else { - serverLayout_->removeWidget(spinner_); - matrixidLayout_->addWidget(spinner_, 0, Qt::AlignVCenter | Qt::AlignRight); - spinner_->show(); - } + QString homeServer = matrixid_input_->text().split(":").at(1); + if (homeServer != inferredServerAddress_) { + serverInput_->hide(); + serverLayout_->removeWidget(errorIcon_); + errorIcon_->hide(); + if (serverInput_->isVisible()) { + matrixidLayout_->removeWidget(spinner_); + serverLayout_->addWidget(spinner_, 0, Qt::AlignVCenter | Qt::AlignRight); + spinner_->show(); + } else { + serverLayout_->removeWidget(spinner_); + matrixidLayout_->addWidget(spinner_, 0, Qt::AlignVCenter | Qt::AlignRight); + spinner_->show(); + } - inferredServerAddress_ = homeServer; - serverInput_->setText(homeServer); - client_->setServer(homeServer); - client_->versions(); - } + inferredServerAddress_ = homeServer; + serverInput_->setText(homeServer); + client_->setServer(homeServer); + client_->versions(); + } } void LoginPage::onServerAddressEntered() { - error_label_->setText(""); - client_->setServer(serverInput_->text()); - client_->versions(); + error_label_->setText(""); + client_->setServer(serverInput_->text()); + client_->versions(); - serverLayout_->removeWidget(errorIcon_); - errorIcon_->hide(); - serverLayout_->addWidget(spinner_, 0, Qt::AlignVCenter | Qt::AlignRight); - spinner_->show(); + serverLayout_->removeWidget(errorIcon_); + errorIcon_->hide(); + serverLayout_->addWidget(spinner_, 0, Qt::AlignVCenter | Qt::AlignRight); + spinner_->show(); } void LoginPage::versionError(QString error) { - // Matrix homeservers are often kept on a subdomain called 'matrix' - // so let's try that next, unless the address was set explicitly or the domain part of the username already - // points to this subdomain - QUrl currentServer = client_->getHomeServer(); - QString mxidAddress = matrixid_input_->text().split(":").at(1); - if (currentServer.host() == inferredServerAddress_ && !currentServer.host().startsWith("matrix")) { - error_label_->setText(""); - currentServer.setHost(QString("matrix.") + currentServer.host()); - serverInput_->setText(currentServer.host()); - client_->setServer(currentServer.host()); - client_->versions(); - return; - } + // Matrix homeservers are often kept on a subdomain called 'matrix' + // so let's try that next, unless the address was set explicitly or the domain part of the + // username already points to this subdomain + QUrl currentServer = client_->getHomeServer(); + QString mxidAddress = matrixid_input_->text().split(":").at(1); + if (currentServer.host() == inferredServerAddress_ && + !currentServer.host().startsWith("matrix")) { + error_label_->setText(""); + currentServer.setHost(QString("matrix.") + currentServer.host()); + serverInput_->setText(currentServer.host()); + client_->setServer(currentServer.host()); + client_->versions(); + return; + } - error_label_->setText(error); - serverInput_->show(); + error_label_->setText(error); + serverInput_->show(); - spinner_->hide(); - serverLayout_->removeWidget(spinner_); - serverLayout_->addWidget(errorIcon_, 0, Qt::AlignVCenter | Qt::AlignRight); - errorIcon_->show(); - matrixidLayout_->removeWidget(spinner_); + spinner_->hide(); + serverLayout_->removeWidget(spinner_); + serverLayout_->addWidget(errorIcon_, 0, Qt::AlignVCenter | Qt::AlignRight); + errorIcon_->show(); + matrixidLayout_->removeWidget(spinner_); } void LoginPage::versionSuccess() { - serverLayout_->removeWidget(spinner_); - matrixidLayout_->removeWidget(spinner_); - spinner_->hide(); + serverLayout_->removeWidget(spinner_); + matrixidLayout_->removeWidget(spinner_); + spinner_->hide(); - if (serverInput_->isVisible()) - serverInput_->hide(); + if (serverInput_->isVisible()) + serverInput_->hide(); } void LoginPage::onLoginButtonClicked() { - error_label_->setText(""); + error_label_->setText(""); - if (!isMatrixIdValid()) { - loginError("You have entered an invalid Matrix ID e.g @joe:matrix.org"); - } else if (password_input_->text().isEmpty()) { - loginError("Empty password"); - } else { - QString user = matrixid_input_->text().split(":").at(0).split("@").at(1); - QString password = password_input_->text(); - client_->setServer(serverInput_->text()); - client_->login(user, password); - } + if (!isMatrixIdValid()) { + loginError("You have entered an invalid Matrix ID e.g @joe:matrix.org"); + } else if (password_input_->text().isEmpty()) { + loginError("Empty password"); + } else { + QString user = matrixid_input_->text().split(":").at(0).split("@").at(1); + QString password = password_input_->text(); + client_->setServer(serverInput_->text()); + client_->login(user, password); + } } void LoginPage::reset() { - matrixid_input_->clear(); - password_input_->clear(); - serverInput_->clear(); + matrixid_input_->clear(); + password_input_->clear(); + serverInput_->clear(); - spinner_->hide(); - errorIcon_->hide(); - serverLayout_->removeWidget(spinner_); - serverLayout_->removeWidget(errorIcon_); - matrixidLayout_->removeWidget(spinner_); + spinner_->hide(); + errorIcon_->hide(); + serverLayout_->removeWidget(spinner_); + serverLayout_->removeWidget(errorIcon_); + matrixidLayout_->removeWidget(spinner_); - inferredServerAddress_.clear(); + inferredServerAddress_.clear(); } void LoginPage::onBackButtonClicked() { - emit backButtonClicked(); + emit backButtonClicked(); } LoginPage::~LoginPage() diff --git a/src/LogoutDialog.cc b/src/LogoutDialog.cc index 76002ad7..0b862b6e 100644 --- a/src/LogoutDialog.cc +++ b/src/LogoutDialog.cc @@ -25,37 +25,37 @@ LogoutDialog::LogoutDialog(QWidget *parent) : QFrame(parent) { - setMaximumSize(400, 400); - setStyleSheet("background-color: #f9f9f9"); + setMaximumSize(400, 400); + setStyleSheet("background-color: #f9f9f9"); - auto layout = new QVBoxLayout(this); - layout->setSpacing(30); - layout->setMargin(20); + auto layout = new QVBoxLayout(this); + layout->setSpacing(30); + layout->setMargin(20); - auto buttonLayout = new QHBoxLayout(); - buttonLayout->setSpacing(0); - buttonLayout->setMargin(0); + auto buttonLayout = new QHBoxLayout(); + buttonLayout->setSpacing(0); + buttonLayout->setMargin(0); - confirmBtn_ = new FlatButton("OK", this); - confirmBtn_->setFontSize(conf::btn::fontSize); + confirmBtn_ = new FlatButton("OK", this); + confirmBtn_->setFontSize(conf::btn::fontSize); - cancelBtn_ = new FlatButton(tr("CANCEL"), this); - cancelBtn_->setFontSize(conf::btn::fontSize); + cancelBtn_ = new FlatButton(tr("CANCEL"), this); + cancelBtn_->setFontSize(conf::btn::fontSize); - buttonLayout->addStretch(1); - buttonLayout->addWidget(confirmBtn_); - buttonLayout->addWidget(cancelBtn_); + buttonLayout->addStretch(1); + buttonLayout->addWidget(confirmBtn_); + buttonLayout->addWidget(cancelBtn_); - QFont font; - font.setPixelSize(conf::headerFontSize); + QFont font; + font.setPixelSize(conf::headerFontSize); - auto label = new QLabel(tr("Logout. Are you sure?"), this); - label->setFont(font); - label->setStyleSheet("color: #333333"); + auto label = new QLabel(tr("Logout. Are you sure?"), this); + label->setFont(font); + label->setStyleSheet("color: #333333"); - layout->addWidget(label); - layout->addLayout(buttonLayout); + layout->addWidget(label); + layout->addLayout(buttonLayout); - connect(confirmBtn_, &QPushButton::clicked, [=]() { emit closing(true); }); - connect(cancelBtn_, &QPushButton::clicked, [=]() { emit closing(false); }); + connect(confirmBtn_, &QPushButton::clicked, [=]() { emit closing(true); }); + connect(cancelBtn_, &QPushButton::clicked, [=]() { emit closing(false); }); } diff --git a/src/MainWindow.cc b/src/MainWindow.cc index 1567e8ba..d53b59cd 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc @@ -30,217 +30,221 @@ MainWindow::MainWindow(QWidget *parent) , progress_modal_{ nullptr } , spinner_{ nullptr } { - QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - setSizePolicy(sizePolicy); - setWindowTitle("nheko"); - setObjectName("MainWindow"); - setStyleSheet("QWidget#MainWindow {background-color: #f9f9f9}"); + QSizePolicy sizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + setSizePolicy(sizePolicy); + setWindowTitle("nheko"); + setObjectName("MainWindow"); + setStyleSheet("QWidget#MainWindow {background-color: #f9f9f9}"); - restoreWindowSize(); - setMinimumSize(QSize(conf::window::minWidth, conf::window::minHeight)); + restoreWindowSize(); + setMinimumSize(QSize(conf::window::minWidth, conf::window::minHeight)); - QFont font("Open Sans"); - font.setPixelSize(conf::fontSize); - font.setStyleStrategy(QFont::PreferAntialias); - setFont(font); + QFont font("Open Sans"); + font.setPixelSize(conf::fontSize); + font.setStyleStrategy(QFont::PreferAntialias); + setFont(font); - client_ = QSharedPointer(new MatrixClient("matrix.org")); - trayIcon_ = new TrayIcon(":/logos/nheko-32.png", this); + client_ = QSharedPointer(new MatrixClient("matrix.org")); + trayIcon_ = new TrayIcon(":/logos/nheko-32.png", this); - welcome_page_ = new WelcomePage(this); - login_page_ = new LoginPage(client_, this); - register_page_ = new RegisterPage(client_, this); - chat_page_ = new ChatPage(client_, this); + welcome_page_ = new WelcomePage(this); + login_page_ = new LoginPage(client_, this); + register_page_ = new RegisterPage(client_, this); + chat_page_ = new ChatPage(client_, this); - // Initialize sliding widget manager. - sliding_stack_ = new SlidingStackWidget(this); - sliding_stack_->addWidget(welcome_page_); - sliding_stack_->addWidget(login_page_); - sliding_stack_->addWidget(register_page_); - sliding_stack_->addWidget(chat_page_); + // Initialize sliding widget manager. + sliding_stack_ = new SlidingStackWidget(this); + sliding_stack_->addWidget(welcome_page_); + sliding_stack_->addWidget(login_page_); + sliding_stack_->addWidget(register_page_); + sliding_stack_->addWidget(chat_page_); - setCentralWidget(sliding_stack_); + setCentralWidget(sliding_stack_); - connect(welcome_page_, SIGNAL(userLogin()), this, SLOT(showLoginPage())); - connect(welcome_page_, SIGNAL(userRegister()), this, SLOT(showRegisterPage())); + connect(welcome_page_, SIGNAL(userLogin()), this, SLOT(showLoginPage())); + connect(welcome_page_, SIGNAL(userRegister()), this, SLOT(showRegisterPage())); - connect(login_page_, SIGNAL(backButtonClicked()), this, SLOT(showWelcomePage())); - connect(register_page_, SIGNAL(backButtonClicked()), this, SLOT(showWelcomePage())); + connect(login_page_, SIGNAL(backButtonClicked()), this, SLOT(showWelcomePage())); + connect(register_page_, SIGNAL(backButtonClicked()), this, SLOT(showWelcomePage())); - connect(chat_page_, SIGNAL(close()), this, SLOT(showWelcomePage())); - connect(chat_page_, SIGNAL(changeWindowTitle(QString)), this, SLOT(setWindowTitle(QString))); - connect(chat_page_, SIGNAL(unreadMessages(int)), trayIcon_, SLOT(setUnreadCount(int))); + connect(chat_page_, SIGNAL(close()), this, SLOT(showWelcomePage())); + connect( + chat_page_, SIGNAL(changeWindowTitle(QString)), this, SLOT(setWindowTitle(QString))); + connect(chat_page_, SIGNAL(unreadMessages(int)), trayIcon_, SLOT(setUnreadCount(int))); - connect(trayIcon_, - SIGNAL(activated(QSystemTrayIcon::ActivationReason)), - this, - SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); + connect(trayIcon_, + SIGNAL(activated(QSystemTrayIcon::ActivationReason)), + this, + SLOT(iconActivated(QSystemTrayIcon::ActivationReason))); - connect(chat_page_, SIGNAL(contentLoaded()), this, SLOT(removeOverlayProgressBar())); + connect(chat_page_, SIGNAL(contentLoaded()), this, SLOT(removeOverlayProgressBar())); - connect(client_.data(), - SIGNAL(loginSuccess(QString, QString, QString)), - this, - SLOT(showChatPage(QString, QString, QString))); + connect(client_.data(), + SIGNAL(loginSuccess(QString, QString, QString)), + this, + SLOT(showChatPage(QString, QString, QString))); - QSettings settings; + QSettings settings; - if (hasActiveUser()) { - QString token = settings.value("auth/access_token").toString(); - QString home_server = settings.value("auth/home_server").toString(); - QString user_id = settings.value("auth/user_id").toString(); + if (hasActiveUser()) { + QString token = settings.value("auth/access_token").toString(); + QString home_server = settings.value("auth/home_server").toString(); + QString user_id = settings.value("auth/user_id").toString(); - showChatPage(user_id, home_server, token); - } + showChatPage(user_id, home_server, token); + } } void MainWindow::restoreWindowSize() { - QSettings settings; - int savedWidth = settings.value("window/width").toInt(); - int savedheight = settings.value("window/height").toInt(); + QSettings settings; + int savedWidth = settings.value("window/width").toInt(); + int savedheight = settings.value("window/height").toInt(); - if (savedWidth == 0 || savedheight == 0) - resize(conf::window::width, conf::window::height); - else - resize(savedWidth, savedheight); + if (savedWidth == 0 || savedheight == 0) + resize(conf::window::width, conf::window::height); + else + resize(savedWidth, savedheight); } void MainWindow::saveCurrentWindowSize() { - QSettings settings; - QSize current = size(); + QSettings settings; + QSize current = size(); - settings.setValue("window/width", current.width()); - settings.setValue("window/height", current.height()); + settings.setValue("window/width", current.width()); + settings.setValue("window/height", current.height()); } void MainWindow::removeOverlayProgressBar() { - QTimer *timer = new QTimer(this); - timer->setSingleShot(true); + QTimer *timer = new QTimer(this); + timer->setSingleShot(true); - connect(timer, &QTimer::timeout, [=]() { - timer->deleteLater(); + connect(timer, &QTimer::timeout, [=]() { + timer->deleteLater(); - if (progress_modal_ != nullptr) { - progress_modal_->deleteLater(); - progress_modal_->fadeOut(); - } + if (progress_modal_ != nullptr) { + progress_modal_->deleteLater(); + progress_modal_->fadeOut(); + } - if (spinner_ != nullptr) - spinner_->deleteLater(); + if (spinner_ != nullptr) + spinner_->deleteLater(); - progress_modal_ = nullptr; - spinner_ = nullptr; - }); + progress_modal_ = nullptr; + spinner_ = nullptr; + }); - timer->start(500); + timer->start(500); } void MainWindow::showChatPage(QString userid, QString homeserver, QString token) { - QSettings settings; - settings.setValue("auth/access_token", token); - settings.setValue("auth/home_server", homeserver); - settings.setValue("auth/user_id", userid); + QSettings settings; + settings.setValue("auth/access_token", token); + settings.setValue("auth/home_server", homeserver); + settings.setValue("auth/user_id", userid); - int index = sliding_stack_->getWidgetIndex(chat_page_); - int modalOpacityDuration = 300; + int index = sliding_stack_->getWidgetIndex(chat_page_); + int modalOpacityDuration = 300; - // If we go directly from the welcome page don't show an animation. - if (sliding_stack_->currentIndex() == 0) { - sliding_stack_->setCurrentIndex(index); - modalOpacityDuration = 0; - } else { - sliding_stack_->slideInIndex(index, SlidingStackWidget::AnimationDirection::LEFT_TO_RIGHT); - } + // If we go directly from the welcome page don't show an animation. + if (sliding_stack_->currentIndex() == 0) { + sliding_stack_->setCurrentIndex(index); + modalOpacityDuration = 0; + } else { + sliding_stack_->slideInIndex(index, + SlidingStackWidget::AnimationDirection::LEFT_TO_RIGHT); + } - if (spinner_ == nullptr) { - spinner_ = new CircularProgress(this); - spinner_->setColor("#acc7dc"); - spinner_->setSize(100); - } + if (spinner_ == nullptr) { + spinner_ = new CircularProgress(this); + spinner_->setColor("#acc7dc"); + spinner_->setSize(100); + } - if (progress_modal_ == nullptr) { - progress_modal_ = new OverlayModal(this, spinner_); - progress_modal_->fadeIn(); - progress_modal_->setDuration(modalOpacityDuration); - } + if (progress_modal_ == nullptr) { + progress_modal_ = new OverlayModal(this, spinner_); + progress_modal_->fadeIn(); + progress_modal_->setDuration(modalOpacityDuration); + } - login_page_->reset(); - chat_page_->bootstrap(userid, homeserver, token); + login_page_->reset(); + chat_page_->bootstrap(userid, homeserver, token); - instance_ = this; + instance_ = this; } void MainWindow::showWelcomePage() { - int index = sliding_stack_->getWidgetIndex(welcome_page_); + int index = sliding_stack_->getWidgetIndex(welcome_page_); - if (sliding_stack_->currentIndex() == sliding_stack_->getWidgetIndex(login_page_)) - sliding_stack_->slideInIndex(index, SlidingStackWidget::AnimationDirection::RIGHT_TO_LEFT); - else - sliding_stack_->slideInIndex(index, SlidingStackWidget::AnimationDirection::LEFT_TO_RIGHT); + if (sliding_stack_->currentIndex() == sliding_stack_->getWidgetIndex(login_page_)) + sliding_stack_->slideInIndex(index, + SlidingStackWidget::AnimationDirection::RIGHT_TO_LEFT); + else + sliding_stack_->slideInIndex(index, + SlidingStackWidget::AnimationDirection::LEFT_TO_RIGHT); } void MainWindow::showLoginPage() { - int index = sliding_stack_->getWidgetIndex(login_page_); - sliding_stack_->slideInIndex(index, SlidingStackWidget::AnimationDirection::LEFT_TO_RIGHT); + int index = sliding_stack_->getWidgetIndex(login_page_); + sliding_stack_->slideInIndex(index, SlidingStackWidget::AnimationDirection::LEFT_TO_RIGHT); } void MainWindow::showRegisterPage() { - int index = sliding_stack_->getWidgetIndex(register_page_); - sliding_stack_->slideInIndex(index, SlidingStackWidget::AnimationDirection::RIGHT_TO_LEFT); + int index = sliding_stack_->getWidgetIndex(register_page_); + sliding_stack_->slideInIndex(index, SlidingStackWidget::AnimationDirection::RIGHT_TO_LEFT); } void MainWindow::closeEvent(QCloseEvent *event) { - if (isVisible()) { - event->ignore(); - hide(); - } + if (isVisible()) { + event->ignore(); + hide(); + } } void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason) { - switch (reason) { - case QSystemTrayIcon::Trigger: - if (!isVisible()) { - show(); - } else { - hide(); - } - break; - default: - break; - } + switch (reason) { + case QSystemTrayIcon::Trigger: + if (!isVisible()) { + show(); + } else { + hide(); + } + break; + default: + break; + } } bool MainWindow::hasActiveUser() { - QSettings settings; + QSettings settings; - return settings.contains("auth/access_token") && settings.contains("auth/home_server") && - settings.contains("auth/user_id"); + return settings.contains("auth/access_token") && settings.contains("auth/home_server") && + settings.contains("auth/user_id"); } MainWindow * MainWindow::instance() { - return instance_; + return instance_; } MainWindow::~MainWindow() diff --git a/src/Profile.cc b/src/Profile.cc index 12430196..dcd9c7a1 100644 --- a/src/Profile.cc +++ b/src/Profile.cc @@ -25,14 +25,14 @@ void ProfileResponse::deserialize(const QJsonDocument &data) { - if (!data.isObject()) - throw DeserializationException("Response is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("Response is not a JSON object"); - QJsonObject object = data.object(); + QJsonObject object = data.object(); - if (object.contains("avatar_url")) - avatar_url_ = QUrl(object.value("avatar_url").toString()); + if (object.contains("avatar_url")) + avatar_url_ = QUrl(object.value("avatar_url").toString()); - if (object.contains("displayname")) - display_name_ = object.value("displayname").toString(); + if (object.contains("displayname")) + display_name_ = object.value("displayname").toString(); } diff --git a/src/QuickSwitcher.cc b/src/QuickSwitcher.cc index fed195d9..29876f99 100644 --- a/src/QuickSwitcher.cc +++ b/src/QuickSwitcher.cc @@ -30,126 +30,127 @@ RoomSearchInput::RoomSearchInput(QWidget *parent) bool RoomSearchInput::focusNextPrevChild(bool next) { - Q_UNUSED(next); + Q_UNUSED(next); - return false; + return false; } void RoomSearchInput::keyPressEvent(QKeyEvent *event) { - if (event->key() == Qt::Key_Tab || event->key() == Qt::Key_Down) { - emit selectNextCompletion(); - event->accept(); - return; - } else if (event->key() == Qt::Key_Up) { - emit selectPreviousCompletion(); - event->accept(); - return; - } + if (event->key() == Qt::Key_Tab || event->key() == Qt::Key_Down) { + emit selectNextCompletion(); + event->accept(); + return; + } else if (event->key() == Qt::Key_Up) { + emit selectPreviousCompletion(); + event->accept(); + return; + } - TextField::keyPressEvent(event); + TextField::keyPressEvent(event); } void RoomSearchInput::hideEvent(QHideEvent *event) { - emit hiding(); - TextField::hideEvent(event); + emit hiding(); + TextField::hideEvent(event); } QuickSwitcher::QuickSwitcher(QWidget *parent) : QFrame(parent) { - setMaximumWidth(450); - setStyleSheet("background-color: white"); + setMaximumWidth(450); + setStyleSheet("background-color: white"); - QFont font; - font.setPixelSize(20); + QFont font; + font.setPixelSize(20); - roomSearch_ = new RoomSearchInput(this); - roomSearch_->setFont(font); - roomSearch_->setPlaceholderText(tr("Find a room...")); + roomSearch_ = new RoomSearchInput(this); + roomSearch_->setFont(font); + roomSearch_->setPlaceholderText(tr("Find a room...")); - completer_ = new QCompleter(); - completer_->setCaseSensitivity(Qt::CaseInsensitive); - completer_->setCompletionMode(QCompleter::PopupCompletion); - completer_->setWidget(this); + completer_ = new QCompleter(); + completer_->setCaseSensitivity(Qt::CaseInsensitive); + completer_->setCompletionMode(QCompleter::PopupCompletion); + completer_->setWidget(this); - topLayout_ = new QVBoxLayout(this); - topLayout_->addWidget(roomSearch_); + topLayout_ = new QVBoxLayout(this); + topLayout_->addWidget(roomSearch_); - connect(completer_, SIGNAL(highlighted(QString)), roomSearch_, SLOT(setText(QString))); - connect(roomSearch_, &QLineEdit::textEdited, this, [=](const QString &prefix) { - if (prefix.isEmpty()) { - completer_->popup()->hide(); - selection_ = -1; - return; - } + connect(completer_, SIGNAL(highlighted(QString)), roomSearch_, SLOT(setText(QString))); + connect(roomSearch_, &QLineEdit::textEdited, this, [=](const QString &prefix) { + if (prefix.isEmpty()) { + completer_->popup()->hide(); + selection_ = -1; + return; + } - if (prefix != completer_->completionPrefix()) { - completer_->setCompletionPrefix(prefix); - selection_ = -1; - } + if (prefix != completer_->completionPrefix()) { + completer_->setCompletionPrefix(prefix); + selection_ = -1; + } - completer_->popup()->setWindowFlags(completer_->popup()->windowFlags() | Qt::ToolTip | - Qt::NoDropShadowWindowHint); - completer_->popup()->setAttribute(Qt::WA_ShowWithoutActivating); - completer_->complete(); - }); + completer_->popup()->setWindowFlags(completer_->popup()->windowFlags() | + Qt::ToolTip | Qt::NoDropShadowWindowHint); + completer_->popup()->setAttribute(Qt::WA_ShowWithoutActivating); + completer_->complete(); + }); - connect(roomSearch_, &RoomSearchInput::selectNextCompletion, this, [=]() { - selection_ += 1; + connect(roomSearch_, &RoomSearchInput::selectNextCompletion, this, [=]() { + selection_ += 1; - if (!completer_->setCurrentRow(selection_)) { - selection_ = 0; - completer_->setCurrentRow(selection_); - } + if (!completer_->setCurrentRow(selection_)) { + selection_ = 0; + completer_->setCurrentRow(selection_); + } - completer_->popup()->setCurrentIndex(completer_->currentIndex()); - }); + completer_->popup()->setCurrentIndex(completer_->currentIndex()); + }); - connect(roomSearch_, &RoomSearchInput::selectPreviousCompletion, this, [=]() { - selection_ -= 1; + connect(roomSearch_, &RoomSearchInput::selectPreviousCompletion, this, [=]() { + selection_ -= 1; - if (!completer_->setCurrentRow(selection_)) { - selection_ = completer_->completionCount() - 1; - completer_->setCurrentRow(selection_); - } + if (!completer_->setCurrentRow(selection_)) { + selection_ = completer_->completionCount() - 1; + completer_->setCurrentRow(selection_); + } - completer_->popup()->setCurrentIndex(completer_->currentIndex()); - }); + completer_->popup()->setCurrentIndex(completer_->currentIndex()); + }); - connect(roomSearch_, &RoomSearchInput::hiding, this, [=]() { completer_->popup()->hide(); }); - connect(roomSearch_, &QLineEdit::returnPressed, this, [=]() { - emit closing(); - emit roomSelected(rooms_[this->roomSearch_->text().trimmed()]); + connect( + roomSearch_, &RoomSearchInput::hiding, this, [=]() { completer_->popup()->hide(); }); + connect(roomSearch_, &QLineEdit::returnPressed, this, [=]() { + emit closing(); + emit roomSelected(rooms_[this->roomSearch_->text().trimmed()]); - roomSearch_->clear(); - }); + roomSearch_->clear(); + }); } void QuickSwitcher::setRoomList(const QMap &rooms) { - rooms_ = rooms; - QStringList items = rooms.keys(); + rooms_ = rooms; + QStringList items = rooms.keys(); - completer_->setModel(new QStringListModel(items)); + completer_->setModel(new QStringListModel(items)); } void QuickSwitcher::showEvent(QShowEvent *) { - roomSearch_->setFocus(); + roomSearch_->setFocus(); } void QuickSwitcher::keyPressEvent(QKeyEvent *event) { - if (event->key() == Qt::Key_Escape) { - roomSearch_->clear(); - event->accept(); - emit closing(); - } + if (event->key() == Qt::Key_Escape) { + roomSearch_->clear(); + event->accept(); + emit closing(); + } } diff --git a/src/Register.cc b/src/Register.cc index 616625f5..2e2c227c 100644 --- a/src/Register.cc +++ b/src/Register.cc @@ -31,29 +31,29 @@ RegisterRequest::RegisterRequest(const QString &username, const QString &passwor QByteArray RegisterRequest::serialize() noexcept { - QJsonObject body{ { "username", user_ }, { "password", password_ } }; + QJsonObject body{ { "username", user_ }, { "password", password_ } }; - return QJsonDocument(body).toJson(QJsonDocument::Compact); + return QJsonDocument(body).toJson(QJsonDocument::Compact); } void RegisterResponse::deserialize(const QJsonDocument &data) { - if (!data.isObject()) - throw DeserializationException("Response is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("Response is not a JSON object"); - QJsonObject object = data.object(); + QJsonObject object = data.object(); - if (!object.contains("access_token")) - throw DeserializationException("Missing access_token param"); + if (!object.contains("access_token")) + throw DeserializationException("Missing access_token param"); - if (!object.contains("home_server")) - throw DeserializationException("Missing home_server param"); + if (!object.contains("home_server")) + throw DeserializationException("Missing home_server param"); - if (!object.contains("user_id")) - throw DeserializationException("Missing user_id param"); + if (!object.contains("user_id")) + throw DeserializationException("Missing user_id param"); - access_token_ = object.value("access_token").toString(); - home_server_ = object.value("home_server").toString(); - user_id_ = object.value("user_id").toString(); + access_token_ = object.value("access_token").toString(); + home_server_ = object.value("home_server").toString(); + user_id_ = object.value("user_id").toString(); } diff --git a/src/RegisterPage.cc b/src/RegisterPage.cc index 8ac51da5..f29dd268 100644 --- a/src/RegisterPage.cc +++ b/src/RegisterPage.cc @@ -26,156 +26,159 @@ RegisterPage::RegisterPage(QSharedPointer client, QWidget *parent) : QWidget(parent) , client_(client) { - setStyleSheet("background-color: #f9f9f9"); + setStyleSheet("background-color: #f9f9f9"); - top_layout_ = new QVBoxLayout(); + top_layout_ = new QVBoxLayout(); - back_layout_ = new QHBoxLayout(); - back_layout_->setSpacing(0); - back_layout_->setContentsMargins(5, 5, -1, -1); + back_layout_ = new QHBoxLayout(); + back_layout_->setSpacing(0); + back_layout_->setContentsMargins(5, 5, -1, -1); - back_button_ = new FlatButton(this); - back_button_->setMinimumSize(QSize(30, 30)); + back_button_ = new FlatButton(this); + back_button_->setMinimumSize(QSize(30, 30)); - QIcon icon; - icon.addFile(":/icons/icons/left-angle.png", QSize(), QIcon::Normal, QIcon::Off); + QIcon icon; + icon.addFile(":/icons/icons/left-angle.png", QSize(), QIcon::Normal, QIcon::Off); - back_button_->setIcon(icon); - back_button_->setIconSize(QSize(24, 24)); + back_button_->setIcon(icon); + back_button_->setIconSize(QSize(24, 24)); - back_layout_->addWidget(back_button_, 0, Qt::AlignLeft | Qt::AlignVCenter); - back_layout_->addStretch(1); + back_layout_->addWidget(back_button_, 0, Qt::AlignLeft | Qt::AlignVCenter); + back_layout_->addStretch(1); - logo_ = new Avatar(this); - logo_->setImage(QImage(":/logos/nheko-128.png")); - logo_->setSize(80); + logo_ = new Avatar(this); + logo_->setImage(QImage(":/logos/nheko-128.png")); + logo_->setSize(80); - logo_layout_ = new QHBoxLayout(); - logo_layout_->setMargin(0); - logo_layout_->addWidget(logo_, 0, Qt::AlignHCenter); + logo_layout_ = new QHBoxLayout(); + logo_layout_->setMargin(0); + logo_layout_->addWidget(logo_, 0, Qt::AlignHCenter); - form_wrapper_ = new QHBoxLayout(); - form_widget_ = new QWidget(); - form_widget_->setMinimumSize(QSize(350, 300)); + form_wrapper_ = new QHBoxLayout(); + form_widget_ = new QWidget(); + form_widget_->setMinimumSize(QSize(350, 300)); - form_layout_ = new QVBoxLayout(); - form_layout_->setSpacing(20); - form_layout_->setContentsMargins(0, 0, 0, 40); - form_widget_->setLayout(form_layout_); + form_layout_ = new QVBoxLayout(); + form_layout_->setSpacing(20); + form_layout_->setContentsMargins(0, 0, 0, 40); + form_widget_->setLayout(form_layout_); - form_wrapper_->addStretch(1); - form_wrapper_->addWidget(form_widget_); - form_wrapper_->addStretch(1); + form_wrapper_->addStretch(1); + form_wrapper_->addWidget(form_widget_); + form_wrapper_->addStretch(1); - username_input_ = new TextField(); - username_input_->setTextColor("#333333"); - username_input_->setLabel(tr("Username")); - username_input_->setInkColor("#555459"); - username_input_->setBackgroundColor("#f9f9f9"); + username_input_ = new TextField(); + username_input_->setTextColor("#333333"); + username_input_->setLabel(tr("Username")); + username_input_->setInkColor("#555459"); + username_input_->setBackgroundColor("#f9f9f9"); - password_input_ = new TextField(); - password_input_->setTextColor("#333333"); - password_input_->setLabel(tr("Password")); - password_input_->setInkColor("#555459"); - password_input_->setBackgroundColor("#f9f9f9"); - password_input_->setEchoMode(QLineEdit::Password); + password_input_ = new TextField(); + password_input_->setTextColor("#333333"); + password_input_->setLabel(tr("Password")); + password_input_->setInkColor("#555459"); + password_input_->setBackgroundColor("#f9f9f9"); + password_input_->setEchoMode(QLineEdit::Password); - password_confirmation_ = new TextField(); - password_confirmation_->setTextColor("#333333"); - password_confirmation_->setLabel(tr("Password confirmation")); - password_confirmation_->setInkColor("#555459"); - password_confirmation_->setBackgroundColor("#f9f9f9"); - password_confirmation_->setEchoMode(QLineEdit::Password); + password_confirmation_ = new TextField(); + password_confirmation_->setTextColor("#333333"); + password_confirmation_->setLabel(tr("Password confirmation")); + password_confirmation_->setInkColor("#555459"); + password_confirmation_->setBackgroundColor("#f9f9f9"); + password_confirmation_->setEchoMode(QLineEdit::Password); - server_input_ = new TextField(); - server_input_->setTextColor("#333333"); - server_input_->setLabel(tr("Home Server")); - server_input_->setInkColor("#555459"); - server_input_->setBackgroundColor("#f9f9f9"); + server_input_ = new TextField(); + server_input_->setTextColor("#333333"); + server_input_->setLabel(tr("Home Server")); + server_input_->setInkColor("#555459"); + server_input_->setBackgroundColor("#f9f9f9"); - form_layout_->addWidget(username_input_, Qt::AlignHCenter, 0); - form_layout_->addWidget(password_input_, Qt::AlignHCenter, 0); - form_layout_->addWidget(password_confirmation_, Qt::AlignHCenter, 0); - form_layout_->addWidget(server_input_, Qt::AlignHCenter, 0); + form_layout_->addWidget(username_input_, Qt::AlignHCenter, 0); + form_layout_->addWidget(password_input_, Qt::AlignHCenter, 0); + form_layout_->addWidget(password_confirmation_, Qt::AlignHCenter, 0); + form_layout_->addWidget(server_input_, Qt::AlignHCenter, 0); - button_layout_ = new QHBoxLayout(); - button_layout_->setSpacing(0); - button_layout_->setMargin(0); + button_layout_ = new QHBoxLayout(); + button_layout_->setSpacing(0); + button_layout_->setMargin(0); - QFont font; - font.setPixelSize(conf::fontSize); + QFont font; + font.setPixelSize(conf::fontSize); - error_label_ = new QLabel(this); - error_label_->setFont(font); - error_label_->setStyleSheet("color: #E22826"); + error_label_ = new QLabel(this); + error_label_->setFont(font); + error_label_->setStyleSheet("color: #E22826"); - register_button_ = new RaisedButton(tr("REGISTER"), this); - register_button_->setBackgroundColor(QColor("#333333")); - register_button_->setForegroundColor(QColor("white")); - register_button_->setMinimumSize(350, 65); - register_button_->setFontSize(conf::btn::fontSize); - register_button_->setCornerRadius(conf::btn::cornerRadius); + register_button_ = new RaisedButton(tr("REGISTER"), this); + register_button_->setBackgroundColor(QColor("#333333")); + register_button_->setForegroundColor(QColor("white")); + register_button_->setMinimumSize(350, 65); + register_button_->setFontSize(conf::btn::fontSize); + register_button_->setCornerRadius(conf::btn::cornerRadius); - button_layout_->addStretch(1); - button_layout_->addWidget(register_button_); - button_layout_->addStretch(1); + button_layout_->addStretch(1); + button_layout_->addWidget(register_button_); + button_layout_->addStretch(1); - top_layout_->addLayout(back_layout_); - top_layout_->addLayout(logo_layout_); - top_layout_->addLayout(form_wrapper_); - top_layout_->addStretch(1); - top_layout_->addLayout(button_layout_); - top_layout_->addStretch(1); - top_layout_->addWidget(error_label_, 0, Qt::AlignHCenter); + top_layout_->addLayout(back_layout_); + top_layout_->addLayout(logo_layout_); + top_layout_->addLayout(form_wrapper_); + top_layout_->addStretch(1); + top_layout_->addLayout(button_layout_); + top_layout_->addStretch(1); + top_layout_->addWidget(error_label_, 0, Qt::AlignHCenter); - connect(back_button_, SIGNAL(clicked()), this, SLOT(onBackButtonClicked())); - connect(register_button_, SIGNAL(clicked()), this, SLOT(onRegisterButtonClicked())); + connect(back_button_, SIGNAL(clicked()), this, SLOT(onBackButtonClicked())); + connect(register_button_, SIGNAL(clicked()), this, SLOT(onRegisterButtonClicked())); - connect(username_input_, SIGNAL(returnPressed()), register_button_, SLOT(click())); - connect(password_input_, SIGNAL(returnPressed()), register_button_, SLOT(click())); - connect(password_confirmation_, SIGNAL(returnPressed()), register_button_, SLOT(click())); - connect(server_input_, SIGNAL(returnPressed()), register_button_, SLOT(click())); - connect(client_.data(), SIGNAL(registerError(const QString &)), this, SLOT(registerError(const QString &))); + connect(username_input_, SIGNAL(returnPressed()), register_button_, SLOT(click())); + connect(password_input_, SIGNAL(returnPressed()), register_button_, SLOT(click())); + connect(password_confirmation_, SIGNAL(returnPressed()), register_button_, SLOT(click())); + connect(server_input_, SIGNAL(returnPressed()), register_button_, SLOT(click())); + connect(client_.data(), + SIGNAL(registerError(const QString &)), + this, + SLOT(registerError(const QString &))); - username_input_->setValidator(&InputValidator::Localpart); - password_input_->setValidator(&InputValidator::Password); - server_input_->setValidator(&InputValidator::Domain); + username_input_->setValidator(&InputValidator::Localpart); + password_input_->setValidator(&InputValidator::Password); + server_input_->setValidator(&InputValidator::Domain); - setLayout(top_layout_); + setLayout(top_layout_); } void RegisterPage::onBackButtonClicked() { - emit backButtonClicked(); + emit backButtonClicked(); } void RegisterPage::registerError(const QString &msg) { - error_label_->setText(msg); + error_label_->setText(msg); } void RegisterPage::onRegisterButtonClicked() { - error_label_->setText(""); + error_label_->setText(""); - if (!username_input_->hasAcceptableInput()) { - registerError(tr("Invalid username")); - } else if (!password_input_->hasAcceptableInput()) { - registerError(tr("Password is not long enough (min 8 chars)")); - } else if (password_input_->text() != password_confirmation_->text()) { - registerError(tr("Passwords don't match")); - } else if (!server_input_->hasAcceptableInput()) { - registerError(tr("Invalid server name")); - } else { - QString username = username_input_->text(); - QString password = password_input_->text(); - QString server = server_input_->text(); + if (!username_input_->hasAcceptableInput()) { + registerError(tr("Invalid username")); + } else if (!password_input_->hasAcceptableInput()) { + registerError(tr("Password is not long enough (min 8 chars)")); + } else if (password_input_->text() != password_confirmation_->text()) { + registerError(tr("Passwords don't match")); + } else if (!server_input_->hasAcceptableInput()) { + registerError(tr("Invalid server name")); + } else { + QString username = username_input_->text(); + QString password = password_input_->text(); + QString server = server_input_->text(); - client_->registerUser(username, password, server); - } + client_->registerUser(username, password, server); + } } RegisterPage::~RegisterPage() diff --git a/src/RoomInfoListItem.cc b/src/RoomInfoListItem.cc index b4ea37f8..cd3f883a 100644 --- a/src/RoomInfoListItem.cc +++ b/src/RoomInfoListItem.cc @@ -26,9 +26,9 @@ #include "Theme.h" RoomInfoListItem::RoomInfoListItem(QSharedPointer settings, - RoomState state, - QString room_id, - QWidget *parent) + RoomState state, + QString room_id, + QWidget *parent) : QWidget(parent) , state_(state) , roomId_(room_id) @@ -37,264 +37,277 @@ RoomInfoListItem::RoomInfoListItem(QSharedPointer settings, , maxHeight_(IconSize + 2 * Padding) , unreadMsgCount_(0) { - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - setMouseTracking(true); - setAttribute(Qt::WA_Hover); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); + setMouseTracking(true); + setAttribute(Qt::WA_Hover); - setFixedHeight(maxHeight_); + setFixedHeight(maxHeight_); - QPainterPath path; - path.addRect(0, 0, parent->width(), height()); + QPainterPath path; + path.addRect(0, 0, parent->width(), height()); - ripple_overlay_ = new RippleOverlay(this); - ripple_overlay_->setClipPath(path); - ripple_overlay_->setClipping(true); + ripple_overlay_ = new RippleOverlay(this); + ripple_overlay_->setClipPath(path); + ripple_overlay_->setClipping(true); - menu_ = new Menu(this); + menu_ = new Menu(this); - toggleNotifications_ = new QAction(notificationText(), this); + toggleNotifications_ = new QAction(notificationText(), this); - connect(toggleNotifications_, &QAction::triggered, this, [=]() { roomSettings_->toggleNotifications(); }); + connect(toggleNotifications_, &QAction::triggered, this, [=]() { + roomSettings_->toggleNotifications(); + }); - menu_->addAction(toggleNotifications_); + menu_->addAction(toggleNotifications_); } QString RoomInfoListItem::notificationText() { - if (roomSettings_.isNull() || roomSettings_->isNotificationsEnabled()) - return QString(tr("Disable notifications")); + if (roomSettings_.isNull() || roomSettings_->isNotificationsEnabled()) + return QString(tr("Disable notifications")); - return tr("Enable notifications"); + return tr("Enable notifications"); } void RoomInfoListItem::resizeEvent(QResizeEvent *) { - // Update ripple's clipping path. - QPainterPath path; - path.addRect(0, 0, width(), height()); + // Update ripple's clipping path. + QPainterPath path; + path.addRect(0, 0, width(), height()); - ripple_overlay_->setClipPath(path); - ripple_overlay_->setClipping(true); + ripple_overlay_->setClipPath(path); + ripple_overlay_->setClipping(true); } void RoomInfoListItem::paintEvent(QPaintEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event); - QPainter p(this); - p.setRenderHint(QPainter::TextAntialiasing); - p.setRenderHint(QPainter::SmoothPixmapTransform); - p.setRenderHint(QPainter::Antialiasing); + QPainter p(this); + p.setRenderHint(QPainter::TextAntialiasing); + p.setRenderHint(QPainter::SmoothPixmapTransform); + p.setRenderHint(QPainter::Antialiasing); - if (isPressed_) - p.fillRect(rect(), QColor("#38A3D8")); - else if (underMouse()) - p.fillRect(rect(), QColor(200, 200, 200, 128)); - else - p.fillRect(rect(), QColor("#F8FBFE")); + if (isPressed_) + p.fillRect(rect(), QColor("#38A3D8")); + else if (underMouse()) + p.fillRect(rect(), QColor(200, 200, 200, 128)); + else + p.fillRect(rect(), QColor("#F8FBFE")); - QFont font; - font.setPixelSize(conf::fontSize); - QFontMetrics metrics(font); + QFont font; + font.setPixelSize(conf::fontSize); + QFontMetrics metrics(font); - p.setPen(QColor("#333")); + p.setPen(QColor("#333")); - QRect avatarRegion(Padding, Padding, IconSize, IconSize); + QRect avatarRegion(Padding, Padding, IconSize, IconSize); - // Description line with the default font. - int bottom_y = maxHeight_ - Padding - Padding / 3 - metrics.ascent() / 2; + // Description line with the default font. + int bottom_y = maxHeight_ - Padding - Padding / 3 - metrics.ascent() / 2; - if (width() > ui::sidebar::SmallSize) { - if (isPressed_) { - QPen pen(QColor("white")); - p.setPen(pen); - } + if (width() > ui::sidebar::SmallSize) { + if (isPressed_) { + QPen pen(QColor("white")); + p.setPen(pen); + } - font.setPixelSize(conf::roomlist::fonts::heading); - p.setFont(font); + font.setPixelSize(conf::roomlist::fonts::heading); + p.setFont(font); - // Name line. - QFontMetrics fontNameMetrics(font); - int top_y = 2 * Padding + fontNameMetrics.ascent() / 2; + // Name line. + QFontMetrics fontNameMetrics(font); + int top_y = 2 * Padding + fontNameMetrics.ascent() / 2; - auto name = - metrics.elidedText(state_.getName(), Qt::ElideRight, (width() - IconSize - 2 * Padding) * 0.8); - p.drawText(QPoint(2 * Padding + IconSize, top_y), name); + auto name = metrics.elidedText( + state_.getName(), Qt::ElideRight, (width() - IconSize - 2 * Padding) * 0.8); + p.drawText(QPoint(2 * Padding + IconSize, top_y), name); - if (!isPressed_) { - QPen pen(QColor("#5d6565")); - p.setPen(pen); - } + if (!isPressed_) { + QPen pen(QColor("#5d6565")); + p.setPen(pen); + } - font.setPixelSize(conf::fontSize); - p.setFont(font); + font.setPixelSize(conf::fontSize); + p.setFont(font); - auto msgStampWidth = QFontMetrics(font).width(lastMsgInfo_.timestamp) + 5; + auto msgStampWidth = QFontMetrics(font).width(lastMsgInfo_.timestamp) + 5; - // The limit is the space between the end of the avatar and the start of the timestamp. - int usernameLimit = std::max(0, width() - 3 * Padding - msgStampWidth - IconSize - 20); - auto userName = metrics.elidedText(lastMsgInfo_.username, Qt::ElideRight, usernameLimit); + // The limit is the space between the end of the avatar and the start of the + // timestamp. + int usernameLimit = + std::max(0, width() - 3 * Padding - msgStampWidth - IconSize - 20); + auto userName = + metrics.elidedText(lastMsgInfo_.username, Qt::ElideRight, usernameLimit); - font.setBold(true); - p.setFont(font); - p.drawText(QPoint(2 * Padding + IconSize, bottom_y), userName); + font.setBold(true); + p.setFont(font); + p.drawText(QPoint(2 * Padding + IconSize, bottom_y), userName); - int nameWidth = QFontMetrics(font).width(userName); + int nameWidth = QFontMetrics(font).width(userName); - font.setBold(false); - p.setFont(font); + font.setBold(false); + p.setFont(font); - // The limit is the space between the end of the username and the start of the timestamp. - int descriptionLimit = std::max(0, width() - 3 * Padding - msgStampWidth - IconSize - nameWidth - 5); - auto description = metrics.elidedText(lastMsgInfo_.body, Qt::ElideRight, descriptionLimit); - p.drawText(QPoint(2 * Padding + IconSize + nameWidth, bottom_y), description); + // The limit is the space between the end of the username and the start of the + // timestamp. + int descriptionLimit = + std::max(0, width() - 3 * Padding - msgStampWidth - IconSize - nameWidth - 5); + auto description = + metrics.elidedText(lastMsgInfo_.body, Qt::ElideRight, descriptionLimit); + p.drawText(QPoint(2 * Padding + IconSize + nameWidth, bottom_y), description); - // We either show the bubble or the last message timestamp. - if (unreadMsgCount_ == 0) { - font.setBold(true); - p.drawText(QPoint(width() - Padding - msgStampWidth, bottom_y), lastMsgInfo_.timestamp); - } - } + // We either show the bubble or the last message timestamp. + if (unreadMsgCount_ == 0) { + font.setBold(true); + p.drawText(QPoint(width() - Padding - msgStampWidth, bottom_y), + lastMsgInfo_.timestamp); + } + } - font.setBold(false); - p.setPen(Qt::NoPen); + font.setBold(false); + p.setPen(Qt::NoPen); - // We using the first letter of room's name. - if (roomAvatar_.isNull()) { - QBrush brush; - brush.setStyle(Qt::SolidPattern); - brush.setColor("#eee"); + // We using the first letter of room's name. + if (roomAvatar_.isNull()) { + QBrush brush; + brush.setStyle(Qt::SolidPattern); + brush.setColor("#eee"); - p.setPen(Qt::NoPen); - p.setBrush(brush); + p.setPen(Qt::NoPen); + p.setBrush(brush); - p.drawEllipse(avatarRegion.center(), IconSize / 2, IconSize / 2); + p.drawEllipse(avatarRegion.center(), IconSize / 2, IconSize / 2); - font.setPixelSize(conf::roomlist::fonts::bubble); - p.setFont(font); - p.setPen(QColor("#333")); - p.setBrush(Qt::NoBrush); - p.drawText(avatarRegion.translated(0, -1), Qt::AlignCenter, QChar(state_.getName()[0])); - } else { - p.save(); + font.setPixelSize(conf::roomlist::fonts::bubble); + p.setFont(font); + p.setPen(QColor("#333")); + p.setBrush(Qt::NoBrush); + p.drawText( + avatarRegion.translated(0, -1), Qt::AlignCenter, QChar(state_.getName()[0])); + } else { + p.save(); - QPainterPath path; - path.addEllipse(Padding, Padding, IconSize, IconSize); - p.setClipPath(path); + QPainterPath path; + path.addEllipse(Padding, Padding, IconSize, IconSize); + p.setClipPath(path); - p.drawPixmap(avatarRegion, roomAvatar_); - p.restore(); - } + p.drawPixmap(avatarRegion, roomAvatar_); + p.restore(); + } - if (unreadMsgCount_ > 0) { - QColor textColor("white"); - QColor backgroundColor("#38A3D8"); + if (unreadMsgCount_ > 0) { + QColor textColor("white"); + QColor backgroundColor("#38A3D8"); - QBrush brush; - brush.setStyle(Qt::SolidPattern); - brush.setColor(backgroundColor); + QBrush brush; + brush.setStyle(Qt::SolidPattern); + brush.setColor(backgroundColor); - if (isPressed_) - brush.setColor(textColor); + if (isPressed_) + brush.setColor(textColor); - QFont unreadCountFont; - unreadCountFont.setPixelSize(conf::roomlist::fonts::badge); - unreadCountFont.setBold(true); + QFont unreadCountFont; + unreadCountFont.setPixelSize(conf::roomlist::fonts::badge); + unreadCountFont.setBold(true); - p.setBrush(brush); - p.setPen(Qt::NoPen); - p.setFont(unreadCountFont); + p.setBrush(brush); + p.setPen(Qt::NoPen); + p.setFont(unreadCountFont); - int diameter = 20; + int diameter = 20; - QRectF r(width() - diameter - Padding, bottom_y - diameter / 2 - 5, diameter, diameter); + QRectF r( + width() - diameter - Padding, bottom_y - diameter / 2 - 5, diameter, diameter); - if (width() == ui::sidebar::SmallSize) - r = QRectF(width() - diameter - 5, height() - diameter - 5, diameter, diameter); + if (width() == ui::sidebar::SmallSize) + r = QRectF( + width() - diameter - 5, height() - diameter - 5, diameter, diameter); - p.setPen(Qt::NoPen); - p.drawEllipse(r); + p.setPen(Qt::NoPen); + p.drawEllipse(r); - p.setPen(QPen(textColor)); + p.setPen(QPen(textColor)); - if (isPressed_) - p.setPen(QPen(backgroundColor)); + if (isPressed_) + p.setPen(QPen(backgroundColor)); - p.setBrush(Qt::NoBrush); - p.drawText(r.translated(0, -0.5), Qt::AlignCenter, QString::number(unreadMsgCount_)); - } + p.setBrush(Qt::NoBrush); + p.drawText( + r.translated(0, -0.5), Qt::AlignCenter, QString::number(unreadMsgCount_)); + } } void RoomInfoListItem::updateUnreadMessageCount(int count) { - unreadMsgCount_ += count; - update(); + unreadMsgCount_ += count; + update(); } void RoomInfoListItem::clearUnreadMessageCount() { - unreadMsgCount_ = 0; - update(); + unreadMsgCount_ = 0; + update(); } void RoomInfoListItem::setPressedState(bool state) { - if (!isPressed_ && state) { - isPressed_ = state; - update(); - } else if (isPressed_ && !state) { - isPressed_ = state; - update(); - } + if (!isPressed_ && state) { + isPressed_ = state; + update(); + } else if (isPressed_ && !state) { + isPressed_ = state; + update(); + } } void RoomInfoListItem::setState(const RoomState &new_state) { - state_ = new_state; - update(); + state_ = new_state; + update(); } void RoomInfoListItem::contextMenuEvent(QContextMenuEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event); - toggleNotifications_->setText(notificationText()); - menu_->popup(event->globalPos()); + toggleNotifications_->setText(notificationText()); + menu_->popup(event->globalPos()); } void RoomInfoListItem::mousePressEvent(QMouseEvent *event) { - if (event->buttons() == Qt::RightButton) { - QWidget::mousePressEvent(event); - return; - } + if (event->buttons() == Qt::RightButton) { + QWidget::mousePressEvent(event); + return; + } - emit clicked(roomId_); + emit clicked(roomId_); - setPressedState(true); + setPressedState(true); - // Ripple on mouse position by default. - QPoint pos = event->pos(); - qreal radiusEndValue = static_cast(width()) / 3; + // Ripple on mouse position by default. + QPoint pos = event->pos(); + qreal radiusEndValue = static_cast(width()) / 3; - Ripple *ripple = new Ripple(pos); + Ripple *ripple = new Ripple(pos); - ripple->setRadiusEndValue(radiusEndValue); - ripple->setOpacityStartValue(0.15); - ripple->setColor(QColor("white")); - ripple->radiusAnimation()->setDuration(200); - ripple->opacityAnimation()->setDuration(400); + ripple->setRadiusEndValue(radiusEndValue); + ripple->setOpacityStartValue(0.15); + ripple->setColor(QColor("white")); + ripple->radiusAnimation()->setDuration(200); + ripple->opacityAnimation()->setDuration(400); - ripple_overlay_->addRipple(ripple); + ripple_overlay_->addRipple(ripple); } RoomInfoListItem::~RoomInfoListItem() diff --git a/src/RoomList.cc b/src/RoomList.cc index 3b14b5f1..9ef3646a 100644 --- a/src/RoomList.cc +++ b/src/RoomList.cc @@ -27,38 +27,38 @@ RoomList::RoomList(QSharedPointer client, QWidget *parent) : QWidget(parent) , client_(client) { - setStyleSheet("QWidget { border: none; }"); + setStyleSheet("QWidget { border: none; }"); - QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - sizePolicy.setHorizontalStretch(0); - sizePolicy.setVerticalStretch(0); - setSizePolicy(sizePolicy); + QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + setSizePolicy(sizePolicy); - topLayout_ = new QVBoxLayout(this); - topLayout_->setSpacing(0); - topLayout_->setMargin(0); + topLayout_ = new QVBoxLayout(this); + topLayout_->setSpacing(0); + topLayout_->setMargin(0); - scrollArea_ = new QScrollArea(this); - scrollArea_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - scrollArea_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - scrollArea_->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents); - scrollArea_->setWidgetResizable(true); - scrollArea_->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); + scrollArea_ = new QScrollArea(this); + scrollArea_->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + scrollArea_->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + scrollArea_->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents); + scrollArea_->setWidgetResizable(true); + scrollArea_->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); - scrollAreaContents_ = new QWidget(); + scrollAreaContents_ = new QWidget(); - contentsLayout_ = new QVBoxLayout(scrollAreaContents_); - contentsLayout_->setSpacing(0); - contentsLayout_->setMargin(0); - contentsLayout_->addStretch(1); + contentsLayout_ = new QVBoxLayout(scrollAreaContents_); + contentsLayout_->setSpacing(0); + contentsLayout_->setMargin(0); + contentsLayout_->addStretch(1); - scrollArea_->setWidget(scrollAreaContents_); - topLayout_->addWidget(scrollArea_); + scrollArea_->setWidget(scrollAreaContents_); + topLayout_->addWidget(scrollArea_); - connect(client_.data(), - SIGNAL(roomAvatarRetrieved(const QString &, const QPixmap &)), - this, - SLOT(updateRoomAvatar(const QString &, const QPixmap &))); + connect(client_.data(), + SIGNAL(roomAvatarRetrieved(const QString &, const QPixmap &)), + this, + SLOT(updateRoomAvatar(const QString &, const QPixmap &))); } RoomList::~RoomList() @@ -68,137 +68,140 @@ RoomList::~RoomList() void RoomList::clear() { - rooms_.clear(); + rooms_.clear(); } void RoomList::updateUnreadMessageCount(const QString &roomid, int count) { - if (!rooms_.contains(roomid)) { - qWarning() << "UpdateUnreadMessageCount: Unknown roomid"; - return; - } + if (!rooms_.contains(roomid)) { + qWarning() << "UpdateUnreadMessageCount: Unknown roomid"; + return; + } - rooms_[roomid]->updateUnreadMessageCount(count); + rooms_[roomid]->updateUnreadMessageCount(count); - calculateUnreadMessageCount(); + calculateUnreadMessageCount(); } void RoomList::calculateUnreadMessageCount() { - int total_unread_msgs = 0; + int total_unread_msgs = 0; - for (const auto &room : rooms_) - total_unread_msgs += room->unreadMessageCount(); + for (const auto &room : rooms_) + total_unread_msgs += room->unreadMessageCount(); - emit totalUnreadMessageCountUpdated(total_unread_msgs); + emit totalUnreadMessageCountUpdated(total_unread_msgs); } void RoomList::setInitialRooms(const QMap> &settings, - const QMap &states) + const QMap &states) { - rooms_.clear(); + rooms_.clear(); - if (settings.size() != states.size()) { - qWarning() << "Initializing room list"; - qWarning() << "Different number of room states and room settings"; - return; - } + if (settings.size() != states.size()) { + qWarning() << "Initializing room list"; + qWarning() << "Different number of room states and room settings"; + return; + } - for (auto it = states.constBegin(); it != states.constEnd(); it++) { - auto room_id = it.key(); - auto state = it.value(); + for (auto it = states.constBegin(); it != states.constEnd(); it++) { + auto room_id = it.key(); + auto state = it.value(); - if (!state.getAvatar().toString().isEmpty()) - client_->fetchRoomAvatar(room_id, state.getAvatar()); + if (!state.getAvatar().toString().isEmpty()) + client_->fetchRoomAvatar(room_id, state.getAvatar()); - RoomInfoListItem *room_item = new RoomInfoListItem(settings[room_id], state, room_id, scrollArea_); - connect(room_item, &RoomInfoListItem::clicked, this, &RoomList::highlightSelectedRoom); + RoomInfoListItem *room_item = + new RoomInfoListItem(settings[room_id], state, room_id, scrollArea_); + connect( + room_item, &RoomInfoListItem::clicked, this, &RoomList::highlightSelectedRoom); - rooms_.insert(room_id, QSharedPointer(room_item)); + rooms_.insert(room_id, QSharedPointer(room_item)); - int pos = contentsLayout_->count() - 1; - contentsLayout_->insertWidget(pos, room_item); - } + int pos = contentsLayout_->count() - 1; + contentsLayout_->insertWidget(pos, room_item); + } - if (rooms_.isEmpty()) - return; + if (rooms_.isEmpty()) + return; - auto first_room = rooms_.first(); - first_room->setPressedState(true); + auto first_room = rooms_.first(); + first_room->setPressedState(true); - emit roomChanged(rooms_.firstKey()); + emit roomChanged(rooms_.firstKey()); } void RoomList::sync(const QMap &states) { - for (auto it = states.constBegin(); it != states.constEnd(); it++) { - auto room_id = it.key(); - auto state = it.value(); + for (auto it = states.constBegin(); it != states.constEnd(); it++) { + auto room_id = it.key(); + auto state = it.value(); - // TODO: Add the new room to the list. - if (!rooms_.contains(room_id)) - continue; + // TODO: Add the new room to the list. + if (!rooms_.contains(room_id)) + continue; - auto room = rooms_[room_id]; + auto room = rooms_[room_id]; - auto current_avatar = room->state().getAvatar(); - auto new_avatar = state.getAvatar(); + auto current_avatar = room->state().getAvatar(); + auto new_avatar = state.getAvatar(); - if (current_avatar != new_avatar && !new_avatar.toString().isEmpty()) - client_->fetchRoomAvatar(room_id, new_avatar); + if (current_avatar != new_avatar && !new_avatar.toString().isEmpty()) + client_->fetchRoomAvatar(room_id, new_avatar); - room->setState(state); - } + room->setState(state); + } } void RoomList::highlightSelectedRoom(const QString &room_id) { - emit roomChanged(room_id); + emit roomChanged(room_id); - if (!rooms_.contains(room_id)) { - qDebug() << "RoomList: clicked unknown roomid"; - return; - } + if (!rooms_.contains(room_id)) { + qDebug() << "RoomList: clicked unknown roomid"; + return; + } - // TODO: Send a read receipt for the last event. - auto room = rooms_[room_id]; - room->clearUnreadMessageCount(); + // TODO: Send a read receipt for the last event. + auto room = rooms_[room_id]; + room->clearUnreadMessageCount(); - calculateUnreadMessageCount(); + calculateUnreadMessageCount(); - for (auto it = rooms_.constBegin(); it != rooms_.constEnd(); it++) { - if (it.key() != room_id) { - it.value()->setPressedState(false); - } else { - it.value()->setPressedState(true); - scrollArea_->ensureWidgetVisible(qobject_cast(it.value().data())); - } - } + for (auto it = rooms_.constBegin(); it != rooms_.constEnd(); it++) { + if (it.key() != room_id) { + it.value()->setPressedState(false); + } else { + it.value()->setPressedState(true); + scrollArea_->ensureWidgetVisible( + qobject_cast(it.value().data())); + } + } } void RoomList::updateRoomAvatar(const QString &roomid, const QPixmap &img) { - if (!rooms_.contains(roomid)) { - qWarning() << "Avatar update on non existent room" << roomid; - return; - } + if (!rooms_.contains(roomid)) { + qWarning() << "Avatar update on non existent room" << roomid; + return; + } - rooms_.value(roomid)->setAvatar(img.toImage()); + rooms_.value(roomid)->setAvatar(img.toImage()); } void RoomList::updateRoomDescription(const QString &roomid, const DescInfo &info) { - if (!rooms_.contains(roomid)) { - qWarning() << "Description update on non existent room" << roomid << info.body; - return; - } + if (!rooms_.contains(roomid)) { + qWarning() << "Description update on non existent room" << roomid << info.body; + return; + } - rooms_.value(roomid)->setDescriptionMessage(info); + rooms_.value(roomid)->setDescriptionMessage(info); } diff --git a/src/RoomMessages.cc b/src/RoomMessages.cc index 14155de9..8f6ba450 100644 --- a/src/RoomMessages.cc +++ b/src/RoomMessages.cc @@ -20,24 +20,24 @@ void RoomMessages::deserialize(const QJsonDocument &data) { - if (!data.isObject()) - throw DeserializationException("response is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("response is not a JSON object"); - QJsonObject object = data.object(); + QJsonObject object = data.object(); - if (!object.contains("start")) - throw DeserializationException("start key is missing"); + if (!object.contains("start")) + throw DeserializationException("start key is missing"); - if (!object.contains("end")) - throw DeserializationException("end key is missing"); + if (!object.contains("end")) + throw DeserializationException("end key is missing"); - if (!object.contains("chunk")) - throw DeserializationException("chunk key is missing"); + if (!object.contains("chunk")) + throw DeserializationException("chunk key is missing"); - if (!object.value("chunk").isArray()) - throw DeserializationException("chunk isn't a JSON array"); + if (!object.value("chunk").isArray()) + throw DeserializationException("chunk isn't a JSON array"); - start_ = object.value("start").toString(); - end_ = object.value("end").toString(); - chunk_ = object.value("chunk").toArray(); + start_ = object.value("start").toString(); + end_ = object.value("end").toString(); + chunk_ = object.value("chunk").toArray(); } diff --git a/src/SlidingStackWidget.cc b/src/SlidingStackWidget.cc index c3ae0635..fd76e993 100644 --- a/src/SlidingStackWidget.cc +++ b/src/SlidingStackWidget.cc @@ -20,19 +20,19 @@ SlidingStackWidget::SlidingStackWidget(QWidget *parent) : QStackedWidget(parent) { - window_ = parent; + window_ = parent; - if (parent == Q_NULLPTR) { - qDebug() << "Using nullptr for parent"; - window_ = this; - } + if (parent == Q_NULLPTR) { + qDebug() << "Using nullptr for parent"; + window_ = this; + } - current_position_ = QPoint(0, 0); - speed_ = 400; - now_ = 0; - next_ = 0; - active_ = false; - animation_type_ = QEasingCurve::InOutCirc; + current_position_ = QPoint(0, 0); + speed_ = 400; + now_ = 0; + next_ = 0; + active_ = false; + animation_type_ = QEasingCurve::InOutCirc; } SlidingStackWidget::~SlidingStackWidget() @@ -42,116 +42,116 @@ SlidingStackWidget::~SlidingStackWidget() void SlidingStackWidget::slideInNext() { - int now = currentIndex(); + int now = currentIndex(); - if (now < count() - 1) - slideInIndex(now + 1); + if (now < count() - 1) + slideInIndex(now + 1); } void SlidingStackWidget::slideInPrevious() { - int now = currentIndex(); + int now = currentIndex(); - if (now > 0) - slideInIndex(now - 1); + if (now > 0) + slideInIndex(now - 1); } void SlidingStackWidget::slideInIndex(int index, AnimationDirection direction) { - // Take into consideration possible index overflow/undeflow. - if (index > count() - 1) { - direction = AnimationDirection::RIGHT_TO_LEFT; - index = index % count(); - } else if (index < 0) { - direction = AnimationDirection::LEFT_TO_RIGHT; - index = (index + count()) % count(); - } + // Take into consideration possible index overflow/undeflow. + if (index > count() - 1) { + direction = AnimationDirection::RIGHT_TO_LEFT; + index = index % count(); + } else if (index < 0) { + direction = AnimationDirection::LEFT_TO_RIGHT; + index = (index + count()) % count(); + } - slideInWidget(widget(index), direction); + slideInWidget(widget(index), direction); } void SlidingStackWidget::slideInWidget(QWidget *next_widget, AnimationDirection direction) { - // If an animation is currenlty executing we should wait for it to finish before - // another transition can start. - if (active_) - return; + // If an animation is currenlty executing we should wait for it to finish before + // another transition can start. + if (active_) + return; - active_ = true; + active_ = true; - int now = currentIndex(); - int next = indexOf(next_widget); + int now = currentIndex(); + int next = indexOf(next_widget); - if (now == next) { - active_ = false; - return; - } + if (now == next) { + active_ = false; + return; + } - int offset_x = frameRect().width(); + int offset_x = frameRect().width(); - next_widget->setGeometry(0, 0, offset_x, 0); + next_widget->setGeometry(0, 0, offset_x, 0); - if (direction == AnimationDirection::LEFT_TO_RIGHT) { - offset_x = -offset_x; - } + if (direction == AnimationDirection::LEFT_TO_RIGHT) { + offset_x = -offset_x; + } - QPoint pnext = next_widget->pos(); - QPoint pnow = widget(now)->pos(); - current_position_ = pnow; + QPoint pnext = next_widget->pos(); + QPoint pnow = widget(now)->pos(); + current_position_ = pnow; - // Reposition the next widget outside of the display area. - next_widget->move(pnext.x() - offset_x, pnext.y()); + // Reposition the next widget outside of the display area. + next_widget->move(pnext.x() - offset_x, pnext.y()); - // Make the widget visible. - next_widget->show(); - next_widget->raise(); + // Make the widget visible. + next_widget->show(); + next_widget->raise(); - // Animate both the next and now widget. - QPropertyAnimation *animation_now = new QPropertyAnimation(widget(now), "pos", this); + // Animate both the next and now widget. + QPropertyAnimation *animation_now = new QPropertyAnimation(widget(now), "pos", this); - animation_now->setDuration(speed_); - animation_now->setEasingCurve(animation_type_); - animation_now->setStartValue(QPoint(pnow.x(), pnow.y())); - animation_now->setEndValue(QPoint(pnow.x() + offset_x, pnow.y())); + animation_now->setDuration(speed_); + animation_now->setEasingCurve(animation_type_); + animation_now->setStartValue(QPoint(pnow.x(), pnow.y())); + animation_now->setEndValue(QPoint(pnow.x() + offset_x, pnow.y())); - QPropertyAnimation *animation_next = new QPropertyAnimation(next_widget, "pos", this); + QPropertyAnimation *animation_next = new QPropertyAnimation(next_widget, "pos", this); - animation_next->setDuration(speed_); - animation_next->setEasingCurve(animation_type_); - animation_next->setStartValue(QPoint(pnext.x() - offset_x, pnext.y())); - animation_next->setEndValue(QPoint(pnext.x(), pnext.y())); + animation_next->setDuration(speed_); + animation_next->setEasingCurve(animation_type_); + animation_next->setStartValue(QPoint(pnext.x() - offset_x, pnext.y())); + animation_next->setEndValue(QPoint(pnext.x(), pnext.y())); - QParallelAnimationGroup *animation_group = new QParallelAnimationGroup(this); + QParallelAnimationGroup *animation_group = new QParallelAnimationGroup(this); - animation_group->addAnimation(animation_now); - animation_group->addAnimation(animation_next); + animation_group->addAnimation(animation_now); + animation_group->addAnimation(animation_next); - connect(animation_group, SIGNAL(finished()), this, SLOT(onAnimationFinished())); + connect(animation_group, SIGNAL(finished()), this, SLOT(onAnimationFinished())); - next_ = next; - now_ = now; - animation_group->start(); + next_ = next; + now_ = now; + animation_group->start(); } void SlidingStackWidget::onAnimationFinished() { - setCurrentIndex(next_); + setCurrentIndex(next_); - // The old widget is no longer necessary so we can hide it and - // move it back to its original position. - widget(now_)->hide(); - widget(now_)->move(current_position_); + // The old widget is no longer necessary so we can hide it and + // move it back to its original position. + widget(now_)->hide(); + widget(now_)->move(current_position_); - active_ = false; - emit animationFinished(); + active_ = false; + emit animationFinished(); } int SlidingStackWidget::getWidgetIndex(QWidget *widget) { - return indexOf(widget); + return indexOf(widget); } diff --git a/src/Splitter.cc b/src/Splitter.cc index 7e6d4d0a..230bbcc3 100644 --- a/src/Splitter.cc +++ b/src/Splitter.cc @@ -23,59 +23,59 @@ Splitter::Splitter(QWidget *parent) : QSplitter(parent) { - connect(this, &QSplitter::splitterMoved, this, &Splitter::onSplitterMoved); - setChildrenCollapsible(false); + connect(this, &QSplitter::splitterMoved, this, &Splitter::onSplitterMoved); + setChildrenCollapsible(false); } void Splitter::onSplitterMoved(int pos, int index) { - Q_UNUSED(pos); - Q_UNUSED(index); + Q_UNUSED(pos); + Q_UNUSED(index); - auto s = sizes(); + auto s = sizes(); - if (s.count() < 2) { - qWarning() << "Splitter needs at least two children"; - return; - } + if (s.count() < 2) { + qWarning() << "Splitter needs at least two children"; + return; + } - if (s[0] == ui::sidebar::NormalSize) { - rightMoveCount_ += 1; + if (s[0] == ui::sidebar::NormalSize) { + rightMoveCount_ += 1; - if (rightMoveCount_ > moveEventLimit_) { - auto left = widget(0); - auto pos = left->mapFromGlobal(QCursor::pos()); + if (rightMoveCount_ > moveEventLimit_) { + auto left = widget(0); + auto pos = left->mapFromGlobal(QCursor::pos()); - // if we are coming from the right, the cursor should - // end up on the first widget. - if (left->rect().contains(pos)) { - left->setMinimumWidth(ui::sidebar::SmallSize); - left->setMaximumWidth(ui::sidebar::SmallSize); + // if we are coming from the right, the cursor should + // end up on the first widget. + if (left->rect().contains(pos)) { + left->setMinimumWidth(ui::sidebar::SmallSize); + left->setMaximumWidth(ui::sidebar::SmallSize); - rightMoveCount_ = 0; - } - } - } else if (s[0] == ui::sidebar::SmallSize) { - leftMoveCount_ += 1; + rightMoveCount_ = 0; + } + } + } else if (s[0] == ui::sidebar::SmallSize) { + leftMoveCount_ += 1; - if (leftMoveCount_ > moveEventLimit_) { - auto left = widget(0); - auto right = widget(1); - auto pos = right->mapFromGlobal(QCursor::pos()); + if (leftMoveCount_ > moveEventLimit_) { + auto left = widget(0); + auto right = widget(1); + auto pos = right->mapFromGlobal(QCursor::pos()); - // We move the start a little further so the transition isn't so abrupt. - auto extended = right->rect(); - extended.translate(100, 0); + // We move the start a little further so the transition isn't so abrupt. + auto extended = right->rect(); + extended.translate(100, 0); - // if we are coming from the left, the cursor should - // end up on the second widget. - if (extended.contains(pos)) { - left->setMinimumWidth(ui::sidebar::NormalSize); - left->setMaximumWidth(2 * ui::sidebar::NormalSize); + // if we are coming from the left, the cursor should + // end up on the second widget. + if (extended.contains(pos)) { + left->setMinimumWidth(ui::sidebar::NormalSize); + left->setMaximumWidth(2 * ui::sidebar::NormalSize); - leftMoveCount_ = 0; - } - } - } + leftMoveCount_ = 0; + } + } + } } diff --git a/src/Sync.cc b/src/Sync.cc index 047350d0..de469ff8 100644 --- a/src/Sync.cc +++ b/src/Sync.cc @@ -27,166 +27,166 @@ void SyncResponse::deserialize(const QJsonDocument &data) { - if (!data.isObject()) - throw DeserializationException("Sync response is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("Sync response is not a JSON object"); - QJsonObject object = data.object(); + QJsonObject object = data.object(); - if (object.value("next_batch") == QJsonValue::Undefined) - throw DeserializationException("Sync: missing next_batch parameter"); + if (object.value("next_batch") == QJsonValue::Undefined) + throw DeserializationException("Sync: missing next_batch parameter"); - if (object.value("rooms") == QJsonValue::Undefined) - throw DeserializationException("Sync: missing rooms parameter"); + if (object.value("rooms") == QJsonValue::Undefined) + throw DeserializationException("Sync: missing rooms parameter"); - rooms_.deserialize(object.value("rooms")); - next_batch_ = object.value("next_batch").toString(); + rooms_.deserialize(object.value("rooms")); + next_batch_ = object.value("next_batch").toString(); } void Rooms::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("Rooms value is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("Rooms value is not a JSON object"); - QJsonObject object = data.toObject(); + QJsonObject object = data.toObject(); - if (!object.contains("join")) - throw DeserializationException("rooms/join is missing"); + if (!object.contains("join")) + throw DeserializationException("rooms/join is missing"); - if (!object.contains("invite")) - throw DeserializationException("rooms/invite is missing"); + if (!object.contains("invite")) + throw DeserializationException("rooms/invite is missing"); - if (!object.contains("leave")) - throw DeserializationException("rooms/leave is missing"); + if (!object.contains("leave")) + throw DeserializationException("rooms/leave is missing"); - if (!object.value("join").isObject()) - throw DeserializationException("rooms/join must be a JSON object"); + if (!object.value("join").isObject()) + throw DeserializationException("rooms/join must be a JSON object"); - if (!object.value("invite").isObject()) - throw DeserializationException("rooms/invite must be a JSON object"); + if (!object.value("invite").isObject()) + throw DeserializationException("rooms/invite must be a JSON object"); - if (!object.value("leave").isObject()) - throw DeserializationException("rooms/leave must be a JSON object"); + if (!object.value("leave").isObject()) + throw DeserializationException("rooms/leave must be a JSON object"); - auto join = object.value("join").toObject(); + auto join = object.value("join").toObject(); - for (auto it = join.constBegin(); it != join.constEnd(); it++) { - JoinedRoom tmp_room; + for (auto it = join.constBegin(); it != join.constEnd(); it++) { + JoinedRoom tmp_room; - try { - tmp_room.deserialize(it.value()); - join_.insert(it.key(), tmp_room); - } catch (DeserializationException &e) { - qWarning() << e.what(); - qWarning() << "Skipping malformed object for room" << it.key(); - } - } + try { + tmp_room.deserialize(it.value()); + join_.insert(it.key(), tmp_room); + } catch (DeserializationException &e) { + qWarning() << e.what(); + qWarning() << "Skipping malformed object for room" << it.key(); + } + } } void JoinedRoom::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("JoinedRoom is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("JoinedRoom is not a JSON object"); - QJsonObject object = data.toObject(); + QJsonObject object = data.toObject(); - if (!object.contains("state")) - throw DeserializationException("join/state is missing"); + if (!object.contains("state")) + throw DeserializationException("join/state is missing"); - if (!object.contains("timeline")) - throw DeserializationException("join/timeline is missing"); + if (!object.contains("timeline")) + throw DeserializationException("join/timeline is missing"); - if (!object.contains("account_data")) - throw DeserializationException("join/account_data is missing"); + if (!object.contains("account_data")) + throw DeserializationException("join/account_data is missing"); - if (!object.contains("unread_notifications")) - throw DeserializationException("join/unread_notifications is missing"); + if (!object.contains("unread_notifications")) + throw DeserializationException("join/unread_notifications is missing"); - if (!object.value("state").isObject()) - throw DeserializationException("join/state should be an object"); + if (!object.value("state").isObject()) + throw DeserializationException("join/state should be an object"); - QJsonObject state = object.value("state").toObject(); + QJsonObject state = object.value("state").toObject(); - if (!state.contains("events")) - throw DeserializationException("join/state/events is missing"); + if (!state.contains("events")) + throw DeserializationException("join/state/events is missing"); - state_.deserialize(state.value("events")); - timeline_.deserialize(object.value("timeline")); + state_.deserialize(state.value("events")); + timeline_.deserialize(object.value("timeline")); } void Event::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("Event is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("Event is not a JSON object"); - QJsonObject object = data.toObject(); + QJsonObject object = data.toObject(); - if (!object.contains("content")) - throw DeserializationException("event/content is missing"); + if (!object.contains("content")) + throw DeserializationException("event/content is missing"); - if (!object.contains("unsigned")) - throw DeserializationException("event/content is missing"); + if (!object.contains("unsigned")) + throw DeserializationException("event/content is missing"); - if (!object.contains("sender")) - throw DeserializationException("event/sender is missing"); + if (!object.contains("sender")) + throw DeserializationException("event/sender is missing"); - if (!object.contains("event_id")) - throw DeserializationException("event/event_id is missing"); + if (!object.contains("event_id")) + throw DeserializationException("event/event_id is missing"); - // TODO: Make this optional - /* if (!object.contains("state_key")) */ - /* throw DeserializationException("event/state_key is missing"); */ + // TODO: Make this optional + /* if (!object.contains("state_key")) */ + /* throw DeserializationException("event/state_key is missing"); */ - if (!object.contains("type")) - throw DeserializationException("event/type is missing"); + if (!object.contains("type")) + throw DeserializationException("event/type is missing"); - if (!object.contains("origin_server_ts")) - throw DeserializationException("event/origin_server_ts is missing"); + if (!object.contains("origin_server_ts")) + throw DeserializationException("event/origin_server_ts is missing"); - content_ = object.value("content").toObject(); - unsigned_ = object.value("unsigned").toObject(); + content_ = object.value("content").toObject(); + unsigned_ = object.value("unsigned").toObject(); - sender_ = object.value("sender").toString(); - state_key_ = object.value("state_key").toString(); - type_ = object.value("type").toString(); - event_id_ = object.value("event_id").toString(); + sender_ = object.value("sender").toString(); + state_key_ = object.value("state_key").toString(); + type_ = object.value("type").toString(); + event_id_ = object.value("event_id").toString(); - origin_server_ts_ = object.value("origin_server_ts").toDouble(); + origin_server_ts_ = object.value("origin_server_ts").toDouble(); } void State::deserialize(const QJsonValue &data) { - if (!data.isArray()) - throw DeserializationException("State is not a JSON array"); + if (!data.isArray()) + throw DeserializationException("State is not a JSON array"); - events_ = data.toArray(); + events_ = data.toArray(); } void Timeline::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("Timeline is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("Timeline is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (!object.contains("events")) - throw DeserializationException("timeline/events is missing"); + if (!object.contains("events")) + throw DeserializationException("timeline/events is missing"); - if (!object.contains("prev_batch")) - throw DeserializationException("timeline/prev_batch is missing"); + if (!object.contains("prev_batch")) + throw DeserializationException("timeline/prev_batch is missing"); - if (!object.contains("limited")) - throw DeserializationException("timeline/limited is missing"); + if (!object.contains("limited")) + throw DeserializationException("timeline/limited is missing"); - prev_batch_ = object.value("prev_batch").toString(); - limited_ = object.value("limited").toBool(); + prev_batch_ = object.value("prev_batch").toString(); + limited_ = object.value("limited").toBool(); - if (!object.value("events").isArray()) - throw DeserializationException("timeline/events is not a JSON array"); + if (!object.value("events").isArray()) + throw DeserializationException("timeline/events is not a JSON array"); - events_ = object.value("events").toArray(); + events_ = object.value("events").toArray(); } diff --git a/src/TrayIcon.cc b/src/TrayIcon.cc index 462b7f72..c2caa6e6 100644 --- a/src/TrayIcon.cc +++ b/src/TrayIcon.cc @@ -27,69 +27,75 @@ MsgCountComposedIcon::MsgCountComposedIcon(const QString &filename) : QIconEngine() { - icon_ = QIcon(filename); + icon_ = QIcon(filename); } void -MsgCountComposedIcon::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) +MsgCountComposedIcon::paint(QPainter *painter, + const QRect &rect, + QIcon::Mode mode, + QIcon::State state) { - painter->setRenderHint(QPainter::TextAntialiasing); - painter->setRenderHint(QPainter::SmoothPixmapTransform); - painter->setRenderHint(QPainter::Antialiasing); + painter->setRenderHint(QPainter::TextAntialiasing); + painter->setRenderHint(QPainter::SmoothPixmapTransform); + painter->setRenderHint(QPainter::Antialiasing); - icon_.paint(painter, rect, Qt::AlignCenter, mode, state); + icon_.paint(painter, rect, Qt::AlignCenter, mode, state); - if (msgCount <= 0) - return; + if (msgCount <= 0) + return; - QColor backgroundColor("red"); - QColor textColor("white"); + QColor backgroundColor("red"); + QColor textColor("white"); - QBrush brush; - brush.setStyle(Qt::SolidPattern); - brush.setColor(backgroundColor); + QBrush brush; + brush.setStyle(Qt::SolidPattern); + brush.setColor(backgroundColor); - painter->setBrush(brush); - painter->setPen(Qt::NoPen); - painter->setFont(QFont("Open Sans", 8, QFont::Black)); + painter->setBrush(brush); + painter->setPen(Qt::NoPen); + painter->setFont(QFont("Open Sans", 8, QFont::Black)); - QRectF bubble(rect.width() - BubbleDiameter, rect.height() - BubbleDiameter, BubbleDiameter, BubbleDiameter); - painter->drawEllipse(bubble); - painter->setPen(QPen(textColor)); - painter->setBrush(Qt::NoBrush); - painter->drawText(bubble, Qt::AlignCenter, QString::number(msgCount)); + QRectF bubble(rect.width() - BubbleDiameter, + rect.height() - BubbleDiameter, + BubbleDiameter, + BubbleDiameter); + painter->drawEllipse(bubble); + painter->setPen(QPen(textColor)); + painter->setBrush(Qt::NoBrush); + painter->drawText(bubble, Qt::AlignCenter, QString::number(msgCount)); } QIconEngine * MsgCountComposedIcon::clone() const { - return new MsgCountComposedIcon(*this); + return new MsgCountComposedIcon(*this); } TrayIcon::TrayIcon(const QString &filename, QWidget *parent) : QSystemTrayIcon(parent) { #if defined(Q_OS_MAC) || defined(Q_OS_WIN) - setIcon(QIcon(filename)); + setIcon(QIcon(filename)); #else - icon_ = new MsgCountComposedIcon(filename); - setIcon(QIcon(icon_)); + icon_ = new MsgCountComposedIcon(filename); + setIcon(QIcon(icon_)); #endif - QMenu *menu = new QMenu(parent); - viewAction_ = new QAction(tr("Show"), parent); - quitAction_ = new QAction(tr("Quit"), parent); + QMenu *menu = new QMenu(parent); + viewAction_ = new QAction(tr("Show"), parent); + quitAction_ = new QAction(tr("Quit"), parent); - connect(viewAction_, SIGNAL(triggered()), parent, SLOT(show())); - connect(quitAction_, &QAction::triggered, this, [=]() { QApplication::quit(); }); + connect(viewAction_, SIGNAL(triggered()), parent, SLOT(show())); + connect(quitAction_, &QAction::triggered, this, [=]() { QApplication::quit(); }); - menu->addAction(viewAction_); - menu->addAction(quitAction_); + menu->addAction(viewAction_); + menu->addAction(quitAction_); - setContextMenu(menu); + setContextMenu(menu); - // We wait a little for the icon to load. - QTimer::singleShot(500, this, [=]() { show(); }); + // We wait a little for the icon to load. + QTimer::singleShot(500, this, [=]() { show(); }); } void @@ -97,20 +103,20 @@ TrayIcon::setUnreadCount(int count) { // Use the native badge counter in MacOS. #if defined(Q_OS_MAC) - if (count == 0) - QtMac::setBadgeLabelText(""); - else - QtMac::setBadgeLabelText(QString::number(count)); + if (count == 0) + QtMac::setBadgeLabelText(""); + else + QtMac::setBadgeLabelText(QString::number(count)); #elif defined(Q_OS_WIN) // FIXME: Find a way to use Windows apis for the badge counter (if any). #else - // Custom drawing on Linux. - // FIXME: It doesn't seem to work on KDE. - MsgCountComposedIcon *tmp = static_cast(icon_->clone()); - tmp->msgCount = count; + // Custom drawing on Linux. + // FIXME: It doesn't seem to work on KDE. + MsgCountComposedIcon *tmp = static_cast(icon_->clone()); + tmp->msgCount = count; - setIcon(QIcon(tmp)); + setIcon(QIcon(tmp)); - icon_ = tmp; + icon_ = tmp; #endif } diff --git a/src/UserInfoWidget.cc b/src/UserInfoWidget.cc index edff2b55..fe5e2566 100644 --- a/src/UserInfoWidget.cc +++ b/src/UserInfoWidget.cc @@ -31,92 +31,95 @@ UserInfoWidget::UserInfoWidget(QWidget *parent) , logoutDialog_{ nullptr } , logoutButtonSize_{ 32 } { - QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); - setSizePolicy(sizePolicy); - setMinimumSize(QSize(0, 65)); + QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); + setSizePolicy(sizePolicy); + setMinimumSize(QSize(0, 65)); - topLayout_ = new QHBoxLayout(this); - topLayout_->setSpacing(0); - topLayout_->setMargin(5); + topLayout_ = new QHBoxLayout(this); + topLayout_->setSpacing(0); + topLayout_->setMargin(5); - avatarLayout_ = new QHBoxLayout(); - textLayout_ = new QVBoxLayout(); + avatarLayout_ = new QHBoxLayout(); + textLayout_ = new QVBoxLayout(); - userAvatar_ = new Avatar(this); - userAvatar_->setLetter(QChar('?')); - userAvatar_->setSize(55); - userAvatar_->setBackgroundColor("#f9f9f9"); - userAvatar_->setTextColor("#333333"); + userAvatar_ = new Avatar(this); + userAvatar_->setLetter(QChar('?')); + userAvatar_->setSize(55); + userAvatar_->setBackgroundColor("#f9f9f9"); + userAvatar_->setTextColor("#333333"); - QFont nameFont("Open Sans SemiBold"); - nameFont.setPixelSize(conf::userInfoWidget::fonts::displayName); + QFont nameFont("Open Sans SemiBold"); + nameFont.setPixelSize(conf::userInfoWidget::fonts::displayName); - displayNameLabel_ = new QLabel(this); - displayNameLabel_->setFont(nameFont); - displayNameLabel_->setStyleSheet("padding: 0 9px; color: #171919; margin-bottom: -10px;"); - displayNameLabel_->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignTop); + displayNameLabel_ = new QLabel(this); + displayNameLabel_->setFont(nameFont); + displayNameLabel_->setStyleSheet("padding: 0 9px; color: #171919; margin-bottom: -10px;"); + displayNameLabel_->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignTop); - QFont useridFont("Open Sans"); - useridFont.setPixelSize(conf::userInfoWidget::fonts::userid); + QFont useridFont("Open Sans"); + useridFont.setPixelSize(conf::userInfoWidget::fonts::userid); - userIdLabel_ = new QLabel(this); - userIdLabel_->setFont(useridFont); - userIdLabel_->setStyleSheet("padding: 0 8px 8px 8px; color: #555459;"); - userIdLabel_->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); + userIdLabel_ = new QLabel(this); + userIdLabel_->setFont(useridFont); + userIdLabel_->setStyleSheet("padding: 0 8px 8px 8px; color: #555459;"); + userIdLabel_->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); - avatarLayout_->addWidget(userAvatar_); - textLayout_->addWidget(displayNameLabel_); - textLayout_->addWidget(userIdLabel_); + avatarLayout_->addWidget(userAvatar_); + textLayout_->addWidget(displayNameLabel_); + textLayout_->addWidget(userIdLabel_); - topLayout_->addLayout(avatarLayout_); - topLayout_->addLayout(textLayout_); - topLayout_->addStretch(1); + topLayout_->addLayout(avatarLayout_); + topLayout_->addLayout(textLayout_); + topLayout_->addStretch(1); - buttonLayout_ = new QHBoxLayout(); - buttonLayout_->setSpacing(0); - buttonLayout_->setMargin(0); + buttonLayout_ = new QHBoxLayout(); + buttonLayout_->setSpacing(0); + buttonLayout_->setMargin(0); - logoutButton_ = new FlatButton(this); - logoutButton_->setForegroundColor(QColor("#555459")); - logoutButton_->setFixedSize(logoutButtonSize_, logoutButtonSize_); - logoutButton_->setCornerRadius(logoutButtonSize_ / 2); + logoutButton_ = new FlatButton(this); + logoutButton_->setForegroundColor(QColor("#555459")); + logoutButton_->setFixedSize(logoutButtonSize_, logoutButtonSize_); + logoutButton_->setCornerRadius(logoutButtonSize_ / 2); - QIcon icon; - icon.addFile(":/icons/icons/power-button-off.png", QSize(), QIcon::Normal, QIcon::Off); + QIcon icon; + icon.addFile(":/icons/icons/power-button-off.png", QSize(), QIcon::Normal, QIcon::Off); - logoutButton_->setIcon(icon); - logoutButton_->setIconSize(QSize(logoutButtonSize_ / 2, logoutButtonSize_ / 2)); + logoutButton_->setIcon(icon); + logoutButton_->setIconSize(QSize(logoutButtonSize_ / 2, logoutButtonSize_ / 2)); - buttonLayout_->addWidget(logoutButton_); + buttonLayout_->addWidget(logoutButton_); - topLayout_->addLayout(buttonLayout_); + topLayout_->addLayout(buttonLayout_); - // Show the confirmation dialog. - connect(logoutButton_, &QPushButton::clicked, this, [=]() { - if (logoutDialog_ == nullptr) { - logoutDialog_ = new LogoutDialog(this); - connect(logoutDialog_, SIGNAL(closing(bool)), this, SLOT(closeLogoutDialog(bool))); - } + // Show the confirmation dialog. + connect(logoutButton_, &QPushButton::clicked, this, [=]() { + if (logoutDialog_ == nullptr) { + logoutDialog_ = new LogoutDialog(this); + connect(logoutDialog_, + SIGNAL(closing(bool)), + this, + SLOT(closeLogoutDialog(bool))); + } - if (logoutModal_ == nullptr) { - logoutModal_ = new OverlayModal(MainWindow::instance(), logoutDialog_); - logoutModal_->setDuration(100); - logoutModal_->setColor(QColor(55, 55, 55, 170)); - } + if (logoutModal_ == nullptr) { + logoutModal_ = new OverlayModal(MainWindow::instance(), logoutDialog_); + logoutModal_->setDuration(100); + logoutModal_->setColor(QColor(55, 55, 55, 170)); + } - logoutModal_->fadeIn(); - }); + logoutModal_->fadeIn(); + }); } void UserInfoWidget::closeLogoutDialog(bool isLoggingOut) { - logoutModal_->fadeOut(); + logoutModal_->fadeOut(); - if (isLoggingOut) { - // Waiting for the modal to fade out. - QTimer::singleShot(100, this, [=]() { emit logout(); }); - } + if (isLoggingOut) { + // Waiting for the modal to fade out. + QTimer::singleShot(100, this, [=]() { emit logout(); }); + } } UserInfoWidget::~UserInfoWidget() @@ -126,52 +129,52 @@ UserInfoWidget::~UserInfoWidget() void UserInfoWidget::resizeEvent(QResizeEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event); - if (width() <= ui::sidebar::SmallSize) { - topLayout_->setContentsMargins(0, 0, logoutButtonSize_ / 2 - 5 / 2, 0); + if (width() <= ui::sidebar::SmallSize) { + topLayout_->setContentsMargins(0, 0, logoutButtonSize_ / 2 - 5 / 2, 0); - userAvatar_->hide(); - displayNameLabel_->hide(); - userIdLabel_->hide(); - } else { - topLayout_->setMargin(5); - userAvatar_->show(); - displayNameLabel_->show(); - userIdLabel_->show(); - } + userAvatar_->hide(); + displayNameLabel_->hide(); + userIdLabel_->hide(); + } else { + topLayout_->setMargin(5); + userAvatar_->show(); + displayNameLabel_->show(); + userIdLabel_->show(); + } } void UserInfoWidget::reset() { - displayNameLabel_->setText(""); - userIdLabel_->setText(""); - userAvatar_->setLetter(QChar('?')); + displayNameLabel_->setText(""); + userIdLabel_->setText(""); + userAvatar_->setLetter(QChar('?')); } void UserInfoWidget::setAvatar(const QImage &img) { - avatar_image_ = img; - userAvatar_->setImage(img); + avatar_image_ = img; + userAvatar_->setImage(img); } void UserInfoWidget::setDisplayName(const QString &name) { - if (name.isEmpty()) - display_name_ = user_id_.split(':')[0].split('@')[1]; - else - display_name_ = name; + if (name.isEmpty()) + display_name_ = user_id_.split(':')[0].split('@')[1]; + else + display_name_ = name; - displayNameLabel_->setText(display_name_); - userAvatar_->setLetter(QChar(display_name_[0])); + displayNameLabel_->setText(display_name_); + userAvatar_->setLetter(QChar(display_name_[0])); } void UserInfoWidget::setUserId(const QString &userid) { - user_id_ = userid; - userIdLabel_->setText(userid); + user_id_ = userid; + userIdLabel_->setText(userid); } diff --git a/src/Versions.cc b/src/Versions.cc index 10f3962d..8d0e2e9c 100644 --- a/src/Versions.cc +++ b/src/Versions.cc @@ -27,38 +27,39 @@ void VersionsResponse::deserialize(const QJsonDocument &data) { - if (!data.isObject()) - throw DeserializationException("Versions response is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("Versions response is not a JSON object"); - QJsonObject object = data.object(); + QJsonObject object = data.object(); - if (object.value("versions") == QJsonValue::Undefined) - throw DeserializationException("Versions: missing version list"); + if (object.value("versions") == QJsonValue::Undefined) + throw DeserializationException("Versions: missing version list"); - auto versions = object.value("versions").toArray(); - for (auto const &elem : versions) { - QString str = elem.toString(); - QRegExp rx("r(\\d+)\\.(\\d+)\\.(\\d+)"); + auto versions = object.value("versions").toArray(); + for (auto const &elem : versions) { + QString str = elem.toString(); + QRegExp rx("r(\\d+)\\.(\\d+)\\.(\\d+)"); - if (rx.indexIn(str) == -1) - throw DeserializationException("Invalid version string in versions response"); + if (rx.indexIn(str) == -1) + throw DeserializationException( + "Invalid version string in versions response"); - struct Version_ v; - v.major_ = rx.cap(1).toUInt(); - v.minor_ = rx.cap(2).toUInt(); - v.patch_ = rx.cap(3).toUInt(); + struct Version_ v; + v.major_ = rx.cap(1).toUInt(); + v.minor_ = rx.cap(2).toUInt(); + v.patch_ = rx.cap(3).toUInt(); - supported_versions_.push_back(v); - } + supported_versions_.push_back(v); + } } bool VersionsResponse::isVersionSupported(unsigned int major, unsigned int minor, unsigned int patch) { - for (auto &v : supported_versions_) { - if (v.major_ == major && v.minor_ == minor && v.patch_ >= patch) - return true; - } + for (auto &v : supported_versions_) { + if (v.major_ == major && v.minor_ == minor && v.patch_ >= patch) + return true; + } - return false; + return false; } diff --git a/src/WelcomePage.cc b/src/WelcomePage.cc index 04dc0f59..1673029f 100644 --- a/src/WelcomePage.cc +++ b/src/WelcomePage.cc @@ -24,78 +24,79 @@ WelcomePage::WelcomePage(QWidget *parent) : QWidget(parent) { - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - top_layout_ = new QVBoxLayout(this); - top_layout_->setSpacing(0); - top_layout_->setMargin(0); + top_layout_ = new QVBoxLayout(this); + top_layout_->setSpacing(0); + top_layout_->setMargin(0); - intro_banner_ = new QLabel(this); - intro_banner_->setPixmap(QPixmap(":/logos/nheko-256.png")); - intro_banner_->setAlignment(Qt::AlignCenter); + intro_banner_ = new QLabel(this); + intro_banner_->setPixmap(QPixmap(":/logos/nheko-256.png")); + intro_banner_->setAlignment(Qt::AlignCenter); - intro_text_ = new QLabel(this); + intro_text_ = new QLabel(this); - QString heading(tr("Welcome to nheko! The desktop client for the Matrix protocol.")); - QString main(tr("Enjoy your stay!")); + QString heading(tr("Welcome to nheko! The desktop client for the Matrix protocol.")); + QString main(tr("Enjoy your stay!")); - intro_text_->setText(QString("

" - " %1 " - "

" - "

" - " %2 " - "

") - .arg(heading) - .arg(main)); + intro_text_->setText(QString("

" + " %1 " + "

" + "

" + " %2 " + "

") + .arg(heading) + .arg(main)); - top_layout_->addStretch(1); - top_layout_->addWidget(intro_banner_); - top_layout_->addStretch(1); - top_layout_->addWidget(intro_text_, 0, Qt::AlignCenter); - top_layout_->addStretch(1); + top_layout_->addStretch(1); + top_layout_->addWidget(intro_banner_); + top_layout_->addStretch(1); + top_layout_->addWidget(intro_text_, 0, Qt::AlignCenter); + top_layout_->addStretch(1); - button_layout_ = new QHBoxLayout(); - button_layout_->setSpacing(0); - button_layout_->setContentsMargins(0, 20, 0, 80); + button_layout_ = new QHBoxLayout(); + button_layout_->setSpacing(0); + button_layout_->setContentsMargins(0, 20, 0, 80); - register_button_ = new RaisedButton(tr("REGISTER"), this); - register_button_->setBackgroundColor(QColor("#333333")); - register_button_->setForegroundColor(QColor("white")); - register_button_->setMinimumSize(240, 60); - register_button_->setFontSize(conf::btn::fontSize); - register_button_->setCornerRadius(conf::btn::cornerRadius); + register_button_ = new RaisedButton(tr("REGISTER"), this); + register_button_->setBackgroundColor(QColor("#333333")); + register_button_->setForegroundColor(QColor("white")); + register_button_->setMinimumSize(240, 60); + register_button_->setFontSize(conf::btn::fontSize); + register_button_->setCornerRadius(conf::btn::cornerRadius); - login_button_ = new RaisedButton(tr("LOGIN"), this); - login_button_->setBackgroundColor(QColor("#333333")); - login_button_->setForegroundColor(QColor("white")); - login_button_->setMinimumSize(240, 60); - login_button_->setFontSize(conf::btn::fontSize); - login_button_->setCornerRadius(conf::btn::cornerRadius); + login_button_ = new RaisedButton(tr("LOGIN"), this); + login_button_->setBackgroundColor(QColor("#333333")); + login_button_->setForegroundColor(QColor("white")); + login_button_->setMinimumSize(240, 60); + login_button_->setFontSize(conf::btn::fontSize); + login_button_->setCornerRadius(conf::btn::cornerRadius); - button_spacer_ = new QSpacerItem(20, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); + button_spacer_ = + new QSpacerItem(20, 20, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); - button_layout_->addStretch(1); - button_layout_->addWidget(register_button_); - button_layout_->addItem(button_spacer_); - button_layout_->addWidget(login_button_); - button_layout_->addStretch(1); + button_layout_->addStretch(1); + button_layout_->addWidget(register_button_); + button_layout_->addItem(button_spacer_); + button_layout_->addWidget(login_button_); + button_layout_->addStretch(1); - top_layout_->addLayout(button_layout_); + top_layout_->addLayout(button_layout_); - connect(register_button_, SIGNAL(clicked()), this, SLOT(onRegisterButtonClicked())); - connect(login_button_, SIGNAL(clicked()), this, SLOT(onLoginButtonClicked())); + connect(register_button_, SIGNAL(clicked()), this, SLOT(onRegisterButtonClicked())); + connect(login_button_, SIGNAL(clicked()), this, SLOT(onLoginButtonClicked())); } void WelcomePage::onLoginButtonClicked() { - emit userLogin(); + emit userLogin(); } void WelcomePage::onRegisterButtonClicked() { - emit userRegister(); + emit userRegister(); } WelcomePage::~WelcomePage() diff --git a/src/events/AliasesEventContent.cc b/src/events/AliasesEventContent.cc index da45e6e1..87acbade 100644 --- a/src/events/AliasesEventContent.cc +++ b/src/events/AliasesEventContent.cc @@ -24,32 +24,32 @@ using namespace matrix::events; void AliasesEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("AliasesEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("AliasesEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (object.value("aliases") == QJsonValue::Undefined) - throw DeserializationException("aliases key is missing"); + if (object.value("aliases") == QJsonValue::Undefined) + throw DeserializationException("aliases key is missing"); - auto aliases = object.value("aliases").toArray(); + auto aliases = object.value("aliases").toArray(); - for (const auto &alias : aliases) - aliases_.push_back(alias.toString()); + for (const auto &alias : aliases) + aliases_.push_back(alias.toString()); } QJsonObject AliasesEventContent::serialize() const { - QJsonObject object; + QJsonObject object; - QJsonArray aliases; + QJsonArray aliases; - for (const auto &alias : aliases_) - aliases.push_back(alias); + for (const auto &alias : aliases_) + aliases.push_back(alias); - if (aliases.size() > 0) - object["aliases"] = aliases; + if (aliases.size() > 0) + object["aliases"] = aliases; - return object; + return object; } diff --git a/src/events/AvatarEventContent.cc b/src/events/AvatarEventContent.cc index b38063c6..fc58ad5c 100644 --- a/src/events/AvatarEventContent.cc +++ b/src/events/AvatarEventContent.cc @@ -24,27 +24,27 @@ using namespace matrix::events; void AvatarEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("AvatarEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("AvatarEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (object.value("url") == QJsonValue::Undefined) - throw DeserializationException("url key is missing"); + if (object.value("url") == QJsonValue::Undefined) + throw DeserializationException("url key is missing"); - url_ = QUrl(object.value("url").toString()); + url_ = QUrl(object.value("url").toString()); - if (!url_.isValid()) - qWarning() << "Invalid avatar url" << url_; + if (!url_.isValid()) + qWarning() << "Invalid avatar url" << url_; } QJsonObject AvatarEventContent::serialize() const { - QJsonObject object; + QJsonObject object; - if (!url_.isEmpty()) - object["url"] = url_.toString(); + if (!url_.isEmpty()) + object["url"] = url_.toString(); - return object; + return object; } diff --git a/src/events/CanonicalAliasEventContent.cc b/src/events/CanonicalAliasEventContent.cc index d22319b3..189a0cb0 100644 --- a/src/events/CanonicalAliasEventContent.cc +++ b/src/events/CanonicalAliasEventContent.cc @@ -22,24 +22,24 @@ using namespace matrix::events; void CanonicalAliasEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("CanonicalAliasEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("CanonicalAliasEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (object.value("alias") == QJsonValue::Undefined) - throw DeserializationException("alias key is missing"); + if (object.value("alias") == QJsonValue::Undefined) + throw DeserializationException("alias key is missing"); - alias_ = object.value("alias").toString(); + alias_ = object.value("alias").toString(); } QJsonObject CanonicalAliasEventContent::serialize() const { - QJsonObject object; + QJsonObject object; - if (!alias_.isEmpty()) - object["alias"] = alias_; + if (!alias_.isEmpty()) + object["alias"] = alias_; - return object; + return object; } diff --git a/src/events/CreateEventContent.cc b/src/events/CreateEventContent.cc index 4c65ea4b..f28099c4 100644 --- a/src/events/CreateEventContent.cc +++ b/src/events/CreateEventContent.cc @@ -22,24 +22,24 @@ using namespace matrix::events; void CreateEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("CreateEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("CreateEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (object.value("creator") == QJsonValue::Undefined) - throw DeserializationException("creator key is missing"); + if (object.value("creator") == QJsonValue::Undefined) + throw DeserializationException("creator key is missing"); - creator_ = object.value("creator").toString(); + creator_ = object.value("creator").toString(); } QJsonObject CreateEventContent::serialize() const { - QJsonObject object; + QJsonObject object; - if (!creator_.isEmpty()) - object["creator"] = creator_; + if (!creator_.isEmpty()) + object["creator"] = creator_; - return object; + return object; } diff --git a/src/events/Event.cc b/src/events/Event.cc index 2cfffa47..1b03e1e6 100644 --- a/src/events/Event.cc +++ b/src/events/Event.cc @@ -32,49 +32,49 @@ matrix::events::EventType matrix::events::extractEventType(const QJsonObject &object) { - if (!object.contains("type")) - throw DeserializationException("Missing event type"); + if (!object.contains("type")) + throw DeserializationException("Missing event type"); - auto type = object.value("type").toString(); + auto type = object.value("type").toString(); - if (type == "m.room.aliases") - return EventType::RoomAliases; - else if (type == "m.room.avatar") - return EventType::RoomAvatar; - else if (type == "m.room.canonical_alias") - return EventType::RoomCanonicalAlias; - else if (type == "m.room.create") - return EventType::RoomCreate; - else if (type == "m.room.history_visibility") - return EventType::RoomHistoryVisibility; - else if (type == "m.room.join_rules") - return EventType::RoomJoinRules; - else if (type == "m.room.member") - return EventType::RoomMember; - else if (type == "m.room.message") - return EventType::RoomMessage; - else if (type == "m.room.name") - return EventType::RoomName; - else if (type == "m.room.power_levels") - return EventType::RoomPowerLevels; - else if (type == "m.room.topic") - return EventType::RoomTopic; - else - return EventType::Unsupported; + if (type == "m.room.aliases") + return EventType::RoomAliases; + else if (type == "m.room.avatar") + return EventType::RoomAvatar; + else if (type == "m.room.canonical_alias") + return EventType::RoomCanonicalAlias; + else if (type == "m.room.create") + return EventType::RoomCreate; + else if (type == "m.room.history_visibility") + return EventType::RoomHistoryVisibility; + else if (type == "m.room.join_rules") + return EventType::RoomJoinRules; + else if (type == "m.room.member") + return EventType::RoomMember; + else if (type == "m.room.message") + return EventType::RoomMessage; + else if (type == "m.room.name") + return EventType::RoomName; + else if (type == "m.room.power_levels") + return EventType::RoomPowerLevels; + else if (type == "m.room.topic") + return EventType::RoomTopic; + else + return EventType::Unsupported; } bool matrix::events::isStateEvent(EventType type) { - return type == EventType::RoomAliases || type == EventType::RoomAvatar || - type == EventType::RoomCanonicalAlias || type == EventType::RoomCreate || - type == EventType::RoomHistoryVisibility || type == EventType::RoomJoinRules || - type == EventType::RoomMember || type == EventType::RoomName || type == EventType::RoomPowerLevels || - type == EventType::RoomTopic; + return type == EventType::RoomAliases || type == EventType::RoomAvatar || + type == EventType::RoomCanonicalAlias || type == EventType::RoomCreate || + type == EventType::RoomHistoryVisibility || type == EventType::RoomJoinRules || + type == EventType::RoomMember || type == EventType::RoomName || + type == EventType::RoomPowerLevels || type == EventType::RoomTopic; } bool matrix::events::isMessageEvent(EventType type) { - return type == EventType::RoomMessage; + return type == EventType::RoomMessage; } diff --git a/src/events/HistoryVisibilityEventContent.cc b/src/events/HistoryVisibilityEventContent.cc index 794b16f4..7c0a149c 100644 --- a/src/events/HistoryVisibilityEventContent.cc +++ b/src/events/HistoryVisibilityEventContent.cc @@ -22,42 +22,43 @@ using namespace matrix::events; void HistoryVisibilityEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("HistoryVisibilityEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException( + "HistoryVisibilityEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (object.value("history_visibility") == QJsonValue::Undefined) - throw DeserializationException("history_visibility key is missing"); + if (object.value("history_visibility") == QJsonValue::Undefined) + throw DeserializationException("history_visibility key is missing"); - auto value = object.value("history_visibility").toString(); + auto value = object.value("history_visibility").toString(); - if (value == "invited") - history_visibility_ = HistoryVisibility::Invited; - else if (value == "joined") - history_visibility_ = HistoryVisibility::Joined; - else if (value == "shared") - history_visibility_ = HistoryVisibility::Shared; - else if (value == "world_readable") - history_visibility_ = HistoryVisibility::WorldReadable; - else - throw DeserializationException( - QString("Unknown history_visibility value: %1").arg(value).toUtf8().constData()); + if (value == "invited") + history_visibility_ = HistoryVisibility::Invited; + else if (value == "joined") + history_visibility_ = HistoryVisibility::Joined; + else if (value == "shared") + history_visibility_ = HistoryVisibility::Shared; + else if (value == "world_readable") + history_visibility_ = HistoryVisibility::WorldReadable; + else + throw DeserializationException( + QString("Unknown history_visibility value: %1").arg(value).toUtf8().constData()); } QJsonObject HistoryVisibilityEventContent::serialize() const { - QJsonObject object; + QJsonObject object; - if (history_visibility_ == HistoryVisibility::Invited) - object["history_visibility"] = "invited"; - else if (history_visibility_ == HistoryVisibility::Joined) - object["history_visibility"] = "joined"; - else if (history_visibility_ == HistoryVisibility::Shared) - object["history_visibility"] = "shared"; - else if (history_visibility_ == HistoryVisibility::WorldReadable) - object["history_visibility"] = "world_readable"; + if (history_visibility_ == HistoryVisibility::Invited) + object["history_visibility"] = "invited"; + else if (history_visibility_ == HistoryVisibility::Joined) + object["history_visibility"] = "joined"; + else if (history_visibility_ == HistoryVisibility::Shared) + object["history_visibility"] = "shared"; + else if (history_visibility_ == HistoryVisibility::WorldReadable) + object["history_visibility"] = "world_readable"; - return object; + return object; } diff --git a/src/events/JoinRulesEventContent.cc b/src/events/JoinRulesEventContent.cc index 0418966a..4f5cf6ee 100644 --- a/src/events/JoinRulesEventContent.cc +++ b/src/events/JoinRulesEventContent.cc @@ -22,41 +22,42 @@ using namespace matrix::events; void JoinRulesEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("JoinRulesEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("JoinRulesEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (object.value("join_rule") == QJsonValue::Undefined) - throw DeserializationException("join_rule key is missing"); + if (object.value("join_rule") == QJsonValue::Undefined) + throw DeserializationException("join_rule key is missing"); - auto value = object.value("join_rule").toString(); + auto value = object.value("join_rule").toString(); - if (value == "invite") - join_rule_ = JoinRule::Invite; - else if (value == "knock") - join_rule_ = JoinRule::Knock; - else if (value == "private") - join_rule_ = JoinRule::Private; - else if (value == "public") - join_rule_ = JoinRule::Public; - else - throw DeserializationException(QString("Unknown join_rule value: %1").arg(value).toUtf8().constData()); + if (value == "invite") + join_rule_ = JoinRule::Invite; + else if (value == "knock") + join_rule_ = JoinRule::Knock; + else if (value == "private") + join_rule_ = JoinRule::Private; + else if (value == "public") + join_rule_ = JoinRule::Public; + else + throw DeserializationException( + QString("Unknown join_rule value: %1").arg(value).toUtf8().constData()); } QJsonObject JoinRulesEventContent::serialize() const { - QJsonObject object; + QJsonObject object; - if (join_rule_ == JoinRule::Invite) - object["join_rule"] = "invite"; - else if (join_rule_ == JoinRule::Knock) - object["join_rule"] = "knock"; - else if (join_rule_ == JoinRule::Private) - object["join_rule"] = "private"; - else if (join_rule_ == JoinRule::Public) - object["join_rule"] = "public"; + if (join_rule_ == JoinRule::Invite) + object["join_rule"] = "invite"; + else if (join_rule_ == JoinRule::Knock) + object["join_rule"] = "knock"; + else if (join_rule_ == JoinRule::Private) + object["join_rule"] = "private"; + else if (join_rule_ == JoinRule::Public) + object["join_rule"] = "public"; - return object; + return object; } diff --git a/src/events/MemberEventContent.cc b/src/events/MemberEventContent.cc index d20ad1c0..f80130e6 100644 --- a/src/events/MemberEventContent.cc +++ b/src/events/MemberEventContent.cc @@ -24,60 +24,61 @@ using namespace matrix::events; void MemberEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("MemberEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("MemberEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (!object.contains("membership")) - throw DeserializationException("membership key is missing"); + if (!object.contains("membership")) + throw DeserializationException("membership key is missing"); - auto value = object.value("membership").toString(); + auto value = object.value("membership").toString(); - if (value == "ban") - membership_state_ = Membership::Ban; - else if (value == "invite") - membership_state_ = Membership::Invite; - else if (value == "join") - membership_state_ = Membership::Join; - else if (value == "knock") - membership_state_ = Membership::Knock; - else if (value == "leave") - membership_state_ = Membership::Leave; - else - throw DeserializationException(QString("Unknown membership value: %1").arg(value).toUtf8().constData()); + if (value == "ban") + membership_state_ = Membership::Ban; + else if (value == "invite") + membership_state_ = Membership::Invite; + else if (value == "join") + membership_state_ = Membership::Join; + else if (value == "knock") + membership_state_ = Membership::Knock; + else if (value == "leave") + membership_state_ = Membership::Leave; + else + throw DeserializationException( + QString("Unknown membership value: %1").arg(value).toUtf8().constData()); - if (object.contains("avatar_url")) - avatar_url_ = QUrl(object.value("avatar_url").toString()); + if (object.contains("avatar_url")) + avatar_url_ = QUrl(object.value("avatar_url").toString()); - if (!avatar_url_.toString().isEmpty() && !avatar_url_.isValid()) - qWarning() << "Invalid avatar url" << avatar_url_; + if (!avatar_url_.toString().isEmpty() && !avatar_url_.isValid()) + qWarning() << "Invalid avatar url" << avatar_url_; - if (object.contains("displayname")) - display_name_ = object.value("displayname").toString(); + if (object.contains("displayname")) + display_name_ = object.value("displayname").toString(); } QJsonObject MemberEventContent::serialize() const { - QJsonObject object; + QJsonObject object; - if (membership_state_ == Membership::Ban) - object["membership"] = "ban"; - else if (membership_state_ == Membership::Invite) - object["membership"] = "invite"; - else if (membership_state_ == Membership::Join) - object["membership"] = "join"; - else if (membership_state_ == Membership::Knock) - object["membership"] = "knock"; - else if (membership_state_ == Membership::Leave) - object["membership"] = "leave"; + if (membership_state_ == Membership::Ban) + object["membership"] = "ban"; + else if (membership_state_ == Membership::Invite) + object["membership"] = "invite"; + else if (membership_state_ == Membership::Join) + object["membership"] = "join"; + else if (membership_state_ == Membership::Knock) + object["membership"] = "knock"; + else if (membership_state_ == Membership::Leave) + object["membership"] = "leave"; - if (!avatar_url_.isEmpty()) - object["avatar_url"] = avatar_url_.toString(); + if (!avatar_url_.isEmpty()) + object["avatar_url"] = avatar_url_.toString(); - if (!display_name_.isEmpty()) - object["displayname"] = display_name_; + if (!display_name_.isEmpty()) + object["displayname"] = display_name_; - return object; + return object; } diff --git a/src/events/MessageEventContent.cc b/src/events/MessageEventContent.cc index 79fdd05d..fcf25da1 100644 --- a/src/events/MessageEventContent.cc +++ b/src/events/MessageEventContent.cc @@ -24,51 +24,51 @@ using namespace matrix::events; MessageEventType matrix::events::extractMessageEventType(const QJsonObject &data) { - if (!data.contains("content")) - return MessageEventType::Unknown; + if (!data.contains("content")) + return MessageEventType::Unknown; - auto content = data.value("content").toObject(); - auto msgtype = content.value("msgtype").toString(); + auto content = data.value("content").toObject(); + auto msgtype = content.value("msgtype").toString(); - if (msgtype == "m.audio") - return MessageEventType::Audio; - else if (msgtype == "m.emote") - return MessageEventType::Emote; - else if (msgtype == "m.file") - return MessageEventType::File; - else if (msgtype == "m.image") - return MessageEventType::Image; - else if (msgtype == "m.location") - return MessageEventType::Location; - else if (msgtype == "m.notice") - return MessageEventType::Notice; - else if (msgtype == "m.text") - return MessageEventType::Text; - else if (msgtype == "m.video") - return MessageEventType::Video; - else - return MessageEventType::Unknown; + if (msgtype == "m.audio") + return MessageEventType::Audio; + else if (msgtype == "m.emote") + return MessageEventType::Emote; + else if (msgtype == "m.file") + return MessageEventType::File; + else if (msgtype == "m.image") + return MessageEventType::Image; + else if (msgtype == "m.location") + return MessageEventType::Location; + else if (msgtype == "m.notice") + return MessageEventType::Notice; + else if (msgtype == "m.text") + return MessageEventType::Text; + else if (msgtype == "m.video") + return MessageEventType::Video; + else + return MessageEventType::Unknown; } void MessageEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("MessageEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("MessageEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (!object.contains("body")) - throw DeserializationException("body key is missing"); + if (!object.contains("body")) + throw DeserializationException("body key is missing"); - body_ = object.value("body").toString(); + body_ = object.value("body").toString(); } QJsonObject MessageEventContent::serialize() const { - // TODO: Add for all the message contents. - QJsonObject object; + // TODO: Add for all the message contents. + QJsonObject object; - return object; + return object; } diff --git a/src/events/NameEventContent.cc b/src/events/NameEventContent.cc index 55476172..45759cf2 100644 --- a/src/events/NameEventContent.cc +++ b/src/events/NameEventContent.cc @@ -22,24 +22,24 @@ using namespace matrix::events; void NameEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("NameEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("NameEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (object.value("name") == QJsonValue::Undefined) - throw DeserializationException("name key is missing"); + if (object.value("name") == QJsonValue::Undefined) + throw DeserializationException("name key is missing"); - name_ = object.value("name").toString(); + name_ = object.value("name").toString(); } QJsonObject NameEventContent::serialize() const { - QJsonObject object; + QJsonObject object; - if (!name_.isEmpty()) - object["name"] = name_; + if (!name_.isEmpty()) + object["name"] = name_; - return object; + return object; } diff --git a/src/events/PowerLevelsEventContent.cc b/src/events/PowerLevelsEventContent.cc index 4b9cb309..02a6ee71 100644 --- a/src/events/PowerLevelsEventContent.cc +++ b/src/events/PowerLevelsEventContent.cc @@ -25,90 +25,90 @@ using namespace matrix::events; void PowerLevelsEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("PowerLevelsEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("PowerLevelsEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (object.value("ban") != QJsonValue::Undefined) - ban_ = object.value("ban").toInt(); + if (object.value("ban") != QJsonValue::Undefined) + ban_ = object.value("ban").toInt(); - if (object.value("invite") != QJsonValue::Undefined) - invite_ = object.value("invite").toInt(); + if (object.value("invite") != QJsonValue::Undefined) + invite_ = object.value("invite").toInt(); - if (object.value("kick") != QJsonValue::Undefined) - kick_ = object.value("kick").toInt(); + if (object.value("kick") != QJsonValue::Undefined) + kick_ = object.value("kick").toInt(); - if (object.value("redact") != QJsonValue::Undefined) - redact_ = object.value("redact").toInt(); + if (object.value("redact") != QJsonValue::Undefined) + redact_ = object.value("redact").toInt(); - if (object.value("events_default") != QJsonValue::Undefined) - events_default_ = object.value("events_default").toInt(); + if (object.value("events_default") != QJsonValue::Undefined) + events_default_ = object.value("events_default").toInt(); - if (object.value("state_default") != QJsonValue::Undefined) - state_default_ = object.value("state_default").toInt(); + if (object.value("state_default") != QJsonValue::Undefined) + state_default_ = object.value("state_default").toInt(); - if (object.value("users_default") != QJsonValue::Undefined) - users_default_ = object.value("users_default").toInt(); + if (object.value("users_default") != QJsonValue::Undefined) + users_default_ = object.value("users_default").toInt(); - if (object.value("users").isObject()) { - auto users = object.value("users").toObject(); + if (object.value("users").isObject()) { + auto users = object.value("users").toObject(); - for (auto it = users.constBegin(); it != users.constEnd(); it++) - users_.insert(it.key(), it.value().toInt()); - } + for (auto it = users.constBegin(); it != users.constEnd(); it++) + users_.insert(it.key(), it.value().toInt()); + } - if (object.value("events").isObject()) { - auto events = object.value("events").toObject(); + if (object.value("events").isObject()) { + auto events = object.value("events").toObject(); - for (auto it = events.constBegin(); it != events.constEnd(); it++) - events_.insert(it.key(), it.value().toInt()); - } + for (auto it = events.constBegin(); it != events.constEnd(); it++) + events_.insert(it.key(), it.value().toInt()); + } } QJsonObject PowerLevelsEventContent::serialize() const { - QJsonObject object; + QJsonObject object; - object["ban"] = ban_; - object["invite"] = invite_; - object["kick"] = kick_; - object["redact"] = redact_; + object["ban"] = ban_; + object["invite"] = invite_; + object["kick"] = kick_; + object["redact"] = redact_; - object["events_default"] = events_default_; - object["users_default"] = users_default_; - object["state_default"] = state_default_; + object["events_default"] = events_default_; + object["users_default"] = users_default_; + object["state_default"] = state_default_; - QJsonObject users; - QJsonObject events; + QJsonObject users; + QJsonObject events; - for (auto it = users_.constBegin(); it != users_.constEnd(); it++) - users.insert(it.key(), it.value()); + for (auto it = users_.constBegin(); it != users_.constEnd(); it++) + users.insert(it.key(), it.value()); - for (auto it = events_.constBegin(); it != events_.constEnd(); it++) - events.insert(it.key(), it.value()); + for (auto it = events_.constBegin(); it != events_.constEnd(); it++) + events.insert(it.key(), it.value()); - object["users"] = users; - object["events"] = events; + object["users"] = users; + object["events"] = events; - return object; + return object; } int PowerLevelsEventContent::eventLevel(QString event_type) const { - if (events_.contains(event_type)) - return events_[event_type]; + if (events_.contains(event_type)) + return events_[event_type]; - return events_default_; + return events_default_; } int PowerLevelsEventContent::userLevel(QString userid) const { - if (users_.contains(userid)) - return users_[userid]; + if (users_.contains(userid)) + return users_[userid]; - return users_default_; + return users_default_; } diff --git a/src/events/TopicEventContent.cc b/src/events/TopicEventContent.cc index 4bb529a8..89602ded 100644 --- a/src/events/TopicEventContent.cc +++ b/src/events/TopicEventContent.cc @@ -22,24 +22,24 @@ using namespace matrix::events; void TopicEventContent::deserialize(const QJsonValue &data) { - if (!data.isObject()) - throw DeserializationException("TopicEventContent is not a JSON object"); + if (!data.isObject()) + throw DeserializationException("TopicEventContent is not a JSON object"); - auto object = data.toObject(); + auto object = data.toObject(); - if (object.value("topic") == QJsonValue::Undefined) - throw DeserializationException("topic key is missing"); + if (object.value("topic") == QJsonValue::Undefined) + throw DeserializationException("topic key is missing"); - topic_ = object.value("topic").toString(); + topic_ = object.value("topic").toString(); } QJsonObject TopicEventContent::serialize() const { - QJsonObject object; + QJsonObject object; - if (!topic_.isEmpty()) - object["topic"] = topic_; + if (!topic_.isEmpty()) + object["topic"] = topic_; - return object; + return object; } diff --git a/src/events/messages/Audio.cc b/src/events/messages/Audio.cc index 3df5aa81..6b8f8c7e 100644 --- a/src/events/messages/Audio.cc +++ b/src/events/messages/Audio.cc @@ -22,19 +22,19 @@ using namespace matrix::events::messages; void Audio::deserialize(const QJsonObject &object) { - if (!object.contains("url")) - throw DeserializationException("url key is missing"); + if (!object.contains("url")) + throw DeserializationException("url key is missing"); - url_ = object.value("url").toString(); + url_ = object.value("url").toString(); - if (object.value("msgtype") != "m.audio") - throw DeserializationException("invalid msgtype for audio"); + if (object.value("msgtype") != "m.audio") + throw DeserializationException("invalid msgtype for audio"); - if (object.contains("info")) { - auto info = object.value("info").toObject(); + if (object.contains("info")) { + auto info = object.value("info").toObject(); - info_.duration = info.value("duration").toInt(); - info_.mimetype = info.value("mimetype").toString(); - info_.size = info.value("size").toInt(); - } + info_.duration = info.value("duration").toInt(); + info_.mimetype = info.value("mimetype").toString(); + info_.size = info.value("size").toInt(); + } } diff --git a/src/events/messages/Emote.cc b/src/events/messages/Emote.cc index 3f09a7b7..2c9ab823 100644 --- a/src/events/messages/Emote.cc +++ b/src/events/messages/Emote.cc @@ -22,6 +22,6 @@ using namespace matrix::events::messages; void Emote::deserialize(const QJsonObject &object) { - if (object.value("msgtype") != "m.emote") - throw DeserializationException("invalid msgtype for emote"); + if (object.value("msgtype") != "m.emote") + throw DeserializationException("invalid msgtype for emote"); } diff --git a/src/events/messages/File.cc b/src/events/messages/File.cc index 20c772ca..9945f1f8 100644 --- a/src/events/messages/File.cc +++ b/src/events/messages/File.cc @@ -22,31 +22,31 @@ using namespace matrix::events::messages; void File::deserialize(const QJsonObject &object) { - if (!object.contains("url")) - throw DeserializationException("messages::File url key is missing"); + if (!object.contains("url")) + throw DeserializationException("messages::File url key is missing"); - if (!object.contains("filename")) - throw DeserializationException("messages::File filename key is missing"); + if (!object.contains("filename")) + throw DeserializationException("messages::File filename key is missing"); - if (object.value("msgtype") != "m.file") - throw DeserializationException("invalid msgtype for file"); + if (object.value("msgtype") != "m.file") + throw DeserializationException("invalid msgtype for file"); - url_ = object.value("url").toString(); + url_ = object.value("url").toString(); - if (object.contains("info")) { - auto file_info = object.value("info").toObject(); + if (object.contains("info")) { + auto file_info = object.value("info").toObject(); - info_.size = file_info.value("size").toInt(); - info_.mimetype = file_info.value("mimetype").toString(); - info_.thumbnail_url = file_info.value("thumbnail_url").toString(); + info_.size = file_info.value("size").toInt(); + info_.mimetype = file_info.value("mimetype").toString(); + info_.thumbnail_url = file_info.value("thumbnail_url").toString(); - if (file_info.contains("thumbnail_info")) { - auto thumbinfo = file_info.value("thumbnail_info").toObject(); + if (file_info.contains("thumbnail_info")) { + auto thumbinfo = file_info.value("thumbnail_info").toObject(); - info_.thumbnail_info.h = thumbinfo.value("h").toInt(); - info_.thumbnail_info.w = thumbinfo.value("w").toInt(); - info_.thumbnail_info.size = thumbinfo.value("size").toInt(); - info_.thumbnail_info.mimetype = thumbinfo.value("mimetype").toString(); - } - } + info_.thumbnail_info.h = thumbinfo.value("h").toInt(); + info_.thumbnail_info.w = thumbinfo.value("w").toInt(); + info_.thumbnail_info.size = thumbinfo.value("size").toInt(); + info_.thumbnail_info.mimetype = thumbinfo.value("mimetype").toString(); + } + } } diff --git a/src/events/messages/Image.cc b/src/events/messages/Image.cc index 6907b077..9d7c7a3b 100644 --- a/src/events/messages/Image.cc +++ b/src/events/messages/Image.cc @@ -22,31 +22,31 @@ using namespace matrix::events::messages; void Image::deserialize(const QJsonObject &object) { - if (!object.contains("url")) - throw DeserializationException("messages::Image url key is missing"); + if (!object.contains("url")) + throw DeserializationException("messages::Image url key is missing"); - url_ = object.value("url").toString(); + url_ = object.value("url").toString(); - if (object.value("msgtype") != "m.image") - throw DeserializationException("invalid msgtype for image"); + if (object.value("msgtype") != "m.image") + throw DeserializationException("invalid msgtype for image"); - if (object.contains("info")) { - auto imginfo = object.value("info").toObject(); + if (object.contains("info")) { + auto imginfo = object.value("info").toObject(); - info_.w = imginfo.value("w").toInt(); - info_.h = imginfo.value("h").toInt(); - info_.size = imginfo.value("size").toInt(); + info_.w = imginfo.value("w").toInt(); + info_.h = imginfo.value("h").toInt(); + info_.size = imginfo.value("size").toInt(); - info_.mimetype = imginfo.value("mimetype").toString(); - info_.thumbnail_url = imginfo.value("thumbnail_url").toString(); + info_.mimetype = imginfo.value("mimetype").toString(); + info_.thumbnail_url = imginfo.value("thumbnail_url").toString(); - if (imginfo.contains("thumbnail_info")) { - auto thumbinfo = imginfo.value("thumbnail_info").toObject(); + if (imginfo.contains("thumbnail_info")) { + auto thumbinfo = imginfo.value("thumbnail_info").toObject(); - info_.thumbnail_info.h = thumbinfo.value("h").toInt(); - info_.thumbnail_info.w = thumbinfo.value("w").toInt(); - info_.thumbnail_info.size = thumbinfo.value("size").toInt(); - info_.thumbnail_info.mimetype = thumbinfo.value("mimetype").toString(); - } - } + info_.thumbnail_info.h = thumbinfo.value("h").toInt(); + info_.thumbnail_info.w = thumbinfo.value("w").toInt(); + info_.thumbnail_info.size = thumbinfo.value("size").toInt(); + info_.thumbnail_info.mimetype = thumbinfo.value("mimetype").toString(); + } + } } diff --git a/src/events/messages/Location.cc b/src/events/messages/Location.cc index 2963631b..ea2b333a 100644 --- a/src/events/messages/Location.cc +++ b/src/events/messages/Location.cc @@ -22,26 +22,26 @@ using namespace matrix::events::messages; void Location::deserialize(const QJsonObject &object) { - if (!object.contains("geo_uri")) - throw DeserializationException("messages::Location geo_uri key is missing"); + if (!object.contains("geo_uri")) + throw DeserializationException("messages::Location geo_uri key is missing"); - if (object.value("msgtype") != "m.location") - throw DeserializationException("invalid msgtype for location"); + if (object.value("msgtype") != "m.location") + throw DeserializationException("invalid msgtype for location"); - geo_uri_ = object.value("geo_uri").toString(); + geo_uri_ = object.value("geo_uri").toString(); - if (object.contains("info")) { - auto location_info = object.value("info").toObject(); + if (object.contains("info")) { + auto location_info = object.value("info").toObject(); - info_.thumbnail_url = location_info.value("thumbnail_url").toString(); + info_.thumbnail_url = location_info.value("thumbnail_url").toString(); - if (location_info.contains("thumbnail_info")) { - auto thumbinfo = location_info.value("thumbnail_info").toObject(); + if (location_info.contains("thumbnail_info")) { + auto thumbinfo = location_info.value("thumbnail_info").toObject(); - info_.thumbnail_info.h = thumbinfo.value("h").toInt(); - info_.thumbnail_info.w = thumbinfo.value("w").toInt(); - info_.thumbnail_info.size = thumbinfo.value("size").toInt(); - info_.thumbnail_info.mimetype = thumbinfo.value("mimetype").toString(); - } - } + info_.thumbnail_info.h = thumbinfo.value("h").toInt(); + info_.thumbnail_info.w = thumbinfo.value("w").toInt(); + info_.thumbnail_info.size = thumbinfo.value("size").toInt(); + info_.thumbnail_info.mimetype = thumbinfo.value("mimetype").toString(); + } + } } diff --git a/src/events/messages/Notice.cc b/src/events/messages/Notice.cc index 648c9544..5b809c77 100644 --- a/src/events/messages/Notice.cc +++ b/src/events/messages/Notice.cc @@ -22,6 +22,6 @@ using namespace matrix::events::messages; void Notice::deserialize(const QJsonObject &object) { - if (object.value("msgtype") != "m.notice") - throw DeserializationException("invalid msgtype for notice"); + if (object.value("msgtype") != "m.notice") + throw DeserializationException("invalid msgtype for notice"); } diff --git a/src/events/messages/Text.cc b/src/events/messages/Text.cc index 6324988c..6797ec01 100644 --- a/src/events/messages/Text.cc +++ b/src/events/messages/Text.cc @@ -22,6 +22,6 @@ using namespace matrix::events::messages; void Text::deserialize(const QJsonObject &object) { - if (object.value("msgtype") != "m.text") - throw DeserializationException("invalid msgtype for text"); + if (object.value("msgtype") != "m.text") + throw DeserializationException("invalid msgtype for text"); } diff --git a/src/events/messages/Video.cc b/src/events/messages/Video.cc index 4b4d2d3b..89f90304 100644 --- a/src/events/messages/Video.cc +++ b/src/events/messages/Video.cc @@ -22,32 +22,32 @@ using namespace matrix::events::messages; void Video::deserialize(const QJsonObject &object) { - if (!object.contains("url")) - throw DeserializationException("messages::Video url key is missing"); + if (!object.contains("url")) + throw DeserializationException("messages::Video url key is missing"); - url_ = object.value("url").toString(); + url_ = object.value("url").toString(); - if (object.value("msgtype") != "m.video") - throw DeserializationException("invalid msgtype for video"); + if (object.value("msgtype") != "m.video") + throw DeserializationException("invalid msgtype for video"); - if (object.contains("info")) { - auto video_info = object.value("info").toObject(); + if (object.contains("info")) { + auto video_info = object.value("info").toObject(); - info_.w = video_info.value("w").toInt(); - info_.h = video_info.value("h").toInt(); - info_.size = video_info.value("size").toInt(); - info_.duration = video_info.value("duration").toInt(); + info_.w = video_info.value("w").toInt(); + info_.h = video_info.value("h").toInt(); + info_.size = video_info.value("size").toInt(); + info_.duration = video_info.value("duration").toInt(); - info_.mimetype = video_info.value("mimetype").toString(); - info_.thumbnail_url = video_info.value("thumbnail_url").toString(); + info_.mimetype = video_info.value("mimetype").toString(); + info_.thumbnail_url = video_info.value("thumbnail_url").toString(); - if (video_info.contains("thumbnail_info")) { - auto thumbinfo = video_info.value("thumbnail_info").toObject(); + if (video_info.contains("thumbnail_info")) { + auto thumbinfo = video_info.value("thumbnail_info").toObject(); - info_.thumbnail_info.h = thumbinfo.value("h").toInt(); - info_.thumbnail_info.w = thumbinfo.value("w").toInt(); - info_.thumbnail_info.size = thumbinfo.value("size").toInt(); - info_.thumbnail_info.mimetype = thumbinfo.value("mimetype").toString(); - } - } + info_.thumbnail_info.h = thumbinfo.value("h").toInt(); + info_.thumbnail_info.w = thumbinfo.value("w").toInt(); + info_.thumbnail_info.size = thumbinfo.value("size").toInt(); + info_.thumbnail_info.mimetype = thumbinfo.value("mimetype").toString(); + } + } } diff --git a/src/main.cc b/src/main.cc index fcdf27b2..25bf7819 100644 --- a/src/main.cc +++ b/src/main.cc @@ -26,52 +26,52 @@ int main(int argc, char *argv[]) { - QCoreApplication::setApplicationName("nheko"); - QCoreApplication::setApplicationVersion("Ωμέγa"); - QCoreApplication::setOrganizationName("Nheko"); - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setApplicationName("nheko"); + QCoreApplication::setApplicationVersion("Ωμέγa"); + QCoreApplication::setOrganizationName("Nheko"); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QApplication app(argc, argv); + QApplication app(argc, argv); - QFontDatabase::addApplicationFont(":/fonts/fonts/OpenSans/OpenSans-Regular.ttf"); - QFontDatabase::addApplicationFont(":/fonts/fonts/OpenSans/OpenSans-Italic.ttf"); - QFontDatabase::addApplicationFont(":/fonts/fonts/OpenSans/OpenSans-Bold.ttf"); - QFontDatabase::addApplicationFont(":/fonts/fonts/OpenSans/OpenSans-Semibold.ttf"); - QFontDatabase::addApplicationFont(":/fonts/fonts/EmojiOne/emojione-android.ttf"); + QFontDatabase::addApplicationFont(":/fonts/fonts/OpenSans/OpenSans-Regular.ttf"); + QFontDatabase::addApplicationFont(":/fonts/fonts/OpenSans/OpenSans-Italic.ttf"); + QFontDatabase::addApplicationFont(":/fonts/fonts/OpenSans/OpenSans-Bold.ttf"); + QFontDatabase::addApplicationFont(":/fonts/fonts/OpenSans/OpenSans-Semibold.ttf"); + QFontDatabase::addApplicationFont(":/fonts/fonts/EmojiOne/emojione-android.ttf"); - app.setWindowIcon(QIcon(":/logos/nheko.png")); + app.setWindowIcon(QIcon(":/logos/nheko.png")); - QSettings settings; + QSettings settings; - // Set the default if a value has not been set. - if (settings.value("font/size").toInt() == 0) - settings.setValue("font/size", 12); + // Set the default if a value has not been set. + if (settings.value("font/size").toInt() == 0) + settings.setValue("font/size", 12); - QFont font("Open Sans", settings.value("font/size").toInt()); - app.setFont(font); + QFont font("Open Sans", settings.value("font/size").toInt()); + app.setFont(font); - QString lang = QLocale::system().name(); + QString lang = QLocale::system().name(); - QTranslator qtTranslator; - qtTranslator.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - app.installTranslator(&qtTranslator); + QTranslator qtTranslator; + qtTranslator.load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + app.installTranslator(&qtTranslator); - QTranslator appTranslator; - appTranslator.load("nheko_" + lang, ":/translations"); - app.installTranslator(&appTranslator); + QTranslator appTranslator; + appTranslator.load("nheko_" + lang, ":/translations"); + app.installTranslator(&appTranslator); - MainWindow w; + MainWindow w; - // Move the MainWindow to the center - QRect screenGeometry = QApplication::desktop()->screenGeometry(); - int x = (screenGeometry.width() - w.width()) / 2; - int y = (screenGeometry.height() - w.height()) / 2; + // Move the MainWindow to the center + QRect screenGeometry = QApplication::desktop()->screenGeometry(); + int x = (screenGeometry.width() - w.width()) / 2; + int y = (screenGeometry.height() - w.height()) / 2; - w.move(x, y); - w.show(); + w.move(x, y); + w.show(); - QObject::connect(&app, &QApplication::aboutToQuit, &w, &MainWindow::saveCurrentWindowSize); + QObject::connect(&app, &QApplication::aboutToQuit, &w, &MainWindow::saveCurrentWindowSize); - return app.exec(); + return app.exec(); } diff --git a/src/ui/Avatar.cc b/src/ui/Avatar.cc index 878f7999..c8068366 100644 --- a/src/ui/Avatar.cc +++ b/src/ui/Avatar.cc @@ -7,16 +7,16 @@ Avatar::Avatar(QWidget *parent) : QWidget(parent) { - size_ = ui::AvatarSize; - type_ = ui::AvatarType::Letter; - letter_ = QChar('A'); + size_ = ui::AvatarSize; + type_ = ui::AvatarType::Letter; + letter_ = QChar('A'); - QFont _font(font()); - _font.setPointSizeF(ui::FontSize); - setFont(_font); + QFont _font(font()); + _font.setPointSizeF(ui::FontSize); + setFont(_font); - QSizePolicy policy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - setSizePolicy(policy); + QSizePolicy policy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + setSizePolicy(policy); } Avatar::~Avatar() @@ -26,128 +26,130 @@ Avatar::~Avatar() QColor Avatar::textColor() const { - if (!text_color_.isValid()) - return QColor("black"); + if (!text_color_.isValid()) + return QColor("black"); - return text_color_; + return text_color_; } QColor Avatar::backgroundColor() const { - if (!text_color_.isValid()) - return QColor("white"); + if (!text_color_.isValid()) + return QColor("white"); - return background_color_; + return background_color_; } int Avatar::size() const { - return size_; + return size_; } QSize Avatar::sizeHint() const { - return QSize(size_ + 2, size_ + 2); + return QSize(size_ + 2, size_ + 2); } void Avatar::setTextColor(const QColor &color) { - text_color_ = color; + text_color_ = color; } void Avatar::setBackgroundColor(const QColor &color) { - background_color_ = color; + background_color_ = color; } void Avatar::setSize(int size) { - size_ = size; + size_ = size; - if (!image_.isNull()) { - pixmap_ = - QPixmap::fromImage(image_.scaled(size_, size_, Qt::KeepAspectRatio, Qt::SmoothTransformation)); - } + if (!image_.isNull()) { + pixmap_ = QPixmap::fromImage( + image_.scaled(size_, size_, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + } - QFont _font(font()); - _font.setPointSizeF(size_ * (ui::FontSize) / 40); + QFont _font(font()); + _font.setPointSizeF(size_ * (ui::FontSize) / 40); - setFont(_font); - update(); + setFont(_font); + update(); } void Avatar::setLetter(const QChar &letter) { - letter_ = letter; - type_ = ui::AvatarType::Letter; - update(); + letter_ = letter; + type_ = ui::AvatarType::Letter; + update(); } void Avatar::setImage(const QImage &image) { - image_ = image; - type_ = ui::AvatarType::Image; - pixmap_ = QPixmap::fromImage(image_.scaled(size_, size_, Qt::KeepAspectRatio, Qt::SmoothTransformation)); - update(); + image_ = image; + type_ = ui::AvatarType::Image; + pixmap_ = QPixmap::fromImage( + image_.scaled(size_, size_, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + update(); } void Avatar::setIcon(const QIcon &icon) { - icon_ = icon; - type_ = ui::AvatarType::Icon; - update(); + icon_ = icon; + type_ = ui::AvatarType::Icon; + update(); } void Avatar::paintEvent(QPaintEvent *) { - QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); - QRect r = rect(); - const int hs = size_ / 2; + QRect r = rect(); + const int hs = size_ / 2; - if (type_ != ui::AvatarType::Image) { - QBrush brush; - brush.setStyle(Qt::SolidPattern); - brush.setColor(backgroundColor()); + if (type_ != ui::AvatarType::Image) { + QBrush brush; + brush.setStyle(Qt::SolidPattern); + brush.setColor(backgroundColor()); - painter.setPen(Qt::NoPen); - painter.setBrush(brush); - painter.drawEllipse(r.center(), hs, hs); - } + painter.setPen(Qt::NoPen); + painter.setBrush(brush); + painter.drawEllipse(r.center(), hs, hs); + } - switch (type_) { - case ui::AvatarType::Icon: { - icon_.paint(&painter, - QRect((width() - hs) / 2, (height() - hs) / 2, hs, hs), - Qt::AlignCenter, - QIcon::Normal); - break; - } - case ui::AvatarType::Image: { - QPainterPath ppath; - ppath.addEllipse(width() / 2 - hs, height() / 2 - hs, size_, size_); - painter.setClipPath(ppath); - painter.drawPixmap(QRect(width() / 2 - hs, height() / 2 - hs, size_, size_), pixmap_); - break; - } - case ui::AvatarType::Letter: { - painter.setPen(textColor()); - painter.setBrush(Qt::NoBrush); - painter.drawText(r.translated(0, -1), Qt::AlignCenter, letter_); - break; - } - default: - break; - } + switch (type_) { + case ui::AvatarType::Icon: { + icon_.paint(&painter, + QRect((width() - hs) / 2, (height() - hs) / 2, hs, hs), + Qt::AlignCenter, + QIcon::Normal); + break; + } + case ui::AvatarType::Image: { + QPainterPath ppath; + ppath.addEllipse(width() / 2 - hs, height() / 2 - hs, size_, size_); + painter.setClipPath(ppath); + painter.drawPixmap(QRect(width() / 2 - hs, height() / 2 - hs, size_, size_), + pixmap_); + break; + } + case ui::AvatarType::Letter: { + painter.setPen(textColor()); + painter.setBrush(Qt::NoBrush); + painter.drawText(r.translated(0, -1), Qt::AlignCenter, letter_); + break; + } + default: + break; + } } diff --git a/src/ui/Badge.cc b/src/ui/Badge.cc index b4a04343..ab34be0f 100644 --- a/src/ui/Badge.cc +++ b/src/ui/Badge.cc @@ -5,21 +5,21 @@ Badge::Badge(QWidget *parent) : OverlayWidget(parent) { - init(); + init(); } Badge::Badge(const QIcon &icon, QWidget *parent) : OverlayWidget(parent) { - init(); - setIcon(icon); + init(); + setIcon(icon); } Badge::Badge(const QString &text, QWidget *parent) : OverlayWidget(parent) { - init(); - setText(text); + init(); + setText(text); } Badge::~Badge() @@ -29,195 +29,195 @@ Badge::~Badge() void Badge::init() { - x_ = 0; - y_ = 0; - // TODO: Make padding configurable. - padding_ = 5; - diameter_ = 24; + x_ = 0; + y_ = 0; + // TODO: Make padding configurable. + padding_ = 5; + diameter_ = 24; - setAttribute(Qt::WA_TransparentForMouseEvents); + setAttribute(Qt::WA_TransparentForMouseEvents); - QFont _font(font()); - _font.setPointSizeF(7.5); - _font.setStyleName("Bold"); + QFont _font(font()); + _font.setPointSizeF(7.5); + _font.setStyleName("Bold"); - setFont(_font); - setText(""); + setFont(_font); + setText(""); } QString Badge::text() const { - return text_; + return text_; } QIcon Badge::icon() const { - return icon_; + return icon_; } QSize Badge::sizeHint() const { - const int d = diameter(); - return QSize(d + 4, d + 4); + const int d = diameter(); + return QSize(d + 4, d + 4); } qreal Badge::relativeYPosition() const { - return y_; + return y_; } qreal Badge::relativeXPosition() const { - return x_; + return x_; } QPointF Badge::relativePosition() const { - return QPointF(x_, y_); + return QPointF(x_, y_); } QColor Badge::backgroundColor() const { - if (!background_color_.isValid()) - return QColor("black"); + if (!background_color_.isValid()) + return QColor("black"); - return background_color_; + return background_color_; } QColor Badge::textColor() const { - if (!text_color_.isValid()) - return QColor("white"); + if (!text_color_.isValid()) + return QColor("white"); - return text_color_; + return text_color_; } void Badge::setTextColor(const QColor &color) { - text_color_ = color; + text_color_ = color; } void Badge::setBackgroundColor(const QColor &color) { - background_color_ = color; + background_color_ = color; } void Badge::setRelativePosition(const QPointF &pos) { - setRelativePosition(pos.x(), pos.y()); + setRelativePosition(pos.x(), pos.y()); } void Badge::setRelativePosition(qreal x, qreal y) { - x_ = x; - y_ = y; - update(); + x_ = x; + y_ = y; + update(); } void Badge::setRelativeXPosition(qreal x) { - x_ = x; - update(); + x_ = x; + update(); } void Badge::setRelativeYPosition(qreal y) { - y_ = y; - update(); + y_ = y; + update(); } void Badge::setIcon(const QIcon &icon) { - icon_ = icon; - update(); + icon_ = icon; + update(); } void Badge::setText(const QString &text) { - text_ = text; + text_ = text; - if (!icon_.isNull()) - icon_ = QIcon(); + if (!icon_.isNull()) + icon_ = QIcon(); - size_ = fontMetrics().size(Qt::TextShowMnemonic, text); + size_ = fontMetrics().size(Qt::TextShowMnemonic, text); - update(); + update(); } void Badge::setDiameter(int diameter) { - if (diameter > 0) { - diameter_ = diameter; - update(); - } + if (diameter > 0) { + diameter_ = diameter; + update(); + } } void Badge::paintEvent(QPaintEvent *) { - QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing); - painter.translate(x_, y_); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + painter.translate(x_, y_); - QBrush brush; - brush.setStyle(Qt::SolidPattern); - brush.setColor(isEnabled() ? backgroundColor() : QColor("#cccccc")); + QBrush brush; + brush.setStyle(Qt::SolidPattern); + brush.setColor(isEnabled() ? backgroundColor() : QColor("#cccccc")); - painter.setBrush(brush); - painter.setPen(Qt::NoPen); + painter.setBrush(brush); + painter.setPen(Qt::NoPen); - const int d = diameter(); + const int d = diameter(); - QRectF r(0, 0, d, d); - r.translate(QPointF((width() - d), (height() - d)) / 2); + QRectF r(0, 0, d, d); + r.translate(QPointF((width() - d), (height() - d)) / 2); - if (icon_.isNull()) { - QPen pen; - // TODO: Make badge width configurable. - pen.setWidth(1); - pen.setColor(textColor()); + if (icon_.isNull()) { + QPen pen; + // TODO: Make badge width configurable. + pen.setWidth(1); + pen.setColor(textColor()); - painter.setPen(pen); - painter.drawEllipse(r); + painter.setPen(pen); + painter.drawEllipse(r); - painter.setPen(textColor()); - painter.setBrush(Qt::NoBrush); - painter.drawText(r.translated(0, -0.5), Qt::AlignCenter, text_); - } else { - painter.drawEllipse(r); - QRectF q(0, 0, 16, 16); - q.moveCenter(r.center()); - QPixmap pixmap = icon().pixmap(16, 16); - QPainter icon(&pixmap); - icon.setCompositionMode(QPainter::CompositionMode_SourceIn); - icon.fillRect(pixmap.rect(), textColor()); - painter.drawPixmap(q.toRect(), pixmap); - } + painter.setPen(textColor()); + painter.setBrush(Qt::NoBrush); + painter.drawText(r.translated(0, -0.5), Qt::AlignCenter, text_); + } else { + painter.drawEllipse(r); + QRectF q(0, 0, 16, 16); + q.moveCenter(r.center()); + QPixmap pixmap = icon().pixmap(16, 16); + QPainter icon(&pixmap); + icon.setCompositionMode(QPainter::CompositionMode_SourceIn); + icon.fillRect(pixmap.rect(), textColor()); + painter.drawPixmap(q.toRect(), pixmap); + } } int Badge::diameter() const { - if (icon_.isNull()) { - return qMax(size_.width(), size_.height()) + padding_; - } + if (icon_.isNull()) { + return qMax(size_.width(), size_.height()) + padding_; + } - return diameter_; + return diameter_; } diff --git a/src/ui/CircularProgress.cc b/src/ui/CircularProgress.cc index 425ece13..ca0b99a8 100644 --- a/src/ui/CircularProgress.cc +++ b/src/ui/CircularProgress.cc @@ -13,173 +13,173 @@ CircularProgress::CircularProgress(QWidget *parent) , size_{ 64 } , duration_{ 3050 } { - delegate_ = new CircularProgressDelegate(this); + delegate_ = new CircularProgressDelegate(this); - setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); + setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - auto group = new QParallelAnimationGroup(this); - group->setLoopCount(-1); + auto group = new QParallelAnimationGroup(this); + group->setLoopCount(-1); - auto length_animation = new QPropertyAnimation(this); - length_animation->setPropertyName("dashLength"); - length_animation->setTargetObject(delegate_); - length_animation->setEasingCurve(QEasingCurve::InOutQuad); - length_animation->setStartValue(0.1); - length_animation->setKeyValueAt(0.15, 3); - length_animation->setKeyValueAt(0.6, 20); - length_animation->setKeyValueAt(0.7, 20); - length_animation->setEndValue(20); - length_animation->setDuration(duration_); + auto length_animation = new QPropertyAnimation(this); + length_animation->setPropertyName("dashLength"); + length_animation->setTargetObject(delegate_); + length_animation->setEasingCurve(QEasingCurve::InOutQuad); + length_animation->setStartValue(0.1); + length_animation->setKeyValueAt(0.15, 3); + length_animation->setKeyValueAt(0.6, 20); + length_animation->setKeyValueAt(0.7, 20); + length_animation->setEndValue(20); + length_animation->setDuration(duration_); - auto offset_animation = new QPropertyAnimation(this); - offset_animation->setPropertyName("dashOffset"); - offset_animation->setTargetObject(delegate_); - offset_animation->setEasingCurve(QEasingCurve::InOutSine); - offset_animation->setStartValue(0); - offset_animation->setKeyValueAt(0.15, 0); - offset_animation->setKeyValueAt(0.6, -7); - offset_animation->setKeyValueAt(0.7, -7); - offset_animation->setEndValue(-25); - offset_animation->setDuration(duration_); + auto offset_animation = new QPropertyAnimation(this); + offset_animation->setPropertyName("dashOffset"); + offset_animation->setTargetObject(delegate_); + offset_animation->setEasingCurve(QEasingCurve::InOutSine); + offset_animation->setStartValue(0); + offset_animation->setKeyValueAt(0.15, 0); + offset_animation->setKeyValueAt(0.6, -7); + offset_animation->setKeyValueAt(0.7, -7); + offset_animation->setEndValue(-25); + offset_animation->setDuration(duration_); - auto angle_animation = new QPropertyAnimation(this); - angle_animation->setPropertyName("angle"); - angle_animation->setTargetObject(delegate_); - angle_animation->setStartValue(0); - angle_animation->setEndValue(360); - angle_animation->setDuration(duration_); + auto angle_animation = new QPropertyAnimation(this); + angle_animation->setPropertyName("angle"); + angle_animation->setTargetObject(delegate_); + angle_animation->setStartValue(0); + angle_animation->setEndValue(360); + angle_animation->setDuration(duration_); - group->addAnimation(length_animation); - group->addAnimation(offset_animation); - group->addAnimation(angle_animation); + group->addAnimation(length_animation); + group->addAnimation(offset_animation); + group->addAnimation(angle_animation); - group->start(); + group->start(); } void CircularProgress::setProgressType(ui::ProgressType type) { - progress_type_ = type; - update(); + progress_type_ = type; + update(); } void CircularProgress::setLineWidth(qreal width) { - width_ = width; - update(); - updateGeometry(); + width_ = width; + update(); + updateGeometry(); } void CircularProgress::setSize(int size) { - size_ = size; - update(); - updateGeometry(); + size_ = size; + update(); + updateGeometry(); } ui::ProgressType CircularProgress::progressType() const { - return progress_type_; + return progress_type_; } qreal CircularProgress::lineWidth() const { - return width_; + return width_; } int CircularProgress::size() const { - return size_; + return size_; } void CircularProgress::setColor(const QColor &color) { - color_ = color; + color_ = color; } QColor CircularProgress::color() const { - if (!color_.isValid()) { - return QColor("red"); - } + if (!color_.isValid()) { + return QColor("red"); + } - return color_; + return color_; } QSize CircularProgress::sizeHint() const { - const qreal s = size_ + width_ + 8; - return QSize(s, s); + const qreal s = size_ + width_ + 8; + return QSize(s, s); } void CircularProgress::paintEvent(QPaintEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event); - QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); - /* - * If the progress bar is disabled draw an X instead - */ - if (!isEnabled()) { - QPen pen; - pen.setCapStyle(Qt::RoundCap); - pen.setWidthF(lineWidth()); - pen.setColor("gray"); + /* + * If the progress bar is disabled draw an X instead + */ + if (!isEnabled()) { + QPen pen; + pen.setCapStyle(Qt::RoundCap); + pen.setWidthF(lineWidth()); + pen.setColor("gray"); - auto center = rect().center(); + auto center = rect().center(); - painter.setPen(pen); - painter.drawLine(center - QPointF(20, 20), center + QPointF(20, 20)); - painter.drawLine(center + QPointF(20, -20), center - QPointF(20, -20)); + painter.setPen(pen); + painter.drawLine(center - QPointF(20, 20), center + QPointF(20, 20)); + painter.drawLine(center + QPointF(20, -20), center - QPointF(20, -20)); - return; - } + return; + } - if (progress_type_ == ui::ProgressType::IndeterminateProgress) { - painter.translate(width() / 2, height() / 2); - painter.rotate(delegate_->angle()); - } + if (progress_type_ == ui::ProgressType::IndeterminateProgress) { + painter.translate(width() / 2, height() / 2); + painter.rotate(delegate_->angle()); + } - QPen pen; - pen.setCapStyle(Qt::RoundCap); - pen.setWidthF(width_); - pen.setColor(color()); + QPen pen; + pen.setCapStyle(Qt::RoundCap); + pen.setWidthF(width_); + pen.setColor(color()); - if (ui::ProgressType::IndeterminateProgress == progress_type_) { - QVector pattern; - pattern << delegate_->dashLength() * size_ / 50 << 30 * size_ / 50; + if (ui::ProgressType::IndeterminateProgress == progress_type_) { + QVector pattern; + pattern << delegate_->dashLength() * size_ / 50 << 30 * size_ / 50; - pen.setDashOffset(delegate_->dashOffset() * size_ / 50); - pen.setDashPattern(pattern); + pen.setDashOffset(delegate_->dashOffset() * size_ / 50); + pen.setDashPattern(pattern); - painter.setPen(pen); + painter.setPen(pen); - painter.drawEllipse(QPoint(0, 0), size_ / 2, size_ / 2); - } else { - painter.setPen(pen); + painter.drawEllipse(QPoint(0, 0), size_ / 2, size_ / 2); + } else { + painter.setPen(pen); - const qreal x = (width() - size_) / 2; - const qreal y = (height() - size_) / 2; + const qreal x = (width() - size_) / 2; + const qreal y = (height() - size_) / 2; - const qreal a = 360 * (value() - minimum()) / (maximum() - minimum()); + const qreal a = 360 * (value() - minimum()) / (maximum() - minimum()); - QPainterPath path; - path.arcMoveTo(x, y, size_, size_, 0); - path.arcTo(x, y, size_, size_, 0, a); + QPainterPath path; + path.arcMoveTo(x, y, size_, size_, 0); + path.arcTo(x, y, size_, size_, 0, a); - painter.drawPath(path); - } + painter.drawPath(path); + } } CircularProgress::~CircularProgress() @@ -193,7 +193,7 @@ CircularProgressDelegate::CircularProgressDelegate(CircularProgress *parent) , dash_length_(89) , angle_(0) { - Q_ASSERT(parent); + Q_ASSERT(parent); } CircularProgressDelegate::~CircularProgressDelegate() diff --git a/src/ui/FlatButton.cc b/src/ui/FlatButton.cc index d59fe259..4ba92a38 100644 --- a/src/ui/FlatButton.cc +++ b/src/ui/FlatButton.cc @@ -14,54 +14,54 @@ void FlatButton::init() { - ripple_overlay_ = new RippleOverlay(this); - state_machine_ = new FlatButtonStateMachine(this); - role_ = ui::Role::Default; - ripple_style_ = ui::RippleStyle::PositionedRipple; - icon_placement_ = ui::ButtonIconPlacement::LeftIcon; - overlay_style_ = ui::OverlayStyle::GrayOverlay; - bg_mode_ = Qt::TransparentMode; - fixed_ripple_radius_ = 64; - corner_radius_ = 3; - base_opacity_ = 0.13; - font_size_ = 10; // 10.5; - use_fixed_ripple_radius_ = false; + ripple_overlay_ = new RippleOverlay(this); + state_machine_ = new FlatButtonStateMachine(this); + role_ = ui::Role::Default; + ripple_style_ = ui::RippleStyle::PositionedRipple; + icon_placement_ = ui::ButtonIconPlacement::LeftIcon; + overlay_style_ = ui::OverlayStyle::GrayOverlay; + bg_mode_ = Qt::TransparentMode; + fixed_ripple_radius_ = 64; + corner_radius_ = 3; + base_opacity_ = 0.13; + font_size_ = 10; // 10.5; + use_fixed_ripple_radius_ = false; - setStyle(&ThemeManager::instance()); - setAttribute(Qt::WA_Hover); - setMouseTracking(true); - setCursor(QCursor(Qt::PointingHandCursor)); + setStyle(&ThemeManager::instance()); + setAttribute(Qt::WA_Hover); + setMouseTracking(true); + setCursor(QCursor(Qt::PointingHandCursor)); - QPainterPath path; - path.addRoundedRect(rect(), corner_radius_, corner_radius_); + QPainterPath path; + path.addRoundedRect(rect(), corner_radius_, corner_radius_); - ripple_overlay_->setClipPath(path); - ripple_overlay_->setClipping(true); + ripple_overlay_->setClipPath(path); + ripple_overlay_->setClipping(true); - state_machine_->setupProperties(); - state_machine_->startAnimations(); + state_machine_->setupProperties(); + state_machine_->startAnimations(); } FlatButton::FlatButton(QWidget *parent, ui::ButtonPreset preset) : QPushButton(parent) { - init(); - applyPreset(preset); + init(); + applyPreset(preset); } FlatButton::FlatButton(const QString &text, QWidget *parent, ui::ButtonPreset preset) : QPushButton(text, parent) { - init(); - applyPreset(preset); + init(); + applyPreset(preset); } FlatButton::FlatButton(const QString &text, ui::Role role, QWidget *parent, ui::ButtonPreset preset) : QPushButton(text, parent) { - init(); - applyPreset(preset); - setRole(role); + init(); + applyPreset(preset); + setRole(role); } FlatButton::~FlatButton() @@ -71,406 +71,406 @@ FlatButton::~FlatButton() void FlatButton::applyPreset(ui::ButtonPreset preset) { - switch (preset) { - case ui::ButtonPreset::FlatPreset: - setOverlayStyle(ui::OverlayStyle::NoOverlay); - break; - case ui::ButtonPreset::CheckablePreset: - setOverlayStyle(ui::OverlayStyle::NoOverlay); - setCheckable(true); - break; - default: - break; - } + switch (preset) { + case ui::ButtonPreset::FlatPreset: + setOverlayStyle(ui::OverlayStyle::NoOverlay); + break; + case ui::ButtonPreset::CheckablePreset: + setOverlayStyle(ui::OverlayStyle::NoOverlay); + setCheckable(true); + break; + default: + break; + } } void FlatButton::setRole(ui::Role role) { - role_ = role; - state_machine_->setupProperties(); + role_ = role; + state_machine_->setupProperties(); } ui::Role FlatButton::role() const { - return role_; + return role_; } void FlatButton::setForegroundColor(const QColor &color) { - foreground_color_ = color; + foreground_color_ = color; } QColor FlatButton::foregroundColor() const { - if (!foreground_color_.isValid()) { - if (bg_mode_ == Qt::OpaqueMode) { - return ThemeManager::instance().themeColor("BrightWhite"); - } + if (!foreground_color_.isValid()) { + if (bg_mode_ == Qt::OpaqueMode) { + return ThemeManager::instance().themeColor("BrightWhite"); + } - switch (role_) { - case ui::Role::Primary: - return ThemeManager::instance().themeColor("Blue"); - case ui::Role::Secondary: - return ThemeManager::instance().themeColor("Gray"); - case ui::Role::Default: - default: - return ThemeManager::instance().themeColor("Black"); - } - } + switch (role_) { + case ui::Role::Primary: + return ThemeManager::instance().themeColor("Blue"); + case ui::Role::Secondary: + return ThemeManager::instance().themeColor("Gray"); + case ui::Role::Default: + default: + return ThemeManager::instance().themeColor("Black"); + } + } - return foreground_color_; + return foreground_color_; } void FlatButton::setBackgroundColor(const QColor &color) { - background_color_ = color; + background_color_ = color; } QColor FlatButton::backgroundColor() const { - if (!background_color_.isValid()) { - switch (role_) { - case ui::Role::Primary: - return ThemeManager::instance().themeColor("Blue"); - case ui::Role::Secondary: - return ThemeManager::instance().themeColor("Gray"); - case ui::Role::Default: - default: - return ThemeManager::instance().themeColor("Black"); - } - } + if (!background_color_.isValid()) { + switch (role_) { + case ui::Role::Primary: + return ThemeManager::instance().themeColor("Blue"); + case ui::Role::Secondary: + return ThemeManager::instance().themeColor("Gray"); + case ui::Role::Default: + default: + return ThemeManager::instance().themeColor("Black"); + } + } - return background_color_; + return background_color_; } void FlatButton::setOverlayColor(const QColor &color) { - overlay_color_ = color; - setOverlayStyle(ui::OverlayStyle::TintedOverlay); + overlay_color_ = color; + setOverlayStyle(ui::OverlayStyle::TintedOverlay); } QColor FlatButton::overlayColor() const { - if (!overlay_color_.isValid()) { - return foregroundColor(); - } + if (!overlay_color_.isValid()) { + return foregroundColor(); + } - return overlay_color_; + return overlay_color_; } void FlatButton::setDisabledForegroundColor(const QColor &color) { - disabled_color_ = color; + disabled_color_ = color; } QColor FlatButton::disabledForegroundColor() const { - if (!disabled_color_.isValid()) { - return ThemeManager::instance().themeColor("FadedWhite"); - } + if (!disabled_color_.isValid()) { + return ThemeManager::instance().themeColor("FadedWhite"); + } - return disabled_color_; + return disabled_color_; } void FlatButton::setDisabledBackgroundColor(const QColor &color) { - disabled_background_color_ = color; + disabled_background_color_ = color; } QColor FlatButton::disabledBackgroundColor() const { - if (!disabled_background_color_.isValid()) { - return ThemeManager::instance().themeColor("FadedWhite"); - } + if (!disabled_background_color_.isValid()) { + return ThemeManager::instance().themeColor("FadedWhite"); + } - return disabled_background_color_; + return disabled_background_color_; } void FlatButton::setFontSize(qreal size) { - font_size_ = size; + font_size_ = size; - QFont f(font()); - f.setPixelSize(size); - setFont(f); + QFont f(font()); + f.setPixelSize(size); + setFont(f); - update(); + update(); } qreal FlatButton::fontSize() const { - return font_size_; + return font_size_; } void FlatButton::setOverlayStyle(ui::OverlayStyle style) { - overlay_style_ = style; - update(); + overlay_style_ = style; + update(); } ui::OverlayStyle FlatButton::overlayStyle() const { - return overlay_style_; + return overlay_style_; } void FlatButton::setRippleStyle(ui::RippleStyle style) { - ripple_style_ = style; + ripple_style_ = style; } ui::RippleStyle FlatButton::rippleStyle() const { - return ripple_style_; + return ripple_style_; } void FlatButton::setIconPlacement(ui::ButtonIconPlacement placement) { - icon_placement_ = placement; - update(); + icon_placement_ = placement; + update(); } ui::ButtonIconPlacement FlatButton::iconPlacement() const { - return icon_placement_; + return icon_placement_; } void FlatButton::setCornerRadius(qreal radius) { - corner_radius_ = radius; - updateClipPath(); - update(); + corner_radius_ = radius; + updateClipPath(); + update(); } qreal FlatButton::cornerRadius() const { - return corner_radius_; + return corner_radius_; } void FlatButton::setBackgroundMode(Qt::BGMode mode) { - bg_mode_ = mode; - state_machine_->setupProperties(); + bg_mode_ = mode; + state_machine_->setupProperties(); } Qt::BGMode FlatButton::backgroundMode() const { - return bg_mode_; + return bg_mode_; } void FlatButton::setBaseOpacity(qreal opacity) { - base_opacity_ = opacity; - state_machine_->setupProperties(); + base_opacity_ = opacity; + state_machine_->setupProperties(); } qreal FlatButton::baseOpacity() const { - return base_opacity_; + return base_opacity_; } void FlatButton::setCheckable(bool value) { - state_machine_->updateCheckedStatus(); - state_machine_->setCheckedOverlayProgress(0); + state_machine_->updateCheckedStatus(); + state_machine_->setCheckedOverlayProgress(0); - QPushButton::setCheckable(value); + QPushButton::setCheckable(value); } void FlatButton::setHasFixedRippleRadius(bool value) { - use_fixed_ripple_radius_ = value; + use_fixed_ripple_radius_ = value; } bool FlatButton::hasFixedRippleRadius() const { - return use_fixed_ripple_radius_; + return use_fixed_ripple_radius_; } void FlatButton::setFixedRippleRadius(qreal radius) { - fixed_ripple_radius_ = radius; - setHasFixedRippleRadius(true); + fixed_ripple_radius_ = radius; + setHasFixedRippleRadius(true); } QSize FlatButton::sizeHint() const { - ensurePolished(); + ensurePolished(); - QSize label(fontMetrics().size(Qt::TextSingleLine, text())); + QSize label(fontMetrics().size(Qt::TextSingleLine, text())); - int w = 20 + label.width(); - int h = label.height(); + int w = 20 + label.width(); + int h = label.height(); - if (!icon().isNull()) { - w += iconSize().width() + FlatButton::IconPadding; - h = qMax(h, iconSize().height()); - } + if (!icon().isNull()) { + w += iconSize().width() + FlatButton::IconPadding; + h = qMax(h, iconSize().height()); + } - return QSize(w, 20 + h); + return QSize(w, 20 + h); } void FlatButton::checkStateSet() { - state_machine_->updateCheckedStatus(); - QPushButton::checkStateSet(); + state_machine_->updateCheckedStatus(); + QPushButton::checkStateSet(); } void FlatButton::mousePressEvent(QMouseEvent *event) { - if (ui::RippleStyle::NoRipple != ripple_style_) { - QPoint pos; - qreal radiusEndValue; + if (ui::RippleStyle::NoRipple != ripple_style_) { + QPoint pos; + qreal radiusEndValue; - if (ui::RippleStyle::CenteredRipple == ripple_style_) { - pos = rect().center(); - } else { - pos = event->pos(); - } + if (ui::RippleStyle::CenteredRipple == ripple_style_) { + pos = rect().center(); + } else { + pos = event->pos(); + } - if (use_fixed_ripple_radius_) { - radiusEndValue = fixed_ripple_radius_; - } else { - radiusEndValue = static_cast(width()) / 2; - } + if (use_fixed_ripple_radius_) { + radiusEndValue = fixed_ripple_radius_; + } else { + radiusEndValue = static_cast(width()) / 2; + } - Ripple *ripple = new Ripple(pos); + Ripple *ripple = new Ripple(pos); - ripple->setRadiusEndValue(radiusEndValue); - ripple->setOpacityStartValue(0.35); - ripple->setColor(foregroundColor()); - ripple->radiusAnimation()->setDuration(250); - ripple->opacityAnimation()->setDuration(250); + ripple->setRadiusEndValue(radiusEndValue); + ripple->setOpacityStartValue(0.35); + ripple->setColor(foregroundColor()); + ripple->radiusAnimation()->setDuration(250); + ripple->opacityAnimation()->setDuration(250); - ripple_overlay_->addRipple(ripple); - } + ripple_overlay_->addRipple(ripple); + } - QPushButton::mousePressEvent(event); + QPushButton::mousePressEvent(event); } void FlatButton::mouseReleaseEvent(QMouseEvent *event) { - QPushButton::mouseReleaseEvent(event); - state_machine_->updateCheckedStatus(); + QPushButton::mouseReleaseEvent(event); + state_machine_->updateCheckedStatus(); } void FlatButton::resizeEvent(QResizeEvent *event) { - QPushButton::resizeEvent(event); - updateClipPath(); + QPushButton::resizeEvent(event); + updateClipPath(); } void FlatButton::paintEvent(QPaintEvent *event) { - Q_UNUSED(event) + Q_UNUSED(event) - QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); - const qreal cr = corner_radius_; + const qreal cr = corner_radius_; - if (cr > 0) { - QPainterPath path; - path.addRoundedRect(rect(), cr, cr); + if (cr > 0) { + QPainterPath path; + path.addRoundedRect(rect(), cr, cr); - painter.setClipPath(path); - painter.setClipping(true); - } + painter.setClipPath(path); + painter.setClipping(true); + } - paintBackground(&painter); + paintBackground(&painter); - painter.setOpacity(1); - painter.setClipping(false); + painter.setOpacity(1); + painter.setClipping(false); - paintForeground(&painter); + paintForeground(&painter); } void FlatButton::paintBackground(QPainter *painter) { - const qreal overlayOpacity = state_machine_->overlayOpacity(); - const qreal checkedProgress = state_machine_->checkedOverlayProgress(); + const qreal overlayOpacity = state_machine_->overlayOpacity(); + const qreal checkedProgress = state_machine_->checkedOverlayProgress(); - if (Qt::OpaqueMode == bg_mode_) { - QBrush brush; - brush.setStyle(Qt::SolidPattern); + if (Qt::OpaqueMode == bg_mode_) { + QBrush brush; + brush.setStyle(Qt::SolidPattern); - if (isEnabled()) { - brush.setColor(backgroundColor()); - } else { - brush.setColor(disabledBackgroundColor()); - } + if (isEnabled()) { + brush.setColor(backgroundColor()); + } else { + brush.setColor(disabledBackgroundColor()); + } - painter->setOpacity(1); - painter->setBrush(brush); - painter->setPen(Qt::NoPen); - painter->drawRect(rect()); - } + painter->setOpacity(1); + painter->setBrush(brush); + painter->setPen(Qt::NoPen); + painter->drawRect(rect()); + } - QBrush brush; - brush.setStyle(Qt::SolidPattern); - painter->setPen(Qt::NoPen); + QBrush brush; + brush.setStyle(Qt::SolidPattern); + painter->setPen(Qt::NoPen); - if (!isEnabled()) { - return; - } + if (!isEnabled()) { + return; + } - if ((ui::OverlayStyle::NoOverlay != overlay_style_) && (overlayOpacity > 0)) { - if (ui::OverlayStyle::TintedOverlay == overlay_style_) { - brush.setColor(overlayColor()); - } else { - brush.setColor(Qt::gray); - } + if ((ui::OverlayStyle::NoOverlay != overlay_style_) && (overlayOpacity > 0)) { + if (ui::OverlayStyle::TintedOverlay == overlay_style_) { + brush.setColor(overlayColor()); + } else { + brush.setColor(Qt::gray); + } - painter->setOpacity(overlayOpacity); - painter->setBrush(brush); - painter->drawRect(rect()); - } + painter->setOpacity(overlayOpacity); + painter->setBrush(brush); + painter->drawRect(rect()); + } - if (isCheckable() && checkedProgress > 0) { - const qreal q = Qt::TransparentMode == bg_mode_ ? 0.45 : 0.7; - brush.setColor(foregroundColor()); - painter->setOpacity(q * checkedProgress); - painter->setBrush(brush); - QRect r(rect()); - r.setHeight(static_cast(r.height()) * checkedProgress); - painter->drawRect(r); - } + if (isCheckable() && checkedProgress > 0) { + const qreal q = Qt::TransparentMode == bg_mode_ ? 0.45 : 0.7; + brush.setColor(foregroundColor()); + painter->setOpacity(q * checkedProgress); + painter->setBrush(brush); + QRect r(rect()); + r.setHeight(static_cast(r.height()) * checkedProgress); + painter->drawRect(r); + } } #define COLOR_INTERPOLATE(CH) (1 - progress) * source.CH() + progress *dest.CH() @@ -478,63 +478,64 @@ FlatButton::paintBackground(QPainter *painter) void FlatButton::paintForeground(QPainter *painter) { - if (isEnabled()) { - painter->setPen(foregroundColor()); - const qreal progress = state_machine_->checkedOverlayProgress(); + if (isEnabled()) { + painter->setPen(foregroundColor()); + const qreal progress = state_machine_->checkedOverlayProgress(); - if (isCheckable() && progress > 0) { - QColor source = foregroundColor(); - QColor dest = Qt::TransparentMode == bg_mode_ ? Qt::white : backgroundColor(); - if (qFuzzyCompare(1, progress)) { - painter->setPen(dest); - } else { - painter->setPen(QColor(COLOR_INTERPOLATE(red), - COLOR_INTERPOLATE(green), - COLOR_INTERPOLATE(blue), - COLOR_INTERPOLATE(alpha))); - } - } - } else { - painter->setPen(disabledForegroundColor()); - } + if (isCheckable() && progress > 0) { + QColor source = foregroundColor(); + QColor dest = + Qt::TransparentMode == bg_mode_ ? Qt::white : backgroundColor(); + if (qFuzzyCompare(1, progress)) { + painter->setPen(dest); + } else { + painter->setPen(QColor(COLOR_INTERPOLATE(red), + COLOR_INTERPOLATE(green), + COLOR_INTERPOLATE(blue), + COLOR_INTERPOLATE(alpha))); + } + } + } else { + painter->setPen(disabledForegroundColor()); + } - if (icon().isNull()) { - painter->drawText(rect(), Qt::AlignCenter, text()); - return; - } + if (icon().isNull()) { + painter->drawText(rect(), Qt::AlignCenter, text()); + return; + } - QSize textSize(fontMetrics().size(Qt::TextSingleLine, text())); - QSize base(size() - textSize); + QSize textSize(fontMetrics().size(Qt::TextSingleLine, text())); + QSize base(size() - textSize); - const int iw = iconSize().width() + IconPadding; - QPoint pos((base.width() - iw) / 2, 0); + const int iw = iconSize().width() + IconPadding; + QPoint pos((base.width() - iw) / 2, 0); - QRect textGeometry(pos + QPoint(0, base.height() / 2), textSize); - QRect iconGeometry(pos + QPoint(0, (height() - iconSize().height()) / 2), iconSize()); + QRect textGeometry(pos + QPoint(0, base.height() / 2), textSize); + QRect iconGeometry(pos + QPoint(0, (height() - iconSize().height()) / 2), iconSize()); - /* if (ui::LeftIcon == icon_placement_) { */ - /* textGeometry.translate(iw, 0); */ - /* } else { */ - /* iconGeometry.translate(textSize.width() + IconPadding, 0); */ - /* } */ + /* if (ui::LeftIcon == icon_placement_) { */ + /* textGeometry.translate(iw, 0); */ + /* } else { */ + /* iconGeometry.translate(textSize.width() + IconPadding, 0); */ + /* } */ - painter->drawText(textGeometry, Qt::AlignCenter, text()); + painter->drawText(textGeometry, Qt::AlignCenter, text()); - QPixmap pixmap = icon().pixmap(iconSize()); - QPainter icon(&pixmap); - icon.setCompositionMode(QPainter::CompositionMode_SourceIn); - icon.fillRect(pixmap.rect(), painter->pen().color()); - painter->drawPixmap(iconGeometry, pixmap); + QPixmap pixmap = icon().pixmap(iconSize()); + QPainter icon(&pixmap); + icon.setCompositionMode(QPainter::CompositionMode_SourceIn); + icon.fillRect(pixmap.rect(), painter->pen().color()); + painter->drawPixmap(iconGeometry, pixmap); } void FlatButton::updateClipPath() { - const qreal radius = corner_radius_; + const qreal radius = corner_radius_; - QPainterPath path; - path.addRoundedRect(rect(), radius, radius); - ripple_overlay_->setClipPath(path); + QPainterPath path; + path.addRoundedRect(rect(), radius, radius); + ripple_overlay_->setClipPath(path); } FlatButtonStateMachine::FlatButtonStateMachine(FlatButton *parent) @@ -554,45 +555,45 @@ FlatButtonStateMachine::FlatButtonStateMachine(FlatButton *parent) , checked_overlay_progress_(parent->isChecked() ? 1 : 0) , was_checked_(false) { - Q_ASSERT(parent); + Q_ASSERT(parent); - parent->installEventFilter(this); + parent->installEventFilter(this); - config_state_->setInitialState(neutral_state_); - addState(top_level_state_); - setInitialState(top_level_state_); + config_state_->setInitialState(neutral_state_); + addState(top_level_state_); + setInitialState(top_level_state_); - checkable_state_->setInitialState(parent->isChecked() ? checked_state_ : unchecked_state_); - QSignalTransition *transition; - QPropertyAnimation *animation; + checkable_state_->setInitialState(parent->isChecked() ? checked_state_ : unchecked_state_); + QSignalTransition *transition; + QPropertyAnimation *animation; - transition = new QSignalTransition(this, SIGNAL(buttonChecked())); - transition->setTargetState(checked_state_); - unchecked_state_->addTransition(transition); + transition = new QSignalTransition(this, SIGNAL(buttonChecked())); + transition->setTargetState(checked_state_); + unchecked_state_->addTransition(transition); - animation = new QPropertyAnimation(this, "checkedOverlayProgress", this); - animation->setDuration(200); - transition->addAnimation(animation); + animation = new QPropertyAnimation(this, "checkedOverlayProgress", this); + animation->setDuration(200); + transition->addAnimation(animation); - transition = new QSignalTransition(this, SIGNAL(buttonUnchecked())); - transition->setTargetState(unchecked_state_); - checked_state_->addTransition(transition); + transition = new QSignalTransition(this, SIGNAL(buttonUnchecked())); + transition->setTargetState(unchecked_state_); + checked_state_->addTransition(transition); - animation = new QPropertyAnimation(this, "checkedOverlayProgress", this); - animation->setDuration(200); - transition->addAnimation(animation); + animation = new QPropertyAnimation(this, "checkedOverlayProgress", this); + animation->setDuration(200); + transition->addAnimation(animation); - addTransition(button_, QEvent::FocusIn, neutral_state_, neutral_focused_state_); - addTransition(button_, QEvent::FocusOut, neutral_focused_state_, neutral_state_); - addTransition(button_, QEvent::Enter, neutral_state_, hovered_state_); - addTransition(button_, QEvent::Leave, hovered_state_, neutral_state_); - addTransition(button_, QEvent::Enter, neutral_focused_state_, hovered_focused_state_); - addTransition(button_, QEvent::Leave, hovered_focused_state_, neutral_focused_state_); - addTransition(button_, QEvent::FocusIn, hovered_state_, hovered_focused_state_); - addTransition(button_, QEvent::FocusOut, hovered_focused_state_, hovered_state_); - addTransition(this, SIGNAL(buttonPressed()), hovered_state_, pressed_state_); - addTransition(button_, QEvent::Leave, pressed_state_, neutral_focused_state_); - addTransition(button_, QEvent::FocusOut, pressed_state_, hovered_state_); + addTransition(button_, QEvent::FocusIn, neutral_state_, neutral_focused_state_); + addTransition(button_, QEvent::FocusOut, neutral_focused_state_, neutral_state_); + addTransition(button_, QEvent::Enter, neutral_state_, hovered_state_); + addTransition(button_, QEvent::Leave, hovered_state_, neutral_state_); + addTransition(button_, QEvent::Enter, neutral_focused_state_, hovered_focused_state_); + addTransition(button_, QEvent::Leave, hovered_focused_state_, neutral_focused_state_); + addTransition(button_, QEvent::FocusIn, hovered_state_, hovered_focused_state_); + addTransition(button_, QEvent::FocusOut, hovered_focused_state_, hovered_state_); + addTransition(this, SIGNAL(buttonPressed()), hovered_state_, pressed_state_); + addTransition(button_, QEvent::Leave, pressed_state_, neutral_focused_state_); + addTransition(button_, QEvent::FocusOut, pressed_state_, hovered_state_); } FlatButtonStateMachine::~FlatButtonStateMachine() @@ -602,97 +603,105 @@ FlatButtonStateMachine::~FlatButtonStateMachine() void FlatButtonStateMachine::setOverlayOpacity(qreal opacity) { - overlay_opacity_ = opacity; - button_->update(); + overlay_opacity_ = opacity; + button_->update(); } void FlatButtonStateMachine::setCheckedOverlayProgress(qreal opacity) { - checked_overlay_progress_ = opacity; - button_->update(); + checked_overlay_progress_ = opacity; + button_->update(); } void FlatButtonStateMachine::startAnimations() { - start(); + start(); } void FlatButtonStateMachine::setupProperties() { - QColor overlayColor; + QColor overlayColor; - if (Qt::TransparentMode == button_->backgroundMode()) { - overlayColor = button_->backgroundColor(); - } else { - overlayColor = button_->foregroundColor(); - } + if (Qt::TransparentMode == button_->backgroundMode()) { + overlayColor = button_->backgroundColor(); + } else { + overlayColor = button_->foregroundColor(); + } - const qreal baseOpacity = button_->baseOpacity(); + const qreal baseOpacity = button_->baseOpacity(); - neutral_state_->assignProperty(this, "overlayOpacity", 0); - neutral_focused_state_->assignProperty(this, "overlayOpacity", 0); - hovered_state_->assignProperty(this, "overlayOpacity", baseOpacity); - hovered_focused_state_->assignProperty(this, "overlayOpacity", baseOpacity); - pressed_state_->assignProperty(this, "overlayOpacity", baseOpacity); - checked_state_->assignProperty(this, "checkedOverlayProgress", 1); - unchecked_state_->assignProperty(this, "checkedOverlayProgress", 0); + neutral_state_->assignProperty(this, "overlayOpacity", 0); + neutral_focused_state_->assignProperty(this, "overlayOpacity", 0); + hovered_state_->assignProperty(this, "overlayOpacity", baseOpacity); + hovered_focused_state_->assignProperty(this, "overlayOpacity", baseOpacity); + pressed_state_->assignProperty(this, "overlayOpacity", baseOpacity); + checked_state_->assignProperty(this, "checkedOverlayProgress", 1); + unchecked_state_->assignProperty(this, "checkedOverlayProgress", 0); - button_->update(); + button_->update(); } void FlatButtonStateMachine::updateCheckedStatus() { - const bool checked = button_->isChecked(); - if (was_checked_ != checked) { - was_checked_ = checked; - if (checked) { - emit buttonChecked(); - } else { - emit buttonUnchecked(); - } - } + const bool checked = button_->isChecked(); + if (was_checked_ != checked) { + was_checked_ = checked; + if (checked) { + emit buttonChecked(); + } else { + emit buttonUnchecked(); + } + } } bool FlatButtonStateMachine::eventFilter(QObject *watched, QEvent *event) { - if (QEvent::FocusIn == event->type()) { - QFocusEvent *focusEvent = static_cast(event); - if (focusEvent && Qt::MouseFocusReason == focusEvent->reason()) { - emit buttonPressed(); - return true; - } - } + if (QEvent::FocusIn == event->type()) { + QFocusEvent *focusEvent = static_cast(event); + if (focusEvent && Qt::MouseFocusReason == focusEvent->reason()) { + emit buttonPressed(); + return true; + } + } - return QStateMachine::eventFilter(watched, event); + return QStateMachine::eventFilter(watched, event); } void -FlatButtonStateMachine::addTransition(QObject *object, const char *signal, QState *fromState, QState *toState) +FlatButtonStateMachine::addTransition(QObject *object, + const char *signal, + QState *fromState, + QState *toState) { - addTransition(new QSignalTransition(object, signal), fromState, toState); + addTransition(new QSignalTransition(object, signal), fromState, toState); } void -FlatButtonStateMachine::addTransition(QObject *object, QEvent::Type eventType, QState *fromState, QState *toState) +FlatButtonStateMachine::addTransition(QObject *object, + QEvent::Type eventType, + QState *fromState, + QState *toState) { - addTransition(new QEventTransition(object, eventType), fromState, toState); + addTransition(new QEventTransition(object, eventType), fromState, toState); } void -FlatButtonStateMachine::addTransition(QAbstractTransition *transition, QState *fromState, QState *toState) +FlatButtonStateMachine::addTransition(QAbstractTransition *transition, + QState *fromState, + QState *toState) { - transition->setTargetState(toState); + transition->setTargetState(toState); - QPropertyAnimation *animation; + QPropertyAnimation *animation; - animation = new QPropertyAnimation(this, "overlayOpacity", this); - animation->setDuration(150); - transition->addAnimation(animation); + animation = new QPropertyAnimation(this, "overlayOpacity", this); + animation->setDuration(150); + transition->addAnimation(animation); - fromState->addTransition(transition); + fromState->addTransition(transition); } diff --git a/src/ui/OverlayModal.cc b/src/ui/OverlayModal.cc index 9bce351b..1da009d4 100644 --- a/src/ui/OverlayModal.cc +++ b/src/ui/OverlayModal.cc @@ -26,50 +26,50 @@ OverlayModal::OverlayModal(QWidget *parent, QWidget *content) , duration_{ 500 } , color_{ QColor(55, 55, 55) } { - setAttribute(Qt::WA_TranslucentBackground); + setAttribute(Qt::WA_TranslucentBackground); - auto layout = new QVBoxLayout(); - layout->addWidget(content); - layout->setAlignment(Qt::AlignCenter); + auto layout = new QVBoxLayout(); + layout->addWidget(content); + layout->setAlignment(Qt::AlignCenter); - setLayout(layout); + setLayout(layout); - opacity_ = new QGraphicsOpacityEffect(this); - setGraphicsEffect(opacity_); + opacity_ = new QGraphicsOpacityEffect(this); + setGraphicsEffect(opacity_); - opacity_->setOpacity(1); - animation_ = new QPropertyAnimation(opacity_, "opacity", this); - animation_->setStartValue(1); - animation_->setEndValue(0); - animation_->setDuration(duration_); - animation_->setEasingCurve(QEasingCurve::Linear); + opacity_->setOpacity(1); + animation_ = new QPropertyAnimation(opacity_, "opacity", this); + animation_->setStartValue(1); + animation_->setEndValue(0); + animation_->setDuration(duration_); + animation_->setEasingCurve(QEasingCurve::Linear); - connect(animation_, &QPropertyAnimation::finished, [this]() { - if (animation_->direction() == QAbstractAnimation::Forward) - this->close(); - }); + connect(animation_, &QPropertyAnimation::finished, [this]() { + if (animation_->direction() == QAbstractAnimation::Forward) + this->close(); + }); } void OverlayModal::paintEvent(QPaintEvent *event) { - Q_UNUSED(event); + Q_UNUSED(event); - QPainter painter(this); - painter.fillRect(rect(), color_); + QPainter painter(this); + painter.fillRect(rect(), color_); } void OverlayModal::fadeIn() { - animation_->setDirection(QAbstractAnimation::Backward); - animation_->start(); - show(); + animation_->setDirection(QAbstractAnimation::Backward); + animation_->start(); + show(); } void OverlayModal::fadeOut() { - animation_->setDirection(QAbstractAnimation::Forward); - animation_->start(); + animation_->setDirection(QAbstractAnimation::Forward); + animation_->start(); } diff --git a/src/ui/OverlayWidget.cc b/src/ui/OverlayWidget.cc index ab394966..c69f81f7 100644 --- a/src/ui/OverlayWidget.cc +++ b/src/ui/OverlayWidget.cc @@ -4,58 +4,58 @@ OverlayWidget::OverlayWidget(QWidget *parent) : QWidget(parent) { - if (parent) { - parent->installEventFilter(this); - setGeometry(overlayGeometry()); - raise(); - } + if (parent) { + parent->installEventFilter(this); + setGeometry(overlayGeometry()); + raise(); + } } bool OverlayWidget::event(QEvent *event) { - if (!parent()) - return QWidget::event(event); + if (!parent()) + return QWidget::event(event); - switch (event->type()) { - case QEvent::ParentChange: { - parent()->installEventFilter(this); - setGeometry(overlayGeometry()); - break; - } - case QEvent::ParentAboutToChange: { - parent()->removeEventFilter(this); - break; - } - default: - break; - } + switch (event->type()) { + case QEvent::ParentChange: { + parent()->installEventFilter(this); + setGeometry(overlayGeometry()); + break; + } + case QEvent::ParentAboutToChange: { + parent()->removeEventFilter(this); + break; + } + default: + break; + } - return QWidget::event(event); + return QWidget::event(event); } bool OverlayWidget::eventFilter(QObject *obj, QEvent *event) { - switch (event->type()) { - case QEvent::Move: - case QEvent::Resize: - setGeometry(overlayGeometry()); - break; - default: - break; - } + switch (event->type()) { + case QEvent::Move: + case QEvent::Resize: + setGeometry(overlayGeometry()); + break; + default: + break; + } - return QWidget::eventFilter(obj, event); + return QWidget::eventFilter(obj, event); } QRect OverlayWidget::overlayGeometry() const { - QWidget *widget = parentWidget(); + QWidget *widget = parentWidget(); - if (!widget) - return QRect(); + if (!widget) + return QRect(); - return widget->rect(); + return widget->rect(); } diff --git a/src/ui/RaisedButton.cc b/src/ui/RaisedButton.cc index f3bdb7c9..c30f253a 100644 --- a/src/ui/RaisedButton.cc +++ b/src/ui/RaisedButton.cc @@ -6,68 +6,68 @@ void RaisedButton::init() { - shadow_state_machine_ = new QStateMachine(this); - normal_state_ = new QState; - pressed_state_ = new QState; - effect_ = new QGraphicsDropShadowEffect; + shadow_state_machine_ = new QStateMachine(this); + normal_state_ = new QState; + pressed_state_ = new QState; + effect_ = new QGraphicsDropShadowEffect; - effect_->setBlurRadius(7); - effect_->setOffset(QPointF(0, 2)); - effect_->setColor(QColor(0, 0, 0, 75)); + effect_->setBlurRadius(7); + effect_->setOffset(QPointF(0, 2)); + effect_->setColor(QColor(0, 0, 0, 75)); - setBackgroundMode(Qt::OpaqueMode); - setMinimumHeight(42); - setGraphicsEffect(effect_); - setBaseOpacity(0.3); + setBackgroundMode(Qt::OpaqueMode); + setMinimumHeight(42); + setGraphicsEffect(effect_); + setBaseOpacity(0.3); - shadow_state_machine_->addState(normal_state_); - shadow_state_machine_->addState(pressed_state_); + shadow_state_machine_->addState(normal_state_); + shadow_state_machine_->addState(pressed_state_); - normal_state_->assignProperty(effect_, "offset", QPointF(0, 2)); - normal_state_->assignProperty(effect_, "blurRadius", 7); + normal_state_->assignProperty(effect_, "offset", QPointF(0, 2)); + normal_state_->assignProperty(effect_, "blurRadius", 7); - pressed_state_->assignProperty(effect_, "offset", QPointF(0, 5)); - pressed_state_->assignProperty(effect_, "blurRadius", 29); + pressed_state_->assignProperty(effect_, "offset", QPointF(0, 5)); + pressed_state_->assignProperty(effect_, "blurRadius", 29); - QAbstractTransition *transition; + QAbstractTransition *transition; - transition = new QEventTransition(this, QEvent::MouseButtonPress); - transition->setTargetState(pressed_state_); - normal_state_->addTransition(transition); + transition = new QEventTransition(this, QEvent::MouseButtonPress); + transition->setTargetState(pressed_state_); + normal_state_->addTransition(transition); - transition = new QEventTransition(this, QEvent::MouseButtonDblClick); - transition->setTargetState(pressed_state_); - normal_state_->addTransition(transition); + transition = new QEventTransition(this, QEvent::MouseButtonDblClick); + transition->setTargetState(pressed_state_); + normal_state_->addTransition(transition); - transition = new QEventTransition(this, QEvent::MouseButtonRelease); - transition->setTargetState(normal_state_); - pressed_state_->addTransition(transition); + transition = new QEventTransition(this, QEvent::MouseButtonRelease); + transition->setTargetState(normal_state_); + pressed_state_->addTransition(transition); - QPropertyAnimation *animation; + QPropertyAnimation *animation; - animation = new QPropertyAnimation(effect_, "offset", this); - animation->setDuration(100); - shadow_state_machine_->addDefaultAnimation(animation); + animation = new QPropertyAnimation(effect_, "offset", this); + animation->setDuration(100); + shadow_state_machine_->addDefaultAnimation(animation); - animation = new QPropertyAnimation(effect_, "blurRadius", this); - animation->setDuration(100); - shadow_state_machine_->addDefaultAnimation(animation); + animation = new QPropertyAnimation(effect_, "blurRadius", this); + animation->setDuration(100); + shadow_state_machine_->addDefaultAnimation(animation); - shadow_state_machine_->setInitialState(normal_state_); - shadow_state_machine_->start(); + shadow_state_machine_->setInitialState(normal_state_); + shadow_state_machine_->start(); } RaisedButton::RaisedButton(QWidget *parent) : FlatButton(parent) { - init(); + init(); } RaisedButton::RaisedButton(const QString &text, QWidget *parent) : FlatButton(parent) { - init(); - setText(text); + init(); + setText(text); } RaisedButton::~RaisedButton() @@ -77,15 +77,15 @@ RaisedButton::~RaisedButton() bool RaisedButton::event(QEvent *event) { - if (QEvent::EnabledChange == event->type()) { - if (isEnabled()) { - shadow_state_machine_->start(); - effect_->setEnabled(true); - } else { - shadow_state_machine_->stop(); - effect_->setEnabled(false); - } - } + if (QEvent::EnabledChange == event->type()) { + if (isEnabled()) { + shadow_state_machine_->start(); + effect_->setEnabled(true); + } else { + shadow_state_machine_->stop(); + effect_->setEnabled(false); + } + } - return FlatButton::event(event); + return FlatButton::event(event); } diff --git a/src/ui/Ripple.cc b/src/ui/Ripple.cc index 636b45d1..2869bf7b 100644 --- a/src/ui/Ripple.cc +++ b/src/ui/Ripple.cc @@ -10,7 +10,7 @@ Ripple::Ripple(const QPoint ¢er, QObject *parent) , opacity_(0) , center_(center) { - init(); + init(); } Ripple::Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent) @@ -22,7 +22,7 @@ Ripple::Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent) , opacity_(0) , center_(center) { - init(); + init(); } Ripple::~Ripple() @@ -32,80 +32,80 @@ Ripple::~Ripple() void Ripple::setRadius(qreal radius) { - Q_ASSERT(overlay_); + Q_ASSERT(overlay_); - if (radius_ == radius) - return; + if (radius_ == radius) + return; - radius_ = radius; - overlay_->update(); + radius_ = radius; + overlay_->update(); } void Ripple::setOpacity(qreal opacity) { - Q_ASSERT(overlay_); + Q_ASSERT(overlay_); - if (opacity_ == opacity) - return; + if (opacity_ == opacity) + return; - opacity_ = opacity; - overlay_->update(); + opacity_ = opacity; + overlay_->update(); } void Ripple::setColor(const QColor &color) { - if (brush_.color() == color) - return; + if (brush_.color() == color) + return; - brush_.setColor(color); + brush_.setColor(color); - if (overlay_) - overlay_->update(); + if (overlay_) + overlay_->update(); } void Ripple::setBrush(const QBrush &brush) { - brush_ = brush; + brush_ = brush; - if (overlay_) - overlay_->update(); + if (overlay_) + overlay_->update(); } void Ripple::destroy() { - Q_ASSERT(overlay_); + Q_ASSERT(overlay_); - overlay_->removeRipple(this); + overlay_->removeRipple(this); } QPropertyAnimation * Ripple::animate(const QByteArray &property, const QEasingCurve &easing, int duration) { - QPropertyAnimation *animation = new QPropertyAnimation; - animation->setTargetObject(this); - animation->setPropertyName(property); - animation->setEasingCurve(easing); - animation->setDuration(duration); + QPropertyAnimation *animation = new QPropertyAnimation; + animation->setTargetObject(this); + animation->setPropertyName(property); + animation->setEasingCurve(easing); + animation->setDuration(duration); - addAnimation(animation); + addAnimation(animation); - return animation; + return animation; } void Ripple::init() { - setOpacityStartValue(0.5); - setOpacityEndValue(0); - setRadiusStartValue(0); - setRadiusEndValue(300); + setOpacityStartValue(0.5); + setOpacityEndValue(0); + setRadiusStartValue(0); + setRadiusEndValue(300); - brush_.setColor(Qt::black); - brush_.setStyle(Qt::SolidPattern); + brush_.setColor(Qt::black); + brush_.setStyle(Qt::SolidPattern); - connect(this, SIGNAL(finished()), this, SLOT(destroy())); + connect(this, SIGNAL(finished()), this, SLOT(destroy())); } diff --git a/src/ui/RippleOverlay.cc b/src/ui/RippleOverlay.cc index be070355..cf264363 100644 --- a/src/ui/RippleOverlay.cc +++ b/src/ui/RippleOverlay.cc @@ -7,8 +7,8 @@ RippleOverlay::RippleOverlay(QWidget *parent) : OverlayWidget(parent) , use_clip_(false) { - setAttribute(Qt::WA_TransparentForMouseEvents); - setAttribute(Qt::WA_NoSystemBackground); + setAttribute(Qt::WA_TransparentForMouseEvents); + setAttribute(Qt::WA_NoSystemBackground); } RippleOverlay::~RippleOverlay() @@ -18,49 +18,49 @@ RippleOverlay::~RippleOverlay() void RippleOverlay::addRipple(Ripple *ripple) { - ripple->setOverlay(this); - ripples_.push_back(ripple); - ripple->start(); + ripple->setOverlay(this); + ripples_.push_back(ripple); + ripple->start(); } void RippleOverlay::addRipple(const QPoint &position, qreal radius) { - Ripple *ripple = new Ripple(position); - ripple->setRadiusEndValue(radius); - addRipple(ripple); + Ripple *ripple = new Ripple(position); + ripple->setRadiusEndValue(radius); + addRipple(ripple); } void RippleOverlay::removeRipple(Ripple *ripple) { - if (ripples_.removeOne(ripple)) - delete ripple; + if (ripples_.removeOne(ripple)) + delete ripple; } void RippleOverlay::paintEvent(QPaintEvent *event) { - Q_UNUSED(event) + Q_UNUSED(event) - QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing); - painter.setPen(Qt::NoPen); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + painter.setPen(Qt::NoPen); - if (use_clip_) - painter.setClipPath(clip_path_); + if (use_clip_) + painter.setClipPath(clip_path_); - for (auto it = ripples_.constBegin(); it != ripples_.constEnd(); it++) - paintRipple(&painter, *it); + for (auto it = ripples_.constBegin(); it != ripples_.constEnd(); it++) + paintRipple(&painter, *it); } void RippleOverlay::paintRipple(QPainter *painter, Ripple *ripple) { - const qreal radius = ripple->radius(); - const QPointF center = ripple->center(); + const qreal radius = ripple->radius(); + const QPointF center = ripple->center(); - painter->setOpacity(ripple->opacity()); - painter->setBrush(ripple->brush()); - painter->drawEllipse(center, radius, radius); + painter->setOpacity(ripple->opacity()); + painter->setBrush(ripple->brush()); + painter->drawEllipse(center, radius, radius); } diff --git a/src/ui/ScrollBar.cc b/src/ui/ScrollBar.cc index 73cdf2ba..b186be23 100644 --- a/src/ui/ScrollBar.cc +++ b/src/ui/ScrollBar.cc @@ -25,86 +25,86 @@ ScrollBar::ScrollBar(QScrollArea *area, QWidget *parent) : QScrollBar(parent) , area_{ area } { - hideTimer_.setSingleShot(true); + hideTimer_.setSingleShot(true); - connect(&hideTimer_, &QTimer::timeout, this, &ScrollBar::fadeOut); + connect(&hideTimer_, &QTimer::timeout, this, &ScrollBar::fadeOut); - eff = new QGraphicsOpacityEffect(this); - setGraphicsEffect(eff); + eff = new QGraphicsOpacityEffect(this); + setGraphicsEffect(eff); } void ScrollBar::fadeOut() { - isActive = false; + isActive = false; - QPropertyAnimation *anim = new QPropertyAnimation(eff, "opacity"); - anim->setDuration(AnimationDuration); - anim->setStartValue(1); - anim->setEndValue(0); - anim->setEasingCurve(QEasingCurve::Linear); - anim->start(QPropertyAnimation::DeleteWhenStopped); + QPropertyAnimation *anim = new QPropertyAnimation(eff, "opacity"); + anim->setDuration(AnimationDuration); + anim->setStartValue(1); + anim->setEndValue(0); + anim->setEasingCurve(QEasingCurve::Linear); + anim->start(QPropertyAnimation::DeleteWhenStopped); } void ScrollBar::fadeIn() { - QPropertyAnimation *anim = new QPropertyAnimation(eff, "opacity"); - anim->setDuration(AnimationDuration); - anim->setStartValue(0); - anim->setEndValue(1); - anim->setEasingCurve(QEasingCurve::Linear); - anim->start(QPropertyAnimation::DeleteWhenStopped); + QPropertyAnimation *anim = new QPropertyAnimation(eff, "opacity"); + anim->setDuration(AnimationDuration); + anim->setStartValue(0); + anim->setEndValue(1); + anim->setEasingCurve(QEasingCurve::Linear); + anim->start(QPropertyAnimation::DeleteWhenStopped); } void ScrollBar::sliderChange(SliderChange change) { - if (!isActive) - fadeIn(); + if (!isActive) + fadeIn(); - hideTimer_.stop(); - hideTimer_.start(1500); - isActive = true; + hideTimer_.stop(); + hideTimer_.start(1500); + isActive = true; - QScrollBar::sliderChange(change); + QScrollBar::sliderChange(change); } void ScrollBar::paintEvent(QPaintEvent *) { - if (!width() && !height()) { - hide(); - return; - } + if (!width() && !height()) { + hide(); + return; + } - QPainter p(this); - p.setRenderHint(QPainter::TextAntialiasing); - p.setRenderHint(QPainter::Antialiasing); - p.setRenderHint(QPainter::SmoothPixmapTransform); + QPainter p(this); + p.setRenderHint(QPainter::TextAntialiasing); + p.setRenderHint(QPainter::Antialiasing); + p.setRenderHint(QPainter::SmoothPixmapTransform); - p.setPen(Qt::NoPen); + p.setPen(Qt::NoPen); - QColor bg(33, 33, 33, 30); - QColor handle(0, 0, 0, 80); + QColor bg(33, 33, 33, 30); + QColor handle(0, 0, 0, 80); - p.setBrush(bg); - QRect backgroundArea(Padding, 0, handleWidth_, height()); - p.drawRoundedRect(backgroundArea, roundRadius_, roundRadius_); + p.setBrush(bg); + QRect backgroundArea(Padding, 0, handleWidth_, height()); + p.drawRoundedRect(backgroundArea, roundRadius_, roundRadius_); - int areaHeight = area_->height(); - int widgetHeight = area_->widget()->height(); + int areaHeight = area_->height(); + int widgetHeight = area_->widget()->height(); - double visiblePercentage = (double)areaHeight / (double)widgetHeight; - int handleHeight = std::max(visiblePercentage * areaHeight, (double)minHandleHeight_); + double visiblePercentage = (double)areaHeight / (double)widgetHeight; + int handleHeight = std::max(visiblePercentage * areaHeight, (double)minHandleHeight_); - if (maximum() == 0) { - return; - } + if (maximum() == 0) { + return; + } - int handle_y = (value() * (areaHeight - handleHeight - roundRadius_ / 2)) / maximum(); + int handle_y = (value() * (areaHeight - handleHeight - roundRadius_ / 2)) / maximum(); - p.setBrush(handle); - QRect handleArea(Padding, handle_y, handleWidth_, handleHeight); - p.drawRoundedRect(handleArea, roundRadius_, roundRadius_); + p.setBrush(handle); + QRect handleArea(Padding, handle_y, handleWidth_, handleHeight); + p.drawRoundedRect(handleArea, roundRadius_, roundRadius_); } diff --git a/src/ui/TextField.cc b/src/ui/TextField.cc index 2d529326..efa77c39 100644 --- a/src/ui/TextField.cc +++ b/src/ui/TextField.cc @@ -10,26 +10,26 @@ TextField::TextField(QWidget *parent) : QLineEdit(parent) { - // Get rid of the focus border on macOS. - setAttribute(Qt::WA_MacShowFocusRect, 0); + // Get rid of the focus border on macOS. + setAttribute(Qt::WA_MacShowFocusRect, 0); - state_machine_ = new TextFieldStateMachine(this); - label_ = 0; - label_font_size_ = 13; - show_label_ = false; - background_color_ = QColor("white"); + state_machine_ = new TextFieldStateMachine(this); + label_ = 0; + label_font_size_ = 13; + show_label_ = false; + background_color_ = QColor("white"); - setFrame(false); - setAttribute(Qt::WA_Hover); - setMouseTracking(true); - setTextMargins(0, 4, 0, 6); + setFrame(false); + setAttribute(Qt::WA_Hover); + setMouseTracking(true); + setTextMargins(0, 4, 0, 6); - QFont font("Open Sans"); - font.setPixelSize(12); - setFont(font); + QFont font("Open Sans"); + font.setPixelSize(12); + setFont(font); - state_machine_->start(); - QCoreApplication::processEvents(); + state_machine_->start(); + QCoreApplication::processEvents(); } TextField::~TextField() @@ -39,238 +39,238 @@ TextField::~TextField() void TextField::setBackgroundColor(const QColor &color) { - background_color_ = color; + background_color_ = color; } QColor TextField::backgroundColor() const { - return background_color_; + return background_color_; } void TextField::setShowLabel(bool value) { - if (show_label_ == value) { - return; - } + if (show_label_ == value) { + return; + } - show_label_ = value; + show_label_ = value; - if (!label_ && value) { - label_ = new TextFieldLabel(this); - state_machine_->setLabel(label_); - } + if (!label_ && value) { + label_ = new TextFieldLabel(this); + state_machine_->setLabel(label_); + } - if (value) { - setContentsMargins(0, 23, 0, 0); - } else { - setContentsMargins(0, 0, 0, 0); - } + if (value) { + setContentsMargins(0, 23, 0, 0); + } else { + setContentsMargins(0, 0, 0, 0); + } } bool TextField::hasLabel() const { - return show_label_; + return show_label_; } void TextField::setLabelFontSize(qreal size) { - label_font_size_ = size; + label_font_size_ = size; - if (label_) { - QFont font(label_->font()); - font.setPixelSize(size); - label_->setFont(font); - label_->update(); - } + if (label_) { + QFont font(label_->font()); + font.setPixelSize(size); + label_->setFont(font); + label_->update(); + } } qreal TextField::labelFontSize() const { - return label_font_size_; + return label_font_size_; } void TextField::setLabel(const QString &label) { - label_text_ = label; - setShowLabel(true); - label_->update(); + label_text_ = label; + setShowLabel(true); + label_->update(); } QString TextField::label() const { - return label_text_; + return label_text_; } void TextField::setTextColor(const QColor &color) { - text_color_ = color; - setStyleSheet(QString("QLineEdit { color: %1; }").arg(color.name())); + text_color_ = color; + setStyleSheet(QString("QLineEdit { color: %1; }").arg(color.name())); } QColor TextField::textColor() const { - if (!text_color_.isValid()) { - return QColor("black"); - } + if (!text_color_.isValid()) { + return QColor("black"); + } - return text_color_; + return text_color_; } void TextField::setLabelColor(const QColor &color) { - label_color_ = color; + label_color_ = color; } QColor TextField::labelColor() const { - if (!label_color_.isValid()) { - return QColor("#abb"); // TODO: Move this into Theme.h - } + if (!label_color_.isValid()) { + return QColor("#abb"); // TODO: Move this into Theme.h + } - return label_color_; + return label_color_; } void TextField::setInkColor(const QColor &color) { - ink_color_ = color; + ink_color_ = color; } QColor TextField::inkColor() const { - if (!ink_color_.isValid()) { - return QColor("black"); - } + if (!ink_color_.isValid()) { + return QColor("black"); + } - return ink_color_; + return ink_color_; } void TextField::setUnderlineColor(const QColor &color) { - underline_color_ = color; + underline_color_ = color; } QColor TextField::underlineColor() const { - if (!underline_color_.isValid()) { - return QColor("black"); - } + if (!underline_color_.isValid()) { + return QColor("black"); + } - return underline_color_; + return underline_color_; } bool TextField::event(QEvent *event) { - switch (event->type()) { - case QEvent::Resize: - case QEvent::Move: { - if (label_) - label_->setGeometry(rect()); - break; - } - default: - break; - } + switch (event->type()) { + case QEvent::Resize: + case QEvent::Move: { + if (label_) + label_->setGeometry(rect()); + break; + } + default: + break; + } - return QLineEdit::event(event); + return QLineEdit::event(event); } void TextField::paintEvent(QPaintEvent *event) { - QLineEdit::paintEvent(event); + QLineEdit::paintEvent(event); - QPainter painter(this); + QPainter painter(this); - if (text().isEmpty()) { - painter.setOpacity(1 - state_machine_->progress()); - // painter.fillRect(rect(), parentWidget()->palette().color(backgroundRole())); - painter.fillRect(rect(), backgroundColor()); - } + if (text().isEmpty()) { + painter.setOpacity(1 - state_machine_->progress()); + // painter.fillRect(rect(), parentWidget()->palette().color(backgroundRole())); + painter.fillRect(rect(), backgroundColor()); + } - const int y = height() - 1; - const int wd = width() - 5; + const int y = height() - 1; + const int wd = width() - 5; - QPen pen; - pen.setWidth(1); - pen.setColor(underlineColor()); - painter.setPen(pen); - painter.setOpacity(1); - painter.drawLine(2, y, wd, y); + QPen pen; + pen.setWidth(1); + pen.setColor(underlineColor()); + painter.setPen(pen); + painter.setOpacity(1); + painter.drawLine(2, y, wd, y); - QBrush brush; - brush.setStyle(Qt::SolidPattern); - brush.setColor(inkColor()); + QBrush brush; + brush.setStyle(Qt::SolidPattern); + brush.setColor(inkColor()); - const qreal progress = state_machine_->progress(); + const qreal progress = state_machine_->progress(); - if (progress > 0) { - painter.setPen(Qt::NoPen); - painter.setBrush(brush); - const int w = (1 - progress) * static_cast(wd / 2); - painter.drawRect(w + 2.5, height() - 2, wd - 2 * w, 2); - } + if (progress > 0) { + painter.setPen(Qt::NoPen); + painter.setBrush(brush); + const int w = (1 - progress) * static_cast(wd / 2); + painter.drawRect(w + 2.5, height() - 2, wd - 2 * w, 2); + } } TextFieldStateMachine::TextFieldStateMachine(TextField *parent) : QStateMachine(parent) , text_field_(parent) { - normal_state_ = new QState; - focused_state_ = new QState; + normal_state_ = new QState; + focused_state_ = new QState; - label_ = 0; - offset_anim_ = 0; - color_anim_ = 0; - progress_ = 0.0; + label_ = 0; + offset_anim_ = 0; + color_anim_ = 0; + progress_ = 0.0; - addState(normal_state_); - addState(focused_state_); + addState(normal_state_); + addState(focused_state_); - setInitialState(normal_state_); + setInitialState(normal_state_); - QEventTransition *transition; - QPropertyAnimation *animation; + QEventTransition *transition; + QPropertyAnimation *animation; - transition = new QEventTransition(parent, QEvent::FocusIn); - transition->setTargetState(focused_state_); - normal_state_->addTransition(transition); + transition = new QEventTransition(parent, QEvent::FocusIn); + transition->setTargetState(focused_state_); + normal_state_->addTransition(transition); - animation = new QPropertyAnimation(this, "progress", this); - animation->setEasingCurve(QEasingCurve::InCubic); - animation->setDuration(310); - transition->addAnimation(animation); + animation = new QPropertyAnimation(this, "progress", this); + animation->setEasingCurve(QEasingCurve::InCubic); + animation->setDuration(310); + transition->addAnimation(animation); - transition = new QEventTransition(parent, QEvent::FocusOut); - transition->setTargetState(normal_state_); - focused_state_->addTransition(transition); + transition = new QEventTransition(parent, QEvent::FocusOut); + transition->setTargetState(normal_state_); + focused_state_->addTransition(transition); - animation = new QPropertyAnimation(this, "progress", this); - animation->setEasingCurve(QEasingCurve::OutCubic); - animation->setDuration(310); - transition->addAnimation(animation); + animation = new QPropertyAnimation(this, "progress", this); + animation->setEasingCurve(QEasingCurve::OutCubic); + animation->setDuration(310); + transition->addAnimation(animation); - normal_state_->assignProperty(this, "progress", 0); - focused_state_->assignProperty(this, "progress", 1); + normal_state_->assignProperty(this, "progress", 0); + focused_state_->assignProperty(this, "progress", 1); - setupProperties(); + setupProperties(); - connect(text_field_, SIGNAL(textChanged(QString)), this, SLOT(setupProperties())); + connect(text_field_, SIGNAL(textChanged(QString)), this, SLOT(setupProperties())); } TextFieldStateMachine::~TextFieldStateMachine() @@ -280,75 +280,76 @@ TextFieldStateMachine::~TextFieldStateMachine() void TextFieldStateMachine::setLabel(TextFieldLabel *label) { - if (label_) { - delete label_; - } + if (label_) { + delete label_; + } - if (offset_anim_) { - removeDefaultAnimation(offset_anim_); - delete offset_anim_; - } + if (offset_anim_) { + removeDefaultAnimation(offset_anim_); + delete offset_anim_; + } - if (color_anim_) { - removeDefaultAnimation(color_anim_); - delete color_anim_; - } + if (color_anim_) { + removeDefaultAnimation(color_anim_); + delete color_anim_; + } - label_ = label; + label_ = label; - if (label_) { - offset_anim_ = new QPropertyAnimation(label_, "offset", this); - offset_anim_->setDuration(210); - offset_anim_->setEasingCurve(QEasingCurve::OutCubic); - addDefaultAnimation(offset_anim_); + if (label_) { + offset_anim_ = new QPropertyAnimation(label_, "offset", this); + offset_anim_->setDuration(210); + offset_anim_->setEasingCurve(QEasingCurve::OutCubic); + addDefaultAnimation(offset_anim_); - color_anim_ = new QPropertyAnimation(label_, "color", this); - color_anim_->setDuration(210); - addDefaultAnimation(color_anim_); - } + color_anim_ = new QPropertyAnimation(label_, "color", this); + color_anim_->setDuration(210); + addDefaultAnimation(color_anim_); + } - setupProperties(); + setupProperties(); } void TextFieldStateMachine::setupProperties() { - if (label_) { - const int m = text_field_->textMargins().top(); + if (label_) { + const int m = text_field_->textMargins().top(); - if (text_field_->text().isEmpty()) { - normal_state_->assignProperty(label_, "offset", QPointF(0, 26)); - } else { - normal_state_->assignProperty(label_, "offset", QPointF(0, 0 - m)); - } + if (text_field_->text().isEmpty()) { + normal_state_->assignProperty(label_, "offset", QPointF(0, 26)); + } else { + normal_state_->assignProperty(label_, "offset", QPointF(0, 0 - m)); + } - focused_state_->assignProperty(label_, "offset", QPointF(0, 0 - m)); - focused_state_->assignProperty(label_, "color", text_field_->inkColor()); - normal_state_->assignProperty(label_, "color", text_field_->labelColor()); + focused_state_->assignProperty(label_, "offset", QPointF(0, 0 - m)); + focused_state_->assignProperty(label_, "color", text_field_->inkColor()); + normal_state_->assignProperty(label_, "color", text_field_->labelColor()); - if (0 != label_->offset().y() && !text_field_->text().isEmpty()) { - label_->setOffset(QPointF(0, 0 - m)); - } else if (!text_field_->hasFocus() && label_->offset().y() <= 0 && text_field_->text().isEmpty()) { - label_->setOffset(QPointF(0, 26)); - } - } + if (0 != label_->offset().y() && !text_field_->text().isEmpty()) { + label_->setOffset(QPointF(0, 0 - m)); + } else if (!text_field_->hasFocus() && label_->offset().y() <= 0 && + text_field_->text().isEmpty()) { + label_->setOffset(QPointF(0, 26)); + } + } - text_field_->update(); + text_field_->update(); } TextFieldLabel::TextFieldLabel(TextField *parent) : QWidget(parent) , text_field_(parent) { - x_ = 0; - y_ = 26; - scale_ = 1; - color_ = parent->labelColor(); + x_ = 0; + y_ = 26; + scale_ = 1; + color_ = parent->labelColor(); - QFontDatabase db; - QFont font(db.font("Open Sans", "Medium", parent->labelFontSize())); - font.setLetterSpacing(QFont::PercentageSpacing, 102); - setFont(font); + QFontDatabase db; + QFont font(db.font("Open Sans", "Medium", parent->labelFontSize())); + font.setLetterSpacing(QFont::PercentageSpacing, 102); + setFont(font); } TextFieldLabel::~TextFieldLabel() @@ -358,15 +359,15 @@ TextFieldLabel::~TextFieldLabel() void TextFieldLabel::paintEvent(QPaintEvent *) { - if (!text_field_->hasLabel()) - return; + if (!text_field_->hasLabel()) + return; - QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing); - painter.scale(scale_, scale_); - painter.setPen(color_); - painter.setOpacity(1); + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + painter.scale(scale_, scale_); + painter.setPen(color_); + painter.setOpacity(1); - QPointF pos(2 + x_, height() - 36 + y_); - painter.drawText(pos.x(), pos.y(), text_field_->label()); + QPointF pos(2 + x_, height() - 36 + y_); + painter.drawText(pos.x(), pos.y(), text_field_->label()); } diff --git a/src/ui/Theme.cc b/src/ui/Theme.cc index 328bd874..1560cf12 100644 --- a/src/ui/Theme.cc +++ b/src/ui/Theme.cc @@ -5,21 +5,21 @@ Theme::Theme(QObject *parent) : QObject(parent) { - setColor("Black", ui::Color::Black); + setColor("Black", ui::Color::Black); - setColor("BrightWhite", ui::Color::BrightWhite); - setColor("FadedWhite", ui::Color::FadedWhite); - setColor("MediumWhite", ui::Color::MediumWhite); + setColor("BrightWhite", ui::Color::BrightWhite); + setColor("FadedWhite", ui::Color::FadedWhite); + setColor("MediumWhite", ui::Color::MediumWhite); - setColor("BrightGreen", ui::Color::BrightGreen); - setColor("DarkGreen", ui::Color::DarkGreen); - setColor("LightGreen", ui::Color::LightGreen); + setColor("BrightGreen", ui::Color::BrightGreen); + setColor("DarkGreen", ui::Color::DarkGreen); + setColor("LightGreen", ui::Color::LightGreen); - setColor("Gray", ui::Color::Gray); - setColor("Red", ui::Color::Red); - setColor("Blue", ui::Color::Blue); + setColor("Gray", ui::Color::Gray); + setColor("Red", ui::Color::Red); + setColor("Blue", ui::Color::Blue); - setColor("Transparent", ui::Color::Transparent); + setColor("Transparent", ui::Color::Transparent); } Theme::~Theme() @@ -29,43 +29,43 @@ Theme::~Theme() QColor Theme::rgba(int r, int g, int b, qreal a) const { - QColor color(r, g, b); - color.setAlphaF(a); + QColor color(r, g, b); + color.setAlphaF(a); - return color; + return color; } QColor Theme::getColor(const QString &key) const { - if (!colors_.contains(key)) { - qWarning() << "Color with key" << key << "could not be found"; - return QColor(); - } + if (!colors_.contains(key)) { + qWarning() << "Color with key" << key << "could not be found"; + return QColor(); + } - return colors_.value(key); + return colors_.value(key); } void Theme::setColor(const QString &key, const QColor &color) { - colors_.insert(key, color); + colors_.insert(key, color); } void Theme::setColor(const QString &key, ui::Color color) { - static const QColor palette[] = { - QColor("#171919"), + static const QColor palette[] = { + QColor("#171919"), - QColor("#EBEBEB"), QColor("#C9C9C9"), QColor("#929292"), + QColor("#EBEBEB"), QColor("#C9C9C9"), QColor("#929292"), - QColor("#1C3133"), QColor("#577275"), QColor("#46A451"), + QColor("#1C3133"), QColor("#577275"), QColor("#46A451"), - QColor("#5D6565"), QColor("#E22826"), QColor("#81B3A9"), + QColor("#5D6565"), QColor("#E22826"), QColor("#81B3A9"), - rgba(0, 0, 0, 0), - }; + rgba(0, 0, 0, 0), + }; - colors_.insert(key, palette[static_cast(color)]); + colors_.insert(key, palette[static_cast(color)]); } diff --git a/src/ui/ThemeManager.cc b/src/ui/ThemeManager.cc index 021008b1..172ddc41 100644 --- a/src/ui/ThemeManager.cc +++ b/src/ui/ThemeManager.cc @@ -4,19 +4,19 @@ ThemeManager::ThemeManager() { - setTheme(new Theme); + setTheme(new Theme); } void ThemeManager::setTheme(Theme *theme) { - theme_ = theme; - theme_->setParent(this); + theme_ = theme; + theme_->setParent(this); } QColor ThemeManager::themeColor(const QString &key) const { - Q_ASSERT(theme_); - return theme_->getColor(key); + Q_ASSERT(theme_); + return theme_->getColor(key); }