Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
4c418bc9
Commit
4c418bc9
authored
Feb 02, 2015
by
poixen
Browse files
Merge pull request #654 from poixen/chat_buddy_stars
Buddy stars
parents
72d1b211
d57a6111
Changes
12
Hide whitespace changes
Inline
Side-by-side
cockatrice/cockatrice.qrc
View file @
4c418bc9
...
...
@@ -320,8 +320,11 @@
<file>resources/userlevels/normal.svg</file>
<file>resources/userlevels/registered.svg</file>
<file>resources/userlevels/registered_buddy.svg</file>
<file>resources/userlevels/moderator.svg</file>
<file>resources/userlevels/moderator_buddy.svg</file>
<file>resources/userlevels/admin.svg</file>
<file>resources/userlevels/admin_buddy.svg</file>
<file>resources/news/exclamation_mark.svg</file>
<file>resources/news/question_mark.svg</file>
...
...
cockatrice/resources/userlevels/admin_buddy.svg
0 → 100644
View file @
4c418bc9
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb=
"http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:cc=
"http://creativecommons.org/ns#"
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xmlns:sodipodi=
"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape=
"http://www.inkscape.org/namespaces/inkscape"
viewBox=
"0 0 64 64"
enable-background=
"new 0 0 64 64"
id=
"svg2"
version=
"1.1"
inkscape:version=
"0.48.5 r10040"
width=
"100%"
height=
"100%"
sodipodi:docname=
"admin_buddy.svg"
>
<metadata
id=
"metadata12"
>
<rdf:RDF>
<cc:Work
rdf:about=
""
>
<dc:format>
image/svg+xml
</dc:format>
<dc:type
rdf:resource=
"http://purl.org/dc/dcmitype/StillImage"
/>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id=
"defs10"
>
<linearGradient
id=
"linearGradient5225"
>
<stop
style=
"stop-color:#ffffff;stop-opacity:1;"
offset=
"0"
id=
"stop5227"
/>
<stop
style=
"stop-color:#ffffff;stop-opacity:0;"
offset=
"1"
id=
"stop5229"
/>
</linearGradient>
<linearGradient
id=
"linearGradient5219"
osb:paint=
"solid"
>
<stop
style=
"stop-color:#ffffff;stop-opacity:1;"
offset=
"0"
id=
"stop5221"
/>
</linearGradient>
<linearGradient
id=
"linearGradient3758"
>
<stop
id=
"stop3760"
offset=
"0"
style=
"stop-color:#0fbb00;stop-opacity:1;"
/>
<stop
id=
"stop3762"
offset=
"1"
style=
"stop-color:#064400;stop-opacity:1;"
/>
</linearGradient>
<linearGradient
id=
"linearGradient3750"
>
<stop
style=
"stop-color:#ece400;stop-opacity:1;"
offset=
"0"
id=
"stop3752"
/>
<stop
style=
"stop-color:#ece400;stop-opacity:0;"
offset=
"1"
id=
"stop3754"
/>
</linearGradient>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient3758-7"
id=
"linearGradient3756-1"
x1=
"1.960216"
y1=
"31.261461"
x2=
"60.456024"
y2=
"31.261461"
gradientUnits=
"userSpaceOnUse"
/>
<linearGradient
id=
"linearGradient3758-7"
>
<stop
id=
"stop3760-4"
offset=
"0"
style=
"stop-color:#ece400;stop-opacity:1;"
/>
<stop
id=
"stop3762-0"
offset=
"1"
style=
"stop-color:#ec8b00;stop-opacity:1;"
/>
</linearGradient>
</defs>
<sodipodi:namedview
pagecolor=
"#ffffff"
bordercolor=
"#666666"
borderopacity=
"1"
objecttolerance=
"10"
gridtolerance=
"10"
guidetolerance=
"10"
inkscape:pageopacity=
"0"
inkscape:pageshadow=
"2"
inkscape:window-width=
"1920"
inkscape:window-height=
"1028"
id=
"namedview8"
showgrid=
"false"
inkscape:zoom=
"5.2149125"
inkscape:cx=
"21.988178"
inkscape:cy=
"51.245759"
inkscape:window-x=
"-8"
inkscape:window-y=
"-8"
inkscape:window-maximized=
"1"
inkscape:current-layer=
"svg2"
/>
<path
d=
"M 61.442826,23.621762 38.532402,23.515555 31.556101,0.331013 24.578789,23.515555 1.6673502,23.621765 20.267785,38.422001 10.863888,63.668987 31.556101,47.626631 52.258426,63.668987 42.843404,38.422001 z"
id=
"path4-9"
style=
"fill:#000000;fill-opacity:1"
inkscape:connector-curvature=
"0"
/>
<path
d=
"M 57.150089,25.064396 37.504323,24.973324 31.522122,5.092503 25.539054,24.973324 5.8924192,25.064399 21.842354,37.75565 13.778482,59.405024 31.522122,45.64865 49.274434,59.405024 41.201022,37.75565 z"
id=
"path4"
style=
"fill:#ff0000;fill-opacity:1;fill-rule:nonzero"
inkscape:connector-curvature=
"0"
/>
</svg>
cockatrice/resources/userlevels/moderator_buddy.svg
0 → 100644
View file @
4c418bc9
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb=
"http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:cc=
"http://creativecommons.org/ns#"
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xmlns:sodipodi=
"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape=
"http://www.inkscape.org/namespaces/inkscape"
viewBox=
"0 0 64 64"
enable-background=
"new 0 0 64 64"
id=
"svg2"
version=
"1.1"
inkscape:version=
"0.48.5 r10040"
width=
"100%"
height=
"100%"
sodipodi:docname=
"registered_buddy - Copy.svg"
>
<metadata
id=
"metadata12"
>
<rdf:RDF>
<cc:Work
rdf:about=
""
>
<dc:format>
image/svg+xml
</dc:format>
<dc:type
rdf:resource=
"http://purl.org/dc/dcmitype/StillImage"
/>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id=
"defs10"
>
<pattern
inkscape:stockid=
"Stripes 1:1 white"
id=
"Strips1_1white"
patternTransform=
"translate(0,0) scale(10,10)"
height=
"1"
width=
"2"
patternUnits=
"userSpaceOnUse"
inkscape:collect=
"always"
>
<rect
id=
"rect4484"
height=
"2"
width=
"1"
y=
"-0.5"
x=
"0"
style=
"fill:white;stroke:none"
/>
</pattern>
<linearGradient
id=
"linearGradient5225"
>
<stop
style=
"stop-color:#ffffff;stop-opacity:1;"
offset=
"0"
id=
"stop5227"
/>
<stop
style=
"stop-color:#ffffff;stop-opacity:0;"
offset=
"1"
id=
"stop5229"
/>
</linearGradient>
<linearGradient
id=
"linearGradient5219"
osb:paint=
"solid"
>
<stop
style=
"stop-color:#ffffff;stop-opacity:1;"
offset=
"0"
id=
"stop5221"
/>
</linearGradient>
<linearGradient
id=
"linearGradient3758"
>
<stop
id=
"stop3760"
offset=
"0"
style=
"stop-color:#0fbb00;stop-opacity:1;"
/>
<stop
id=
"stop3762"
offset=
"1"
style=
"stop-color:#064400;stop-opacity:1;"
/>
</linearGradient>
<linearGradient
id=
"linearGradient3750"
>
<stop
style=
"stop-color:#ece400;stop-opacity:1;"
offset=
"0"
id=
"stop3752"
/>
<stop
style=
"stop-color:#ece400;stop-opacity:0;"
offset=
"1"
id=
"stop3754"
/>
</linearGradient>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient3758-7"
id=
"linearGradient3756-1"
x1=
"1.960216"
y1=
"31.261461"
x2=
"60.456024"
y2=
"31.261461"
gradientUnits=
"userSpaceOnUse"
/>
<linearGradient
id=
"linearGradient3758-7"
>
<stop
id=
"stop3760-4"
offset=
"0"
style=
"stop-color:#ece400;stop-opacity:1;"
/>
<stop
id=
"stop3762-0"
offset=
"1"
style=
"stop-color:#ec8b00;stop-opacity:1;"
/>
</linearGradient>
</defs>
<sodipodi:namedview
pagecolor=
"#ffffff"
bordercolor=
"#666666"
borderopacity=
"1"
objecttolerance=
"10"
gridtolerance=
"10"
guidetolerance=
"10"
inkscape:pageopacity=
"0"
inkscape:pageshadow=
"2"
inkscape:window-width=
"1920"
inkscape:window-height=
"1028"
id=
"namedview8"
showgrid=
"false"
inkscape:zoom=
"5.2149125"
inkscape:cx=
"51.90239"
inkscape:cy=
"51.245759"
inkscape:window-x=
"-8"
inkscape:window-y=
"-8"
inkscape:window-maximized=
"1"
inkscape:current-layer=
"svg2"
/>
<path
d=
"M 61.442826,23.621762 38.532402,23.515555 31.556101,0.331013 24.578789,23.515555 1.6673502,23.621765 20.267785,38.422001 10.863888,63.668987 31.556101,47.626631 52.258426,63.668987 42.843404,38.422001 z"
id=
"path4-9"
style=
"fill:#000000;fill-opacity:1"
inkscape:connector-curvature=
"0"
/>
<path
d=
"M 57.150089,25.064396 37.504323,24.973324 31.522122,5.092503 25.539054,24.973324 5.8924192,25.064399 21.842354,37.75565 13.778482,59.405024 31.522122,45.64865 49.274434,59.405024 41.201022,37.75565 z"
id=
"path4"
style=
"fill:#ffffff;fill-opacity:1;fill-rule:nonzero"
inkscape:connector-curvature=
"0"
/>
<path
d=
"M 57.165891,25.072777 37.520125,24.981707 31.537924,5.1008868 c 0.05101,40.5880862 0.05344,-0.1118618 0,40.5561512 L 49.290236,59.413412 41.216824,37.764038 z"
id=
"path4-1"
style=
"fill:#000000;fill-opacity:1;fill-rule:nonzero"
inkscape:connector-curvature=
"0"
sodipodi:nodetypes=
"ccccccc"
/>
</svg>
cockatrice/resources/userlevels/registered_buddy.svg
0 → 100644
View file @
4c418bc9
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:cc=
"http://creativecommons.org/ns#"
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
xmlns:sodipodi=
"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape=
"http://www.inkscape.org/namespaces/inkscape"
viewBox=
"0 0 64 64"
enable-background=
"new 0 0 64 64"
id=
"svg2"
version=
"1.1"
inkscape:version=
"0.48.5 r10040"
width=
"100%"
height=
"100%"
sodipodi:docname=
"buddy_icon.svg"
>
<metadata
id=
"metadata12"
>
<rdf:RDF>
<cc:Work
rdf:about=
""
>
<dc:format>
image/svg+xml
</dc:format>
<dc:type
rdf:resource=
"http://purl.org/dc/dcmitype/StillImage"
/>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id=
"defs10"
>
<linearGradient
id=
"linearGradient3758"
>
<stop
id=
"stop3760"
offset=
"0"
style=
"stop-color:#0fbb00;stop-opacity:1;"
/>
<stop
id=
"stop3762"
offset=
"1"
style=
"stop-color:#064400;stop-opacity:1;"
/>
</linearGradient>
<linearGradient
id=
"linearGradient3750"
>
<stop
style=
"stop-color:#ece400;stop-opacity:1;"
offset=
"0"
id=
"stop3752"
/>
<stop
style=
"stop-color:#ece400;stop-opacity:0;"
offset=
"1"
id=
"stop3754"
/>
</linearGradient>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient3758"
id=
"linearGradient3756"
x1=
"1.960216"
y1=
"31.261461"
x2=
"60.456024"
y2=
"31.261461"
gradientUnits=
"userSpaceOnUse"
gradientTransform=
"matrix(0.87626222,0,0,0.87626222,4.174756,4.8555263)"
/>
<linearGradient
inkscape:collect=
"always"
xlink:href=
"#linearGradient3758-7"
id=
"linearGradient3756-1"
x1=
"1.960216"
y1=
"31.261461"
x2=
"60.456024"
y2=
"31.261461"
gradientUnits=
"userSpaceOnUse"
/>
<linearGradient
id=
"linearGradient3758-7"
>
<stop
id=
"stop3760-4"
offset=
"0"
style=
"stop-color:#ece400;stop-opacity:1;"
/>
<stop
id=
"stop3762-0"
offset=
"1"
style=
"stop-color:#ec8b00;stop-opacity:1;"
/>
</linearGradient>
</defs>
<sodipodi:namedview
pagecolor=
"#ffffff"
bordercolor=
"#666666"
borderopacity=
"1"
objecttolerance=
"10"
gridtolerance=
"10"
guidetolerance=
"10"
inkscape:pageopacity=
"0"
inkscape:pageshadow=
"2"
inkscape:window-width=
"1600"
inkscape:window-height=
"1178"
id=
"namedview8"
showgrid=
"false"
inkscape:zoom=
"7.375"
inkscape:cx=
"-14.986549"
inkscape:cy=
"23.31428"
inkscape:window-x=
"1912"
inkscape:window-y=
"227"
inkscape:window-maximized=
"1"
inkscape:current-layer=
"svg2"
/>
<path
d=
"M 61.442826,23.621762 38.532402,23.515555 31.556101,0.331013 24.578789,23.515555 1.6673502,23.621765 20.267785,38.422001 10.863888,63.668987 31.556101,47.626631 52.258426,63.668987 42.843404,38.422001 z"
id=
"path4-9"
style=
"fill:#000000;fill-opacity:1"
inkscape:connector-curvature=
"0"
/>
<path
d=
"M 57.150089,25.064396 37.504323,24.973324 31.522122,5.092503 25.539054,24.973324 5.8924192,25.064399 21.842354,37.75565 13.778482,59.405024 31.522122,45.64865 49.274434,59.405024 41.201022,37.75565 z"
id=
"path4"
style=
"fill:url(#linearGradient3756);fill-opacity:1"
inkscape:connector-curvature=
"0"
/>
</svg>
cockatrice/src/chatview.cpp
View file @
4c418bc9
...
...
@@ -4,6 +4,7 @@
#include
<QMouseEvent>
#include
<QDesktopServices>
#include
<QApplication>
#include
<QDebug>
#include
"chatview.h"
#include
"user_level.h"
#include
"user_context_menu.h"
...
...
@@ -128,7 +129,8 @@ void ChatView::appendMessage(QString message, QString sender, UserLevelFlags use
if
(
!
sameSender
)
{
if
(
!
sender
.
isEmpty
())
{
const
int
pixelSize
=
QFontInfo
(
cursor
.
charFormat
().
font
()).
pixelSize
();
cursor
.
insertImage
(
UserLevelPixmapGenerator
::
generatePixmap
(
pixelSize
,
userLevel
).
toImage
(),
QString
::
number
(
pixelSize
)
+
"_"
+
QString
::
number
((
int
)
userLevel
));
QMap
<
QString
,
UserListTWI
*>
buddyList
=
tabSupervisor
->
getUserListsTab
()
->
getBuddyList
()
->
getUsers
();
cursor
.
insertImage
(
UserLevelPixmapGenerator
::
generatePixmap
(
pixelSize
,
userLevel
,
buddyList
.
contains
(
sender
)).
toImage
());
cursor
.
insertText
(
" "
);
}
cursor
.
setCharFormat
(
senderFormat
);
...
...
cockatrice/src/gamesmodel.cpp
View file @
4c418bc9
...
...
@@ -115,7 +115,7 @@ QVariant GamesModel::data(const QModelIndex &index, int role) const
case
Qt
::
DisplayRole
:
return
QString
::
fromStdString
(
g
.
creator_info
().
name
());
case
Qt
::
DecorationRole
:
{
QPixmap
avatarPixmap
=
UserLevelPixmapGenerator
::
generatePixmap
(
13
,
(
UserLevelFlags
)
g
.
creator_info
().
user_level
());
QPixmap
avatarPixmap
=
UserLevelPixmapGenerator
::
generatePixmap
(
13
,
(
UserLevelFlags
)
g
.
creator_info
().
user_level
()
,
false
);
return
QIcon
(
avatarPixmap
);
}
default:
...
...
cockatrice/src/pixmapgenerator.cpp
View file @
4c418bc9
...
...
@@ -134,12 +134,13 @@ QPixmap CountryPixmapGenerator::generatePixmap(int height, const QString &countr
QMap
<
QString
,
QPixmap
>
CountryPixmapGenerator
::
pmCache
;
QPixmap
UserLevelPixmapGenerator
::
generatePixmap
(
int
height
,
UserLevelFlags
userLevel
)
QPixmap
UserLevelPixmapGenerator
::
generatePixmap
(
int
height
,
UserLevelFlags
userLevel
,
bool
isBuddy
)
{
int
key
=
height
*
10000
+
(
int
)
userLevel
;
int
key
=
height
*
10000
+
(
int
)
userLevel
+
(
int
)
isBuddy
;
if
(
pmCache
.
contains
(
key
))
return
pmCache
.
value
(
key
);
QString
levelString
;
if
(
userLevel
.
testFlag
(
ServerInfo_User
::
IsAdmin
))
levelString
=
"admin"
;
...
...
@@ -149,13 +150,17 @@ QPixmap UserLevelPixmapGenerator::generatePixmap(int height, UserLevelFlags user
levelString
=
"registered"
;
else
levelString
=
"normal"
;
if
(
isBuddy
)
levelString
.
append
(
"_buddy"
);
QSvgRenderer
svg
(
QString
(
":/resources/userlevels/"
+
levelString
+
".svg"
));
int
width
=
(
int
)
round
(
height
*
(
double
)
svg
.
defaultSize
().
width
()
/
(
double
)
svg
.
defaultSize
().
height
());
QPixmap
pixmap
(
width
,
height
);
pixmap
.
fill
(
Qt
::
transparent
);
QPainter
painter
(
&
pixmap
);
svg
.
render
(
&
painter
,
QRectF
(
0
,
0
,
width
,
height
));
pmCache
.
insert
(
key
,
pixmap
);
return
pixmap
;
}
...
...
cockatrice/src/pixmapgenerator.h
View file @
4c418bc9
...
...
@@ -50,7 +50,7 @@ class UserLevelPixmapGenerator {
private:
static
QMap
<
int
,
QPixmap
>
pmCache
;
public:
static
QPixmap
generatePixmap
(
int
height
,
UserLevelFlags
userLevel
);
static
QPixmap
generatePixmap
(
int
height
,
UserLevelFlags
userLevel
,
bool
isBuddy
);
static
void
clear
()
{
pmCache
.
clear
();
}
};
...
...
cockatrice/src/playerlistwidget.cpp
View file @
4c418bc9
...
...
@@ -118,7 +118,7 @@ void PlayerListWidget::updatePlayerProperties(const ServerInfo_PlayerProperties
player
->
setIcon
(
2
,
gameStarted
?
(
prop
.
conceded
()
?
concededIcon
:
QIcon
())
:
(
prop
.
ready_start
()
?
readyIcon
:
notReadyIcon
));
if
(
prop
.
has_user_info
())
{
player
->
setData
(
3
,
Qt
::
UserRole
,
prop
.
user_info
().
user_level
());
player
->
setIcon
(
3
,
QIcon
(
UserLevelPixmapGenerator
::
generatePixmap
(
12
,
UserLevelFlags
(
prop
.
user_info
().
user_level
()))));
player
->
setIcon
(
3
,
QIcon
(
UserLevelPixmapGenerator
::
generatePixmap
(
12
,
UserLevelFlags
(
prop
.
user_info
().
user_level
())
,
false
)));
player
->
setText
(
4
,
QString
::
fromStdString
(
prop
.
user_info
().
name
()));
const
QString
country
=
QString
::
fromStdString
(
prop
.
user_info
().
country
());
if
(
!
country
.
isEmpty
())
...
...
cockatrice/src/playertarget.cpp
View file @
4c418bc9
...
...
@@ -98,7 +98,7 @@ void PlayerTarget::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*o
QPixmap
tempPixmap
;
if
(
fullPixmap
.
isNull
())
tempPixmap
=
UserLevelPixmapGenerator
::
generatePixmap
(
translatedSize
.
height
(),
UserLevelFlags
(
info
->
user_level
()));
tempPixmap
=
UserLevelPixmapGenerator
::
generatePixmap
(
translatedSize
.
height
(),
UserLevelFlags
(
info
->
user_level
())
,
false
);
else
tempPixmap
=
fullPixmap
.
scaled
(
translatedSize
,
Qt
::
KeepAspectRatio
,
Qt
::
SmoothTransformation
);
...
...
cockatrice/src/userinfobox.cpp
View file @
4c418bc9
...
...
@@ -60,7 +60,7 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user)
QPixmap
avatarPixmap
;
const
std
::
string
bmp
=
user
.
avatar_bmp
();
if
(
!
avatarPixmap
.
loadFromData
((
const
uchar
*
)
bmp
.
data
(),
bmp
.
size
()))
avatarPixmap
=
UserLevelPixmapGenerator
::
generatePixmap
(
64
,
userLevel
);
avatarPixmap
=
UserLevelPixmapGenerator
::
generatePixmap
(
64
,
userLevel
,
false
);
avatarLabel
.
setPixmap
(
avatarPixmap
);
nameLabel
.
setText
(
QString
::
fromStdString
(
user
.
name
()));
...
...
@@ -69,7 +69,7 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user)
QString
country
=
QString
::
fromStdString
(
user
.
country
());
countryLabel2
.
setPixmap
(
CountryPixmapGenerator
::
generatePixmap
(
15
,
country
));
countryLabel3
.
setText
(
QString
(
"(%1)"
).
arg
(
country
.
toUpper
()));
userLevelLabel2
.
setPixmap
(
UserLevelPixmapGenerator
::
generatePixmap
(
15
,
userLevel
));
userLevelLabel2
.
setPixmap
(
UserLevelPixmapGenerator
::
generatePixmap
(
15
,
userLevel
,
false
));
QString
userLevelText
;
if
(
userLevel
.
testFlag
(
ServerInfo_User
::
IsAdmin
))
userLevelText
=
tr
(
"Administrator"
);
...
...
cockatrice/src/userlist.cpp
View file @
4c418bc9
...
...
@@ -181,7 +181,7 @@ void UserListTWI::setUserInfo(const ServerInfo_User &_userInfo)
userInfo
=
_userInfo
;
setData
(
0
,
Qt
::
UserRole
,
userInfo
.
user_level
());
setIcon
(
0
,
QIcon
(
UserLevelPixmapGenerator
::
generatePixmap
(
12
,
UserLevelFlags
(
userInfo
.
user_level
()))));
setIcon
(
0
,
QIcon
(
UserLevelPixmapGenerator
::
generatePixmap
(
12
,
UserLevelFlags
(
userInfo
.
user_level
())
,
false
)));
setIcon
(
1
,
QIcon
(
CountryPixmapGenerator
::
generatePixmap
(
12
,
QString
::
fromStdString
(
userInfo
.
country
()))));
setData
(
2
,
Qt
::
UserRole
,
QString
::
fromStdString
(
userInfo
.
name
()));
setData
(
2
,
Qt
::
DisplayRole
,
QString
::
fromStdString
(
userInfo
.
name
()));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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