1 Star 0 Fork 0

好富贵/图片格式转换器

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
dialog.h 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
好富贵 提交于 2024-03-04 18:53 +08:00 . 第一次提交.txt
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
#include <QMouseEvent>
#include <QStyledItemDelegate>
QT_BEGIN_NAMESPACE
namespace Ui {
class Dialog;
}
QT_END_NAMESPACE
class Dialog : public QDialog
{
Q_OBJECT
public:
Dialog(QWidget *parent = nullptr);
~Dialog();
void Init();
void InitFolder();
void InitList();
void BtnAdd();
void ChangeImg();
void GetALLImg();
void CreateMenu();
void Test();
void FlashColor(int n);
private slots:
//Menu
void OpenFolder();
void DeleteImg();
void Info();
public:
QString file;
QString folderPath;
int Count;
private:
Ui::Dialog *ui;
signals:
void newFileName();
};
#endif // DIALOG_H
class AlternateColorDelegate : public QStyledItemDelegate {
public:
AlternateColorDelegate(QObject *parent = nullptr) : QStyledItemDelegate(parent) {}
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override {
QStyleOptionViewItem altOption(option);
if (index.row() % 2 == 0) {
// 为偶数行设置颜色
altOption.backgroundBrush = QBrush(Qt::yellow);
} else {
// 为奇数行设置颜色
altOption.backgroundBrush = QBrush(Qt::lightGray);
}
QStyledItemDelegate::paint(painter, altOption, index);
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/how-rich1/image-format-converter.git
git@gitee.com:how-rich1/image-format-converter.git
how-rich1
image-format-converter
图片格式转换器
master

搜索帮助