7#include "transporttreeview.h"
8#include "transportmodel.h"
9#include "transportsortproxymodel.h"
10#include "transporttreedelegate.h"
13using namespace MailTransport;
14TransportTreeView::TransportTreeView(
QWidget *parent)
16 , mTransportSortProxyModel(new TransportSortProxyModel(this))
18 setAlternatingRowColors(
true);
19 setSelectionMode(SingleSelection);
22 setRootIsDecorated(
false);
23 setSortingEnabled(
true);
25 setAllColumnsShowFocus(
true);
26 header()->setSectionsMovable(
false);
29 auto model =
new MailTransport::TransportModel(
this);
31 model->setShowDefault(
true);
32 mTransportSortProxyModel->setSourceModel(model);
33 setModel(mTransportSortProxyModel);
35 setColumnHidden(MailTransport::TransportModel::TransportIdentifierRole,
true);
36 setColumnHidden(MailTransport::TransportModel::DefaultRole,
true);
37 setColumnHidden(MailTransport::TransportModel::ActivitiesRole,
true);
38 setColumnHidden(MailTransport::TransportModel::EnabledActivitiesRole,
true);
39 setItemDelegateForColumn(MailTransport::TransportModel::NameRole,
new TransportTreeDelegate(
this));
40 setUniformRowHeights(
true);
43TransportTreeView::~TransportTreeView() =
default;
45TransportActivitiesAbstract *TransportTreeView::transportActivitiesAbstract()
const
47 return mTransportSortProxyModel->transportActivitiesAbstract();
50void TransportTreeView::setTransportActivitiesAbstract(TransportActivitiesAbstract *activitiesAbstract)
52 mTransportSortProxyModel->setTransportActivitiesAbstract(activitiesAbstract);
55TransportSortProxyModel *TransportTreeView::transportSortProxyModel()
const
57 return mTransportSortProxyModel;
60bool TransportTreeView::enablePlasmaActivities()
const
62 return mTransportSortProxyModel->enablePlasmaActivities();
65void TransportTreeView::setEnablePlasmaActivities(
bool newEnablePlasmaActivities)
67 mTransportSortProxyModel->setEnablePlasmaActivities(newEnablePlasmaActivities);
70#include "moc_transporttreeview.cpp"