KTextEditor

katecompletiondelegate.h
1/*
2 SPDX-FileCopyrightText: 2022 Waqar Ahmed <waqar.17a@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KATECOMPLETIONDELEGATE_H
8#define KATECOMPLETIONDELEGATE_H
9
10// #include "expandingtree/expandingdelegate.h"
11#include <QStyledItemDelegate>
12#include <QTextLayout>
13
16
17class KateCompletionDelegate : public QStyledItemDelegate
18{
19public:
20 explicit KateCompletionDelegate(QObject *parent);
21
22 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
23
24 QSize basicSizeHint(const QModelIndex &idx) const
25 {
26 return QStyledItemDelegate::sizeHint({}, idx);
27 }
28
29protected:
30 static QList<QTextLayout::FormatRange> createHighlighting(const QModelIndex &index);
31
32 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
33
34 // This variable is used by ArgumentHintDelegate to put the text at the top of the item so that
35 // it isn't hidden by the expanding widget
36 mutable bool m_alignTop = false;
37};
38
39#endif
This class has the responsibility for filtering, sorting, and manipulating code completion data provi...
This is the code completion's main widget, and also contains the core interface logic.
QObject * parent() const const
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const const override
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:53:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.