Alright, I found out what style the menubar was using by calling metaObject()->className() on it. It was QPlastiqueStyle,,
so I replaced the style with an instance of the class below:
{
Q_OBJECT
public:
int pixelMetric
(PixelMetric metric,
const QStyleOption * option
= 0,
const QWidget * widget
= 0 ) const { if (metric
== QStyle::PM_SmallIconSize) { s = 20;
}
return s;
}
};
class myStyle: public QPlastiqueStyle
{
Q_OBJECT
public:
int pixelMetric(PixelMetric metric, const QStyleOption * option = 0, const QWidget * widget = 0 ) const {
int s = QPlastiqueStyle::pixelMetric(metric, option, widget);
if (metric == QStyle::PM_SmallIconSize) {
s = 20;
}
return s;
}
};
To copy to clipboard, switch view to plain text mode
Small icons can now be upto 20x20 pixels instead of 16x16. And it works!
But one thing still bothers me, I had to hardcode "QPlastiqueStyle". What if another style had been specified on the commandline? Is there a way to modify the behaviour of the current style rather than forcing in a specific style?
Bookmarks