if(button)
action = button->defaultAction();
if (event
->type
() == QEvent::KeyPress) {
if(strcmp(objName,"LeftWidget")==0)
ctrl->setActionIcon(action,button->hasFocus() ? CPersonalControl::ImageType_Focus : CPersonalControl::ImageType_Normal);
rrr = true;
return QObject::eventFilter(obj, event
);
}
else if (event
->type
() == QEvent::Enter) {
//iz objekta dobim ven widget
if(strcmp(objName,"LeftWidget")==0)
{
ctrl->setActionIcon(action,button->hasFocus() ? CPersonalControl::ImageType_Focus : CPersonalControl::ImageType_MouseOver);
}
else
{
if(button)
{
if(action
->data
().
canConvert(QVariant::Icon)) {
ikonca = action->icon();
QIcon ikona
= action
->data
().
value<QIcon>
();
if(!(ikona.isNull()))
button->setIcon(ikona);
}
}
}
return QObject::eventFilter(obj, event
);
}
else if (event
->type
() == QEvent::Leave) {
// a widget in the toolbar was left
if(strcmp(objName,"LeftWidget")==0)
ctrl->setActionIcon(action,button->hasFocus() ? CPersonalControl::ImageType_Focus : CPersonalControl::ImageType_Normal);
else
{
if(button)
{
if(!(ikonca.isNull()))
button->setIcon(ikonca);
}
}
return QObject::eventFilter(obj, event
);
}
else
{
// standard event processing
return QObject::eventFilter(obj, event
);
}
if(button)
action = button->defaultAction();
if (event->type() == QEvent::KeyPress)
{
if(strcmp(objName,"LeftWidget")==0)
ctrl->setActionIcon(action,button->hasFocus() ? CPersonalControl::ImageType_Focus : CPersonalControl::ImageType_Normal);
rrr = true;
return QObject::eventFilter(obj, event);
}
else if (event->type() == QEvent::Enter)
{
//iz objekta dobim ven widget
if(strcmp(objName,"LeftWidget")==0)
{
ctrl->setActionIcon(action,button->hasFocus() ? CPersonalControl::ImageType_Focus : CPersonalControl::ImageType_MouseOver);
}
else
{
if(button)
{
if(action->data().canConvert(QVariant::Icon))
{
ikonca = action->icon();
QIcon ikona = action->data().value<QIcon>();
if(!(ikona.isNull()))
button->setIcon(ikona);
}
}
}
return QObject::eventFilter(obj, event);
}
else if (event->type() == QEvent::Leave)
{
// a widget in the toolbar was left
if(strcmp(objName,"LeftWidget")==0)
ctrl->setActionIcon(action,button->hasFocus() ? CPersonalControl::ImageType_Focus : CPersonalControl::ImageType_Normal);
else
{
if(button)
{
if(!(ikonca.isNull()))
button->setIcon(ikonca);
}
}
return QObject::eventFilter(obj, event);
}
else
{
// standard event processing
return QObject::eventFilter(obj, event);
}
To copy to clipboard, switch view to plain text mode
Bookmarks