本页内容

QIconEngine::ScaledPixmapArgument Struct

struct QIconEngine::ScaledPixmapArgument

公共变量

QIcon::Mode mode
QPixmap pixmap
qreal scale
QSize size
QIcon::State state

详细说明

当 `id ` 参数为 `QIconEngine::ScaledPixmapHook` 时,该结构体表示传递给 `virtual_hook()` 函数的参数。

该结构体为通过QIcon::fromTheme() 创建的图标提供了一种方法,使其能够返回专为当前设备像素比例设计的位图。此类图标的缩放比例通过相应的index.theme 文件中的Scale 目录键指定。

通过其他方法创建的图标将返回与调用pixmap() 相同的结果,并继续受益于 Qt XML 的"@nx" high DPI syntax 。

另请参阅 virtual_hook()、QIconEngine::IconEngineHook 以及High DPI Icons 。

成员变量文档

QIcon::Mode ScaledPixmapArgument::mode

该变量存储了像素图的请求模式。

另请参阅 QIcon::Mode 。

QPixmap ScaledPixmapArgument::pixmap

该变量存储与给定的size 、mode 、state 和scale 最匹配的像素图。这是一个输出参数,在调用virtual_hook()后会被设置。

qreal ScaledPixmapArgument::scale

该变量存储了像素图的请求比例。

QSize ScaledPixmapArgument::size

该变量存储了像素图的请求大小。

QIcon::State ScaledPixmapArgument::state

该变量存储了像素图的请求状态。

另请参阅 QIcon::State 。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.