20 #include <QVBoxLayout>
23 : QWidget(parent), m_listView(new QListView), m_model(nullptr)
25 setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
27 QVBoxLayout* layout =
new QVBoxLayout;
33 m_listView->setContextMenuPolicy(Qt::CustomContextMenu);
34 m_listView->setAttribute(Qt::WA_MacShowFocusRect,
false);
36 connect(
m_listView, &QListView::customContextMenuRequested,
this,
78 QItemSelectionModel::SelectionFlags command)
94 selectionModel()->select(itemIndex, QItemSelectionModel::ClearAndSelect);
99 QModelIndexList indexes = selected.indexes();
102 if (!indexes.empty())
121 connect(
m_listView->selectionModel(), &QItemSelectionModel::selectionChanged,
this,
Defines class SessionDecorationModel.
Defines class SessionModel.
SessionItem * itemForIndex(const QModelIndex &index) const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
virtual int rowCount(const QModelIndex &parent) const
Defines namespace Constants.
const unsigned int ITEM_SELECTOR_WIDGET_WIDTH
const unsigned int ITEM_SELECTOR_WIDGET_HEIGHT