Commit 1b176dc9 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Merge remote-tracking branch 'origin/release/20.12'

parents d2a6b4e8 5ed6f0a7
Pipeline #44457 canceled with stage
......@@ -335,6 +335,16 @@ protected:
}
return true;
}
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
{
if (role == Qt::ToolTipRole) {
const Akonadi::Collection col = CalendarSupport::collectionFromIndex(index);
return CalendarSupport::toolTipString(col);
}
return QSortFilterProxyModel::data(index, role);
};
};
class CalendarDelegateModel : public QSortFilterProxyModel
......
......@@ -54,6 +54,8 @@ static QStyle *style(const QStyleOptionViewItem &option)
static QStyleOptionButton buttonOpt(const QStyleOptionViewItem &opt, const QPixmap &pixmap, const QModelIndex &index, int pos = 1)
{
Q_UNUSED(index);
QStyleOptionButton option;
option.icon = pixmap;
const QRect r = opt.rect;
......@@ -61,11 +63,6 @@ static QStyleOptionButton buttonOpt(const QStyleOptionViewItem &opt, const QPixm
option.rect = enableButtonRect(r, pos);
option.state = QStyle::State_Active | QStyle::State_Enabled;
option.iconSize = QSize(h, h);
auto *w = const_cast<QWidget *>(opt.widget);
if (w) {
const Akonadi::Collection col = CalendarSupport::collectionFromIndex(index);
w->setToolTip(CalendarSupport::toolTipString(col));
}
return option;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment