KTextEditor

katestyletreewidget.h
1/*
2 SPDX-FileCopyrightText: 2001-2003 Christoph Cullmann <cullmann@kde.org>
3 SPDX-FileCopyrightText: 2002, 2003 Anders Lund <anders.lund@lund.tdcadsl.dk>
4 SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <rodda@kde.org>
5 SPDX-FileCopyrightText: 2007 Mirko Stocker <me@misto.ch>
6
7 SPDX-License-Identifier: LGPL-2.0-or-later
8*/
9
10#ifndef KATESTYLETREEWIDGET_H
11#define KATESTYLETREEWIDGET_H
12
13#include <QTreeWidget>
14
15#include "attribute.h"
16
17/**
18 * QTreeWidget that automatically adds columns for KateStyleListItems and provides a
19 * popup menu and a slot to edit a style using the keyboard.
20 * Added by anders, jan 23 2002.
21 */
23{
25
26 friend class KateStyleListItem;
27
28public:
29 explicit KateStyleTreeWidget(QWidget *parent = nullptr, bool showUseDefaults = false);
30
31 void emitChanged();
32
33 void addItem(QTreeWidgetItem *parent,
34 const QString &styleName,
35 KTextEditor::Attribute::Ptr defaultstyle,
37 void addItem(const QString &styleName, KTextEditor::Attribute::Ptr defaultstyle, KTextEditor::Attribute::Ptr data = KTextEditor::Attribute::Ptr());
38
39 void resizeColumns();
40
41 bool readOnly() const;
42 void setReadOnly(bool readOnly);
43
45 void changed();
46
47protected:
48 void contextMenuEvent(QContextMenuEvent *event) override;
49 void showEvent(QShowEvent *event) override;
50 bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event) override;
51
52private Q_SLOTS:
53 void changeProperty();
54 void unsetColor();
55 void updateGroupHeadings();
56
57private:
58 bool m_readOnly = false;
59};
60
61#endif
QTreeWidget that automatically adds columns for KateStyleListItems and provides a popup menu and a sl...
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
virtual bool event(QEvent *e) override
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 4 2024 12:03:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.