Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KPimTextEdit
Commits
83ca52c5
Commit
83ca52c5
authored
Sep 16, 2021
by
Laurent Montel
😁
Browse files
Rename model
parent
2e2b8792
Pipeline
#80937
passed with stage
in 8 minutes and 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/emoticon/emoticonunicodetab.cpp
View file @
83ca52c5
...
...
@@ -16,8 +16,11 @@
using
namespace
KPIMTextEdit
;
EmoticonUnicodeTab
::
EmoticonUnicodeTab
(
QWidget
*
parent
)
:
QTabWidget
(
parent
)
,
mEmoticonUnicodeModel
(
new
EmoticonUnicodeModel
(
this
))
{
mEmoticonUnicodeModel
->
setEmoticonList
(
EmoticonUnicodeUtils
::
allUnicode
());
setTabBarAutoHide
(
true
);
loadEmoticons
();
QFont
f
;
f
.
setPointSize
(
22
);
...
...
@@ -36,17 +39,15 @@ void EmoticonUnicodeTab::searchUnicode(const QString &str)
if
(
searchVisible
)
{
setCurrentIndex
(
mSearchTabIndex
);
}
mEmoticonUnicodeProxyModel
->
setFilterFixedString
(
str
);
mEmoticonUnicode
Search
ProxyModel
->
setFilterFixedString
(
str
);
}
void
EmoticonUnicodeTab
::
createSearchTab
()
{
auto
allEmojisView
=
new
EmoticonListView
(
this
);
auto
emoticonModel
=
new
EmoticonUnicodeModel
(
this
);
mEmoticonUnicodeProxyModel
=
new
EmoticonUnicodeProxyModel
(
this
);
mEmoticonUnicodeProxyModel
->
setSourceModel
(
emoticonModel
);
emoticonModel
->
setEmoticonList
(
EmoticonUnicodeUtils
::
allUnicode
());
allEmojisView
->
setModel
(
mEmoticonUnicodeProxyModel
);
mEmoticonUnicodeSearchProxyModel
=
new
EmoticonUnicodeProxyModel
(
this
);
mEmoticonUnicodeSearchProxyModel
->
setSourceModel
(
mEmoticonUnicodeModel
);
allEmojisView
->
setModel
(
mEmoticonUnicodeSearchProxyModel
);
mSearchTabIndex
=
addTab
(
allEmojisView
,
i18n
(
"Search"
));
connect
(
allEmojisView
,
&
KPIMTextEdit
::
EmoticonListView
::
emojiItemSelected
,
this
,
&
EmoticonUnicodeTab
::
itemSelected
);
}
...
...
src/emoticon/emoticonunicodetab.h
View file @
83ca52c5
...
...
@@ -14,6 +14,7 @@
namespace
KPIMTextEdit
{
class
EmoticonUnicodeProxyModel
;
class
EmoticonUnicodeModel
;
/**
* @brief The EmoticonUnicodeTab class
* @author Laurent Montel <montel@kde.org>
...
...
@@ -34,7 +35,8 @@ Q_SIGNALS:
private:
void
createPlainTextEmoticonTab
(
const
QString
&
str
,
const
QVector
<
EmoticonUnicodeUtils
::
EmoticonStruct
>
&
emoticons
);
void
createSearchTab
();
EmoticonUnicodeProxyModel
*
mEmoticonUnicodeProxyModel
=
nullptr
;
EmoticonUnicodeModel
*
const
mEmoticonUnicodeModel
;
EmoticonUnicodeProxyModel
*
mEmoticonUnicodeSearchProxyModel
=
nullptr
;
int
mSearchTabIndex
=
-
1
;
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment