forked from dridk/QFontIcon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
35 lines (26 loc) · 781 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <QApplication>
#include <QtWidgets>
#include "qfonticon.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QFontIcon::addFont(":/fontawesome.ttf");
QGridLayout * iconsLayout = new QGridLayout;
QWidget * iconsWidget = new QWidget;
iconsWidget->setWindowTitle("Some icons from awesome font");
iconsWidget->setLayout(iconsLayout);
int code = 0xf030;
for (int x=0; x<10; x++)
{
for (int y=0;y<10; y++)
{
QPushButton * button = new QPushButton(QFontIcon::icon(code),QString::number(code));
iconsLayout->addWidget(button,x,y);
if (y == 5)
button->setDisabled(true);
code++;
}
}
iconsWidget->show();
return a.exec();
}