|
|
@ -3,6 +3,8 @@ |
|
|
|
#include <Cache.h> |
|
|
|
#include <Cache.h> |
|
|
|
#include <MatrixClient.h> |
|
|
|
#include <MatrixClient.h> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "CompletionModelRoles.h" |
|
|
|
|
|
|
|
|
|
|
|
using namespace emoji; |
|
|
|
using namespace emoji; |
|
|
|
|
|
|
|
|
|
|
|
QHash<int, QByteArray> |
|
|
|
QHash<int, QByteArray> |
|
|
@ -35,10 +37,12 @@ EmojiModel::data(const QModelIndex &index, int role) const |
|
|
|
if (hasIndex(index.row(), index.column(), index.parent())) { |
|
|
|
if (hasIndex(index.row(), index.column(), index.parent())) { |
|
|
|
switch (role) { |
|
|
|
switch (role) { |
|
|
|
case Qt::DisplayRole: |
|
|
|
case Qt::DisplayRole: |
|
|
|
|
|
|
|
case CompletionModel::CompletionRole: |
|
|
|
case static_cast<int>(EmojiModel::Roles::Unicode): |
|
|
|
case static_cast<int>(EmojiModel::Roles::Unicode): |
|
|
|
return Provider::emoji[index.row()].unicode; |
|
|
|
return Provider::emoji[index.row()].unicode; |
|
|
|
|
|
|
|
|
|
|
|
case Qt::ToolTipRole: |
|
|
|
case Qt::ToolTipRole: |
|
|
|
|
|
|
|
case CompletionModel::SearchRole: |
|
|
|
case static_cast<int>(EmojiModel::Roles::ShortName): |
|
|
|
case static_cast<int>(EmojiModel::Roles::ShortName): |
|
|
|
return Provider::emoji[index.row()].shortName; |
|
|
|
return Provider::emoji[index.row()].shortName; |
|
|
|
|
|
|
|
|
|
|
|