init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
43
Telegram/ThirdParty/kcoreaddons/tests/faceicontest.cpp
vendored
Normal file
43
Telegram/ThirdParty/kcoreaddons/tests/faceicontest.cpp
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2014 Nicolás Alvarez <nicolas.alvarez@gmail.com>
|
||||
|
||||
SPDX-License-Identifier: LGPL-2.0-only
|
||||
*/
|
||||
|
||||
#include "faceicontest.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QListWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <kuser.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
FaceIconTest *mainWin = new FaceIconTest();
|
||||
mainWin->show();
|
||||
return app.exec();
|
||||
}
|
||||
FaceIconTest::FaceIconTest()
|
||||
{
|
||||
QVBoxLayout *layout = new QVBoxLayout(this);
|
||||
listWidget = new QListWidget(this);
|
||||
layout->addWidget(listWidget);
|
||||
|
||||
const QList<KUser> users = KUser::allUsers();
|
||||
for (const KUser &u : users) {
|
||||
QPixmap pixmap(u.faceIconPath());
|
||||
if (pixmap.isNull()) {
|
||||
pixmap = QPixmap(QSize(48, 48));
|
||||
pixmap.fill();
|
||||
} else {
|
||||
pixmap = pixmap.scaled(48, 48, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
}
|
||||
|
||||
QListWidgetItem *item = new QListWidgetItem(u.loginName(), listWidget);
|
||||
item->setData(Qt::DecorationRole, pixmap);
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_faceicontest.cpp"
|
||||
Reference in New Issue
Block a user