Commit 739dd45a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add proxymodel

parent 9869ba6e
Pipeline #28003 canceled with stage
......@@ -18,6 +18,7 @@
*/
#include "folderconfiguresettingswidget.h"
#include "foldersettingfilterproxymodel.h"
#include <KCheckableProxyModel>
#include <QHBoxLayout>
#include <MailCommon/FolderTreeWidget>
......@@ -27,20 +28,32 @@ FolderConfigureSettingsWidget::FolderConfigureSettingsWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(0, 0, 0, 0);
auto ftw = new MailCommon::FolderTreeWidget(this, nullptr,
MailCommon::FolderTreeWidget::TreeViewOptions(MailCommon::FolderTreeWidget::UseDistinctSelectionModel
|MailCommon::FolderTreeWidget::HideStatistics
|MailCommon::FolderTreeWidget::HideHeaderViewMenu));
ftw->setObjectName(QStringLiteral("foldertreewidget"));
ftw->folderTreeView()->setDragEnabled(false);
auto ftv = ftw->folderTreeView();
auto sourceModel = ftv->model();
auto selectionModel = ftw->selectionModel();
auto checkable = new KCheckableProxyModel(this);
checkable->setObjectName(QStringLiteral("checkable"));
checkable->setSourceModel(sourceModel);
checkable->setSelectionModel(selectionModel);
auto folderSettingFilterProxyModel = new FolderSettingFilterProxyModel(this);
folderSettingFilterProxyModel->setObjectName(QStringLiteral("folderSettingFilterProxyModel"));
folderSettingFilterProxyModel->setSourceModel(checkable);
ftv->setModel(folderSettingFilterProxyModel);
ftv->expandAll();
mainLayout->addWidget(ftw);
}
......@@ -48,3 +61,8 @@ FolderConfigureSettingsWidget::~FolderConfigureSettingsWidget()
{
}
void FolderConfigureSettingsWidget::save()
{
//TODO
}
......@@ -28,6 +28,7 @@ class FolderConfigureSettingsWidget : public QWidget
public:
explicit FolderConfigureSettingsWidget(QWidget *parent = nullptr);
~FolderConfigureSettingsWidget();
void save();
};
#endif // FOLDERCONFIGURESETTINGSWIDGET_H
Markdown is supported
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