Fix build: synchronize Request API, fix GmailSynchronizer, and migrate UI to Qt6 Widgets
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
// /mnt/c/Users/javie/wino-mail-dtkqt/include/emaillistmodel.h
|
||||
#ifndef EMAILLISTMODEL_H
|
||||
#define EMAILLISTMODEL_H
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
#include <QStringList>
|
||||
#include <QModelIndex>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
struct EmailItem {
|
||||
int id;
|
||||
QString subject;
|
||||
QString sender;
|
||||
};
|
||||
|
||||
class EmailListModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EmailListModel(QObject *parent = nullptr);
|
||||
|
||||
// QAbstractItemModel interface
|
||||
QModelIndex index(int row, int column = 0, const QModelIndex &parent = QModelIndex()) const override;
|
||||
QModelIndex parent(int row, const QModelIndex &parent = QModelIndex()) const override;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
// Public interface for setting data
|
||||
void setEmails(const QList<EmailItem>& emails);
|
||||
|
||||
// Helper to get data (for demonstration)
|
||||
QList<EmailItem> getEmails() const { return m_emails; }
|
||||
|
||||
private:
|
||||
QList<EmailItem> m_emails;
|
||||
};
|
||||
|
||||
#endif // EMAILLISTMODEL_H
|
||||
Reference in New Issue
Block a user