Issue #97: Context menu + layout items on window size changed

This commit is contained in:
Jakub Melka
2023-10-07 18:24:04 +02:00
parent c57f28a3b5
commit 10f24c2dff
4 changed files with 61 additions and 1 deletions

View File

@ -83,10 +83,25 @@ QVariant PageItemModel::data(const QModelIndex& index, int role) const
return QVariant();
}
const PageGroupItem* item = getItem(index);
switch (role)
{
case Qt::DisplayRole:
return m_pageGroupItems.at(index.row()).groupName;
return item->groupName;
case Qt::ToolTipRole:
{
QStringList texts;
texts << QString("<b>%1</b>").arg(item->groupName);
if (item->isGrouped())
{
texts << QString("%1 pages").arg(item->groups.size());
}
return texts.join("<br>");
}
default:
break;