• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • kde-4.14
  • applications
  • kate
  • part
  • schema
katecolortreewidget.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2012 Dominik Haumann <dhaumann kde org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef KATE_COLOR_TREE_WIDGET_H
20 #define KATE_COLOR_TREE_WIDGET_H
21 
22 #include <QtGui/QTreeWidget>
23 
24 class KConfigGroup;
25 class KateColorTreeItem;
26 
27 class KateColorItem
28 {
29  public:
30  KateColorItem()
31  : useDefault(true)
32  {
33  }
34 
35  QString name; // translated name
36  QString category; // translated category for tree view hierarchy
37  QString whatsThis; // what's this info
38  QString key; // untranslated id, used as key to save/load from KConfig
39  QColor color; // user visible color
40  QColor defaultColor; // used when "Default" is clicked
41  bool useDefault; // flag whether to use the default color
42 };
43 
44 class KateColorTreeWidget : public QTreeWidget
45 {
46  Q_OBJECT
47  friend class KateColorTreeItem;
48  friend class KateColorTreeDelegate;
49 
50  public:
51  explicit KateColorTreeWidget(QWidget *parent = 0);
52 
53  public:
54  void addColorItem(const KateColorItem& colorItem);
55  void addColorItems(const QVector<KateColorItem>& colorItems);
56 
57  QVector<KateColorItem> colorItems() const;
58 
59  QColor findColor(const QString& key) const;
60 
61  public Q_SLOTS:
62  void selectDefaults();
63 
64  Q_SIGNALS:
65  void changed();
66 
67  protected:
68  virtual bool edit(const QModelIndex& index, EditTrigger trigger, QEvent* event);
69  void drawBranches(QPainter* painter, const QRect& rect, const QModelIndex& index) const;
70 };
71 
72 #endif
73 
74 // kate: indent-width 2; replace-tabs on;
KateColorItem::key
QString key
Definition: katecolortreewidget.h:38
KateColorItem::useDefault
bool useDefault
Definition: katecolortreewidget.h:41
QModelIndex
QEvent
QWidget
KateColorTreeWidget::edit
virtual bool edit(const QModelIndex &index, EditTrigger trigger, QEvent *event)
Definition: katecolortreewidget.cpp:243
KateColorItem::defaultColor
QColor defaultColor
Definition: katecolortreewidget.h:40
KateColorItem
Definition: katecolortreewidget.h:27
KateColorTreeWidget::changed
void changed()
KateColorTreeWidget::KateColorTreeDelegate
friend class KateColorTreeDelegate
Definition: katecolortreewidget.h:48
KateColorTreeWidget::colorItems
QVector< KateColorItem > colorItems() const
Definition: katecolortreewidget.cpp:345
KateColorItem::color
QColor color
Definition: katecolortreewidget.h:39
KateColorTreeWidget::drawBranches
void drawBranches(QPainter *painter, const QRect &rect, const QModelIndex &index) const
Definition: katecolortreewidget.cpp:287
KateColorTreeWidget::KateColorTreeWidget
KateColorTreeWidget(QWidget *parent=0)
Definition: katecolortreewidget.cpp:228
QTreeWidget
QRect
KateColorItem::KateColorItem
KateColorItem()
Definition: katecolortreewidget.h:30
KateColorTreeWidget::addColorItems
void addColorItems(const QVector< KateColorItem > &colorItems)
Definition: katecolortreewidget.cpp:339
QPainter
QString
QColor
QWidget::rect
QRect rect() const
KateColorTreeWidget::addColorItem
void addColorItem(const KateColorItem &colorItem)
Definition: katecolortreewidget.cpp:317
KateColorTreeWidget
Definition: katecolortreewidget.h:44
QTreeWidget::event
virtual bool event(QEvent *e)
KateColorItem::category
QString category
Definition: katecolortreewidget.h:36
QVector
KateColorItem::whatsThis
QString whatsThis
Definition: katecolortreewidget.h:37
KateColorTreeWidget::KateColorTreeItem
friend class KateColorTreeItem
Definition: katecolortreewidget.h:47
KateColorItem::name
QString name
Definition: katecolortreewidget.h:35
KateColorTreeWidget::findColor
QColor findColor(const QString &key) const
Definition: katecolortreewidget.cpp:359
QObject::parent
QObject * parent() const
KateColorTreeWidget::selectDefaults
void selectDefaults()
Definition: katecolortreewidget.cpp:294
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:58 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal