diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-06 19:43:21 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-10 10:27:22 +0100 |
| commit | 1ac3f4d8e8ee7461f047d34e196df40499e89557 (patch) | |
| tree | 803e663c2da154d0d48a4f284185b37c53e0b2f2 /src/genericicondelegate.cpp | |
| parent | 76796796bec37a1670cfc4e0b1e42e7b1096b237 (diff) | |
Display children contents in collapsed separator.
Diffstat (limited to 'src/genericicondelegate.cpp')
| -rw-r--r-- | src/genericicondelegate.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/genericicondelegate.cpp b/src/genericicondelegate.cpp index 1e00f0e9..7afaca3f 100644 --- a/src/genericicondelegate.cpp +++ b/src/genericicondelegate.cpp @@ -4,28 +4,18 @@ #include <QPixmapCache>
-GenericIconDelegate::GenericIconDelegate(QObject *parent, int role, int logicalIndex, int compactSize)
- : IconDelegate(parent)
+GenericIconDelegate::GenericIconDelegate(QTreeView* parent, int role, int logicalIndex, int compactSize)
+ : IconDelegate(parent, logicalIndex, compactSize)
, m_Role(role)
- , m_LogicalIndex(logicalIndex)
- , m_CompactSize(compactSize)
- , m_Compact(false)
{
}
-void GenericIconDelegate::columnResized(int logicalIndex, int, int newSize)
-{
- if (logicalIndex == m_LogicalIndex) {
- m_Compact = newSize < m_CompactSize;
- }
-}
-
QList<QString> GenericIconDelegate::getIcons(const QModelIndex &index) const
{
QList<QString> result;
if (index.isValid()) {
for (const QVariant &var : index.data(m_Role).toList()) {
- if (!m_Compact || !var.toString().isEmpty()) {
+ if (!compact() || !var.toString().isEmpty()) {
result.append(var.toString());
}
}
|
