diff options
| author | Mikaƫl Capelle <capelle.mikael@gmail.com> | 2021-01-11 12:49:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-11 12:49:42 +0100 |
| commit | 1dc2b225485a073d82e08a9820493086b2dda8b8 (patch) | |
| tree | 5a4e5478d577f065c7282cb62992c2b6c735e13f /src/genericicondelegate.cpp | |
| parent | a680dfa3e94b34bf6b0ebd65d29d7a9799e3183f (diff) | |
| parent | 05efc74e402ca3770d9fdaa2557f4030c31ee198 (diff) | |
Merge pull request #1350 from Holt59/collapsible-separators
Collapsible separators - Fix & Improvements.
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());
}
}
|
