mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #97: Context menu + layout items on window size changed
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user