KTextEditor

katestyletreewidget.h
1 /*
2  SPDX-FileCopyrightText: 2001-2003 Christoph Cullmann <[email protected]>
3  SPDX-FileCopyrightText: 2002, 2003 Anders Lund <[email protected]>
4  SPDX-FileCopyrightText: 2005-2006 Hamish Rodda <[email protected]>
5  SPDX-FileCopyrightText: 2007 Mirko Stocker <[email protected]>
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 "kateextendedattribute.h"
16 
23 {
24  Q_OBJECT
25 
26  friend class KateStyleListItem;
27 
28 public:
29  explicit KateStyleTreeWidget(QWidget *parent = nullptr, bool showUseDefaults = false);
30 
31  void emitChanged();
32 
33  void setBgCol(const QColor &c)
34  {
35  bgcol = c;
36  }
37  void setSelCol(const QColor &c)
38  {
39  selcol = c;
40  }
41 
43  void addItem(const QString &styleName, KTextEditor::Attribute::Ptr defaultstyle, KTextEditor::Attribute::Ptr data = KTextEditor::Attribute::Ptr());
44 
45  void resizeColumns();
46 
47 Q_SIGNALS:
48  void changed();
49 
50 protected:
51  void contextMenuEvent(QContextMenuEvent *event) override;
52  void showEvent(QShowEvent *event) override;
53  bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event) override;
54 
55 private Q_SLOTS:
56  void changeProperty();
57  void unsetColor();
58  void updateGroupHeadings();
59 
60 private:
61  QColor bgcol, selcol;
62  QFont docfont;
63 };
64 
65 #endif
Q_SIGNALSQ_SIGNALS
QTreeWidget that automatically adds columns for KateStyleListItems and provides a popup menu and a sl...
Q_OBJECTQ_OBJECT
virtual bool event(QEvent *e) override
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Sep 18 2020 22:56:50 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.