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] );
void partiallyUnExpand(const QModelIndex &index)
Definition: expandingwidgetmodel.cpp:146
virtual void rowSelected(const QModelIndex &row)
Notifies underlying models that the item was selected, collapses any previous partially expanded line...
Definition: expandingwidgetmodel.cpp:157
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
static KIconLoader * global()
virtual QTreeView * treeView() const =0
QList< QVariant > mergeCustomHighlighting(int leftSize, const QList< QVariant > &left, int rightSize, const QList< QVariant > &right)
Definition: expandingwidgetmodel.cpp:449
QColor tint(const QColor &base, const QColor &color, qreal amount=0.3)
QString partialExpandText(const QModelIndex &row) const
Definition: expandingwidgetmodel.cpp:244
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
static QIcon m_collapsedIcon
Definition: expandingwidgetmodel.h:136
QColor mix(const QColor &c1, const QColor &c2, qreal bias=0.5)
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
bool isExpandable(const QModelIndex &index) const
Definition: expandingwidgetmodel.cpp:290
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
QPixmap loadIcon(const QString &name, KIconLoader::Group group, int size=0, int state=KIconLoader::DefaultState, const QStringList &overlays=QStringList(), QString *path_store=0L, bool canReturnNull=false) const
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
virtual int contextMatchQuality(const QModelIndex &index) const =0
QWidget * expandingWidget(const QModelIndex &row) const
Definition: expandingwidgetmodel.cpp:431
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
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
void clearMatchQualities()
Definition: expandingwidgetmodel.cpp:112
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
virtual ~ExpandingWidgetModel()
Definition: expandingwidgetmodel.cpp:49
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
static QIcon m_expandedIcon
Definition: expandingwidgetmodel.h:135
int expandingWidgetsHeight() const
Returns the total height added through all open expanding-widgets.
Definition: expandingwidgetmodel.cpp:420
int basicRowHeight(const QModelIndex &index) const
Definition: expandingwidgetmodel.cpp:357
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-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.