前言
Qt内置图标封装在QStyle中,大概有70多个,可以用来美化丰富UI界面。但是Qt中只有图标的文字描述,想使用时无法精准找到,这篇文章运行出各图标,制作表格,便利下次使用查找。
学习自:飞扬青云Qt开发经验
代码
QPixmap icon = this->style()->standardPixmap(QStyle::SP_DesktopIcon);
icon = icon.scaled(200,200,Qt::IgnoreAspectRatio);
ui->label->setPixmap(icon);
0 | QStyle::SP_TitleBarMenuButton | ![]() | Menu button on a title bar. |
---|---|---|---|
1 | QStyle::SP_TitleBarMinButton | ![]() | Minimize button on title bars (e.g., in QMdiSubWindow). |
2 | QStyle::SP_TitleBarMaxButton | ![]() | Maximize button on title bars. |
3 | QStyle::SP_TitleBarCloseButton | ![]() | Close button on title bars. |
4 | QStyle::SP_TitleBarNormalButton | ![]() | Normal (restore) button on title bars. |
5 | QStyle::SP_TitleBarShadeButton | ![]() | Shade button on title bars. |
6 | QStyle::SP_TitleBarUnshadeButton | ![]() | Unshade button on title bars. |
7 | QStyle::SP_TitleBarContextHelpButton | ![]() | The Context help button on title bars. |
8 | QStyle::SP_DockWidgetCloseButton | ![]() | Close button on dock windows (see also QDockWidget). |
9 | QStyle::SP_MessageBoxInformation | ![]() | The "information" icon. |
10 | QStyle::SP_MessageBoxWarning | ![]() | The "warning" icon. |