Kate
expandingwidgetmodel.cpp
Go to the documentation of this file.
129 widget->deleteLater(); // By using deleteLater, we prevent crashes when an action within a widget makes the completion cancel
134 for( QMap<QModelIndex, ExpandingWidgetModel::ExpandingType>::const_iterator it = oldExpandState.constBegin(); it != oldExpandState.constEnd(); ++it )
139 ExpandingWidgetModel::ExpansionType ExpandingWidgetModel::isPartiallyExpanded(const QModelIndex& index) const {
170 //Notify the underlying models that the item was selected, and eventually get back the text for the expanding widget.
182 if( oldIndex.isValid() && (oldIndex < idx || (!(oldIndex < idx) && oldIndex.parent() < idx.parent()) ) )
187 //Say that one row above until one row below has changed, so no items will need to be moved(the space that is taken from one item is given to the other)
193 //Qt fails to correctly scroll in ScrollPerItem mode, so the selected index is completely visible,
215 //This is needed to keep the item we are expanding completely visible. Qt does not scroll the view to keep the item visible.
218 //Since we are scrolling anyway, we can keep the next line visible, which might be a cool feature.
225 //For consistency with the down-scrolling, we keep one additional line visible above the current visible.
234 //We are not partially expanding a new row, but we previously had a partially expanded row. So signalize that it has been unexpanded.
266 while( (tempIndex = rightMostIndex.sibling(rightMostIndex.row(), rightMostIndex.column()+1)).isValid() )
361 ExpandingDelegate* delegate = dynamic_cast<ExpandingDelegate*>( treeView()->itemDelegate(idx) );
392 while( (tempIndex = rightMostIndex.sibling(rightMostIndex.row(), rightMostIndex.column()+1)).isValid() )
415 for( QMap<QModelIndex, QPointer<QWidget> >::const_iterator it = m_expandingWidgets.constBegin(); it != m_expandingWidgets.constEnd(); ++it ) {
423 for( QMap<QModelIndex, QPointer<QWidget> >::const_iterator it = m_expandingWidgets.constBegin(); it != m_expandingWidgets.constEnd(); ++it ) {
449 QList<QVariant> mergeCustomHighlighting( int leftSize, const QList<QVariant>& left, int rightSize, const QList<QVariant>& right )
490 QList<QVariant> mergeCustomHighlighting( QStringList strings, QList<QVariantList> highlights, int grapBetweenStrings )
503 kWarning() << "Length of string-list is " << strings.count() << " while count of highlightings is " << highlights.count() << ", should be same";
515 totalHighlighting = mergeCustomHighlighting( totalString.length(), totalHighlighting, strings[0].length(), highlights[0] );
bool canConvert(Type t) const
void setBottom(int y)
palette
void partiallyUnExpand(const QModelIndex &index)
Definition: expandingwidgetmodel.cpp:146
iterator erase(iterator pos)
virtual void rowSelected(const QModelIndex &row)
Notifies underlying models that the item was selected, collapses any previous partially expanded line...
Definition: expandingwidgetmodel.cpp:157
bool contains(const Key &key) const
QModelIndex partiallyExpandedRow() const
Returns the first row that is currently partially expanded.
Definition: expandingwidgetmodel.cpp:116
void clearExpanding()
Unexpand all rows and clear all cached information about them(this includes deleting the expanding-wi...
Definition: expandingwidgetmodel.cpp:123
void placeExpandingWidgets()
Place or hides all expanding-widgets to the correct positions. Should be called after the view was sc...
Definition: expandingwidgetmodel.cpp:414
int right() const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
int length() const
virtual QTreeView * treeView() const =0
QList< QVariant > mergeCustomHighlighting(int leftSize, const QList< QVariant > &left, int rightSize, const QList< QVariant > &right)
Definition: expandingwidgetmodel.cpp:449
const_iterator constBegin() const
QString partialExpandText(const QModelIndex &row) const
Definition: expandingwidgetmodel.cpp:244
bool isVisible() const
ExpansionType isPartiallyExpanded(const QModelIndex &index) const
Returns whether the given index is currently partially expanded. Does not do any other checks like ca...
Definition: expandingwidgetmodel.cpp:139
frameRect
T value() const
static QIcon m_collapsedIcon
Definition: expandingwidgetmodel.h:136
QWidget * viewport() const
virtual QRect visualRect(const QModelIndex &index) const
void clear()
bool isExpandable(const QModelIndex &index) const
Definition: expandingwidgetmodel.cpp:290
void setParent(QWidget *parent)
geometry
const QColor & color() const
void placeExpandingWidget(const QModelIndex &row)
Places and shows the expanding-widget for the given row, if it should be visible and is valid...
Definition: expandingwidgetmodel.cpp:370
bool isValid() const
int count(const T &value) const
void pop_front()
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Does not request data from index, this only returns local data like highlighting for expanded rows an...
Definition: expandingwidgetmodel.cpp:88
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
int top() const
void setTop(int y)
int left() const
virtual int contextMatchQuality(const QModelIndex &index) const =0
QWidget * expandingWidget(const QModelIndex &row) const
Definition: expandingwidgetmodel.cpp:431
bool isEmpty() const
const_iterator constEnd() const
int row() const
const QBrush & background() const
QAbstractItemDelegate * itemDelegate() const
uint matchColor(const QModelIndex &index) const
Returns the match-color for the given index, or zero if match-quality could not be computed...
Definition: expandingwidgetmodel.cpp:58
void hide()
QModelIndex parent() const
QPalette palette()
iterator begin()
QSize basicSizeHint(const QModelIndex &index) const
Definition: expandingdelegate.cpp:121
bool isExpanded(const QModelIndex &row) const
Definition: expandingwidgetmodel.cpp:305
ExpandingWidgetModel(QWidget *parent)
Definition: expandingwidgetmodel.cpp:44
int partiallyExpandWidgetHeight() const
Amount by which the height of a row increases when it is partially expanded.
Definition: expandingwidgetmodel.cpp:153
virtual void scrollTo(const QModelIndex &index, ScrollHint hint)
bool isValid() const
void clearMatchQualities()
Definition: expandingwidgetmodel.cpp:112
void setRight(int x)
This is a delegate that cares, together with ExpandingWidgetModel, about embedded widgets in tree-vie...
Definition: expandingdelegate.h:42
void setExpanded(QModelIndex index, bool expanded)
Change the expand-state of the row given through index. The display will be updated.
Definition: expandingwidgetmodel.cpp:311
bool isNull() const
QModelIndex sibling(int row, int column) const
void setHeight(int height)
virtual ~ExpandingWidgetModel()
Definition: expandingwidgetmodel.cpp:49
int height() const
int bottom() const
int column() const
int length() const
iterator insert(const Key &key, const T &value)
void show()
bool isEmpty() const
const_iterator constEnd() const
const_iterator constBegin() const
Type type() const
QObject * parent() const
static QIcon m_expandedIcon
Definition: expandingwidgetmodel.h:135
QString toString() const
void setLeft(int x)
bool isValid() const
QModelIndex indexAbove(const QModelIndex &index) const
iterator find(const Key &key)
int expandingWidgetsHeight() const
Returns the total height added through all open expanding-widgets.
Definition: expandingwidgetmodel.cpp:420
height
int basicRowHeight(const QModelIndex &index) const
Definition: expandingwidgetmodel.cpp:357
int remove(const Key &key)
QRect partialExpandRect(const QModelIndex &row) const
Returns the rectangle for the partially expanded part of the given row.
Definition: expandingwidgetmodel.cpp:251
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:57 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.