Changeset View
Changeset View
Standalone View
Standalone View
src/completion/expandingtree/expandingtree.cpp
Show All 16 Lines | |||||
17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | * Boston, MA 02110-1301, USA. | 18 | * Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "expandingtree.h" | 21 | #include "expandingtree.h" | ||
22 | 22 | | |||
23 | #include <QTextLayout> | 23 | #include <QTextLayout> | ||
24 | #include <QTextDocument> | 24 | #include <QTextDocument> | ||
25 | #include <QHeaderView> | ||||
25 | #include <QAbstractTextDocumentLayout> | 26 | #include <QAbstractTextDocumentLayout> | ||
26 | #include <QPainter> | 27 | #include <QPainter> | ||
27 | #include "katepartdebug.h" | 28 | #include "katepartdebug.h" | ||
28 | #include "expandingwidgetmodel.h" | 29 | #include "expandingwidgetmodel.h" | ||
29 | 30 | | |||
30 | ExpandingTree::ExpandingTree(QWidget *parent) : QTreeView(parent) | 31 | ExpandingTree::ExpandingTree(QWidget *parent) : QTreeView(parent) | ||
31 | { | 32 | { | ||
32 | m_drawText.documentLayout()->setPaintDevice(this); | 33 | m_drawText.documentLayout()->setPaintDevice(this); | ||
33 | setUniformRowHeights(false); | 34 | setUniformRowHeights(false); | ||
35 | header()->setMinimumSectionSize(0); | ||||
34 | } | 36 | } | ||
35 | 37 | | |||
36 | void ExpandingTree::drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const | 38 | void ExpandingTree::drawRow(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const | ||
37 | { | 39 | { | ||
38 | QTreeView::drawRow(painter, option, index); | 40 | QTreeView::drawRow(painter, option, index); | ||
39 | 41 | | |||
40 | const ExpandingWidgetModel *eModel = qobject_cast<const ExpandingWidgetModel *>(model()); | 42 | const ExpandingWidgetModel *eModel = qobject_cast<const ExpandingWidgetModel *>(model()); | ||
41 | if (eModel && eModel->isPartiallyExpanded(index)) { | 43 | if (eModel && eModel->isPartiallyExpanded(index)) { | ||
Show All 24 Lines |