Thanks jpn for your valuable reply. I would have never come up myself with that solution.
I implemented it like this in my subclassed style from ProxyStyle:
class HD2Style : public ProxyStyle
{
public:
explicit HD2Style(const QString& baseStyle) : ProxyStyle(baseStyle)
{
}
{
switch(hint)
{
case QStyle::SH_SpinBox_KeyPressAutoRepeatRate: case QStyle::SH_SpinBox_ClickAutoRepeatRate: return 100;
case QStyle::SH_SpinBox_ClickAutoRepeatThreshold: return 500;
default:
return ProxyStyle::styleHint(hint, option, widget, returnData);
}
}
};
class HD2Style : public ProxyStyle
{
public:
explicit HD2Style(const QString& baseStyle) : ProxyStyle(baseStyle)
{
}
int styleHint(StyleHint hint, const QStyleOption* option=0, const QWidget* widget=0, QStyleHintReturn* returnData = 0) const
{
switch(hint)
{
case QStyle::SH_SpinBox_KeyPressAutoRepeatRate:
case QStyle::SH_SpinBox_ClickAutoRepeatRate:
return 100;
case QStyle::SH_SpinBox_ClickAutoRepeatThreshold:
return 500;
default:
return ProxyStyle::styleHint(hint, option, widget, returnData);
}
}
};
To copy to clipboard, switch view to plain text mode
It works like a charm for the ClickAutoRepeat, however it doesn't for KeyPressAutoRepeat. That is, the speed of the auto repeat when I press Cursor-Up when the line edit of the spin box has the focus is not changed.
Did I miss something?
Regards,
Rainer
Bookmarks