Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KDE PIM Add-ons
Commits
739dd45a
Commit
739dd45a
authored
Jul 22, 2020
by
Laurent Montel
😁
Browse files
Add proxymodel
parent
9869ba6e
Pipeline
#28003
canceled with stage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguresettingswidget.cpp
View file @
739dd45a
...
...
@@ -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
}
plugins/messageviewerconfigureplugins/foldersettings/folderconfiguresettingswidget.h
View file @
739dd45a
...
...
@@ -28,6 +28,7 @@ class FolderConfigureSettingsWidget : public QWidget
public:
explicit
FolderConfigureSettingsWidget
(
QWidget
*
parent
=
nullptr
);
~
FolderConfigureSettingsWidget
();
void
save
();
};
#endif // FOLDERCONFIGURESETTINGSWIDGET_H
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment