The code snippet won't tell much since I don't actually want to use a KColorCombo but only access it for my style plugin. Here's what I do in the event filter:
if ( (::qt_cast<QComboBox*>(obj)) && (obj->inherits("KColorCombo"))
&& (ev
->type
() == QEvent::Paint) ) {
KColorCombo* combo = static_cast<KColorCombo*>(obj);
bool enabled = combo->isEnabled();
bool mouseOver = combo->hasMouse();
QColorGroup cg = combo->colorGroup();
QColor innerColor
= combo
->color
();
// <-Splash! //
// etc...
}
if ( (::qt_cast<QComboBox*>(obj)) && (obj->inherits("KColorCombo"))
&& (ev->type() == QEvent::Paint) )
{
KColorCombo* combo = static_cast<KColorCombo*>(obj);
bool enabled = combo->isEnabled();
bool mouseOver = combo->hasMouse();
QColorGroup cg = combo->colorGroup();
QColor innerColor = combo->color(); // <-Splash!
//
// etc...
}
To copy to clipboard, switch view to plain text mode
As for linking the necessary libs, I think I do. I already managed to style the very KDE specific widgets KKeyButton and KColorButton. I don't think KColorCombo has special needs. Am I wrong?
Bookmarks