1 Star 0 Fork 2

JIANCAI/MusicPlayer_QT5

forked from fword/MusicPlayer_QT5 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
delegate.cpp 626 Bytes
一键复制 编辑 原始数据 按行查看 历史
fword 提交于 2021-12-23 15:03 . first commit
#include "delegate.h"
#include "delegate.h"
#include <QDebug>
Delegate::Delegate(QObject *parent) : QItemDelegate(parent)
{
// QPixmap pixmap(":/123.png");
QColor color(247,33,33,100);
kHoverItemBackgroundcColor = QBrush(color);
}
void Delegate::onHoverIndexChanged(const QModelIndex &index)
{
m_hoverrow = index.row();
}
void Delegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
painter->drawText(option.rect,index.data().toString());
if(index.row() == m_hoverrow)
{
painter->fillRect(option.rect, kHoverItemBackgroundcColor);
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/jiaanCai/Cplusplus.git
git@gitee.com:jiaanCai/Cplusplus.git
jiaanCai
Cplusplus
MusicPlayer_QT5
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385