Changeset View
Changeset View
Standalone View
Standalone View
src/kitemviews/kitemlistheader.cpp
Show All 25 Lines | |||||
26 | } | 26 | } | ||
27 | 27 | | |||
28 | void KItemListHeader::setAutomaticColumnResizing(bool automatic) | 28 | void KItemListHeader::setAutomaticColumnResizing(bool automatic) | ||
29 | { | 29 | { | ||
30 | if (m_headerWidget->automaticColumnResizing() != automatic) { | 30 | if (m_headerWidget->automaticColumnResizing() != automatic) { | ||
31 | m_headerWidget->setAutomaticColumnResizing(automatic); | 31 | m_headerWidget->setAutomaticColumnResizing(automatic); | ||
32 | if (automatic) { | 32 | if (automatic) { | ||
33 | m_view->applyAutomaticColumnWidths(); | 33 | m_view->applyAutomaticColumnWidths(); | ||
34 | m_view->doLayout(KItemListView::NoAnimation); | 34 | m_view->doLayout(KItemListView::LayoutAnimationHint::NoAnimation); | ||
35 | } | 35 | } | ||
36 | } | 36 | } | ||
37 | } | 37 | } | ||
38 | 38 | | |||
39 | bool KItemListHeader::automaticColumnResizing() const | 39 | bool KItemListHeader::automaticColumnResizing() const | ||
40 | { | 40 | { | ||
41 | return m_headerWidget->automaticColumnResizing(); | 41 | return m_headerWidget->automaticColumnResizing(); | ||
42 | } | 42 | } | ||
43 | 43 | | |||
44 | void KItemListHeader::setColumnWidth(const QByteArray& role, qreal width) | 44 | void KItemListHeader::setColumnWidth(const QByteArray& role, qreal width) | ||
45 | { | 45 | { | ||
46 | if (!m_headerWidget->automaticColumnResizing()) { | 46 | if (!m_headerWidget->automaticColumnResizing()) { | ||
47 | m_headerWidget->setColumnWidth(role, width); | 47 | m_headerWidget->setColumnWidth(role, width); | ||
48 | m_view->applyColumnWidthsFromHeader(); | 48 | m_view->applyColumnWidthsFromHeader(); | ||
49 | m_view->doLayout(KItemListView::NoAnimation); | 49 | m_view->doLayout(KItemListView::LayoutAnimationHint::NoAnimation); | ||
50 | } | 50 | } | ||
51 | } | 51 | } | ||
52 | 52 | | |||
53 | qreal KItemListHeader::columnWidth(const QByteArray& role) const | 53 | qreal KItemListHeader::columnWidth(const QByteArray& role) const | ||
54 | { | 54 | { | ||
55 | return m_headerWidget->columnWidth(role); | 55 | return m_headerWidget->columnWidth(role); | ||
56 | } | 56 | } | ||
57 | 57 | | |||
58 | void KItemListHeader::setColumnWidths(const QHash<QByteArray, qreal>& columnWidths) | 58 | void KItemListHeader::setColumnWidths(const QHash<QByteArray, qreal>& columnWidths) | ||
59 | { | 59 | { | ||
60 | if (!m_headerWidget->automaticColumnResizing()) { | 60 | if (!m_headerWidget->automaticColumnResizing()) { | ||
61 | foreach (const QByteArray& role, m_view->visibleRoles()) { | 61 | foreach (const QByteArray& role, m_view->visibleRoles()) { | ||
62 | const qreal width = columnWidths.value(role); | 62 | const qreal width = columnWidths.value(role); | ||
63 | m_headerWidget->setColumnWidth(role, width); | 63 | m_headerWidget->setColumnWidth(role, width); | ||
64 | } | 64 | } | ||
65 | 65 | | |||
66 | m_view->applyColumnWidthsFromHeader(); | 66 | m_view->applyColumnWidthsFromHeader(); | ||
67 | m_view->doLayout(KItemListView::NoAnimation); | 67 | m_view->doLayout(KItemListView::LayoutAnimationHint::NoAnimation); | ||
68 | } | 68 | } | ||
69 | } | 69 | } | ||
70 | 70 | | |||
71 | qreal KItemListHeader::preferredColumnWidth(const QByteArray& role) const | 71 | qreal KItemListHeader::preferredColumnWidth(const QByteArray& role) const | ||
72 | { | 72 | { | ||
73 | return m_headerWidget->preferredColumnWidth(role); | 73 | return m_headerWidget->preferredColumnWidth(role); | ||
74 | } | 74 | } | ||
75 | 75 | | |||
Show All 13 Lines |