如何在PyQt4中修改QAction图标大小?
我试过这样做:
自定义类:
class MyStyle(QCommonStyle):
def pixelMetric(self, QStyle_PixelMetric, QStyleOption_option=None, QWidget_widget=None):
if QStyle_PixelMetric == QStyle.PM_SmallIconSize:
return 30
return QCommonStyle.pixelMetric(self, QStyle_PixelMetric, QStyleOption_option, QWidget_widget)
其余代码:
self.popMenu = QMenu(parent)
self.popMenu.setStyle(MyStyle())