Commit 7b365138 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to implement menu

parent b3dfaa76
Pipeline #53385 canceled with stage
......@@ -9,6 +9,7 @@
#include <KCheckableProxyModel>
#include <MailCommon/FolderTreeView>
#include <MailCommon/FolderTreeWidget>
#include <QMenu>
#include <QVBoxLayout>
FolderConfigureTreeWidget::FolderConfigureTreeWidget(QWidget *parent)
......@@ -25,6 +26,10 @@ FolderConfigureTreeWidget::FolderConfigureTreeWidget(QWidget *parent)
| MailCommon::FolderTreeWidget::HideHeaderViewMenu));
ftw->setObjectName(QStringLiteral("foldertreewidget"));
ftw->folderTreeView()->setDragEnabled(false);
ftw->folderTreeView()->setSelectionMode(QAbstractItemView::ExtendedSelection);
ftw->folderTreeView()->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ftw->folderTreeView(), &MailCommon::FolderTreeView::customContextMenuRequested, this, &FolderConfigureTreeWidget::slotCustomContextMenuRequested);
auto ftv = ftw->folderTreeView();
auto sourceModel = ftv->model();
auto selectionModel = ftw->selectionModel();
......@@ -47,6 +52,14 @@ FolderConfigureTreeWidget::~FolderConfigureTreeWidget()
{
}
void FolderConfigureTreeWidget::slotCustomContextMenuRequested(const QPoint &)
{
QMenu menu(this);
// if (!menu.isEmpty()) {
menu.exec(QCursor::pos());
//}
}
Akonadi::Collection::List FolderConfigureTreeWidget::listCollections() const
{
return mFolderSettingFilterProxyModel->listCollections();
......
......@@ -20,6 +20,7 @@ public:
Q_REQUIRED_RESULT Akonadi::Collection::List listCollections() const;
private:
void slotCustomContextMenuRequested(const QPoint &);
FolderSettingFilterProxyModel *const mFolderSettingFilterProxyModel;
};
......
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