#include "private/kitemlistselectiontoggle.h"
-#include <KDebug>
-#include <KGlobalSettings>
#include <QApplication>
#include <QPainter>
#include <QPropertyAnimation>
if (!m_hoverAnimation) {
m_hoverAnimation = new QPropertyAnimation(this, "hoverOpacity", this);
- const int duration = (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) ? 1 : 200;
+ const int duration = style()->styleHint(QStyle::SH_Widget_Animate) ? 200 : 1;
m_hoverAnimation->setDuration(duration);
- connect(m_hoverAnimation, SIGNAL(finished()), this, SLOT(slotHoverAnimationFinished()));
+ connect(m_hoverAnimation, &QPropertyAnimation::finished, this, &KItemListWidget::slotHoverAnimationFinished);
}
m_hoverAnimation->stop();
void KItemListWidget::slotHoverAnimationFinished()
{
- if (!m_hovered) {
- delete m_selectionToggle;
+ if (!m_hovered && m_selectionToggle) {
+ m_selectionToggle->deleteLater();
m_selectionToggle = 0;
}
}
widget->style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &viewItemOption, painter, widget);
}
-#include "kitemlistwidget.moc"