Change trinagle in the menu button
-
You could try creating a [[doc:QProxyStyle]] and reimplementing QStyle::standardItemImplementation() to return whatever you need when the SP_ArrowDown pixmap is requested. However, I am not sure that this is actually used by all styles, nor that this is the right pixmap. YMMV
-
I think he means "standardIconImplementation":http://developer.qt.nokia.com/doc/qt-4.8/qstyle.html#standardIconImplementation
-
Hello
I have a similar problem.
You need to replace the standard icon, on the otherI created a new class inherited from QProxyStyle and redefined method standardIconImplementation, but for some reason I will not have changed...
@class CustomStyle :
public QProxyStyle
{
Q_OBJECT
public:
CustomStyle();protected slots:
QIcon standardIconImplementation(StandardPixmap standardIcon,
const QStyleOption *option,
const QWidget *widget) const;
};
@
and the implementation itself
@QIcon CustomStyle::standardIconImplementation(StandardPixmap standardIcon,
const QStyleOption *option,
const QWidget *widget) const
{
switch(standardIcon)
{
case QStyle::SP_TitleBarMenuButton:
return QIcon(":/image/circle_middle.png");
case QStyle::SP_ArrowDown:
return QIcon(":/image/circle_middle.png");
case QStyle::SP_CommandLink:
return QIcon(":/image/circle_middle.png");
}
return QProxyStyle::standardIconImplementation(standardIcon, option, widget);}
@ -
In the debugger, there is some reason only one event where:
standardIcon = QStyle:: SP_CommandLink (56)
and nothing else happens, comes only once in the function
@QIcon CustomStyle::standardIconImplementation(StandardPixmap standardIcon,
const QStyleOption *option,
const QWidget *widget) const@ -
sorry, it's probably my bad english (
I will try to reformulate.
When run the program in the debugger and do a breakpoint in my overriding function
@
QIcon CustomStyle::standardIconImplementation(StandardPixmap standardIcon,
const QStyleOption *option,
const QWidget *widget) const--
@function comes in only 2 times though Widgit is all sorts of different elements of the table, buttons, and just from the drop-down lists on PushButton with which the problem's