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

knode

  • sources
  • kde-4.12
  • kdepim
  • knode
treewidget.h
Go to the documentation of this file.
1 #ifndef KDEPIM_TREEWIDGET_H
2 #define KDEPIM_TREEWIDGET_H
3 
4 /******************************************************************************
5  *
6  * This file is part of libkdepim.
7  *
8  * Copyright (C) 2008 Szymon Tomasz Stefanek <pragma@kvirc.net>
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Library General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU Library General Public License
21  * along with this library; see the file COPYING.LIB. If not, write to
22  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23  * Boston, MA 02110-1301, USA.
24  *
25  *****************************************************************************/
26 
31 #include "knode_export.h"
32 #include <QTreeWidget>
33 
34 class KMenu;
35 class KConfig;
36 class KConfigGroup;
37 
38 class QAction;
39 
40 namespace KPIM
41 {
42 
56 class KNODE_EXPORT TreeWidget : public QTreeWidget
57 {
58  Q_OBJECT
59 public:
64  explicit TreeWidget( QWidget *parent, const char *name = 0 );
65 
66 public:
67 
68  //
69  // Layout Save/Restore facility
70  //
71 
81  bool saveLayout(
82  KConfigGroup &group,
83  const QString &keyName = QString()
84  ) const;
85 
97  bool saveLayout(
98  KConfig *config,
99  const QString &groupName,
100  const QString &keyName = QString()
101  ) const;
102 
122  bool restoreLayout(
123  KConfigGroup &group,
124  const QString &keyName = QString()
125  );
126 
146  bool restoreLayout(
147  KConfig *config,
148  const QString &groupName,
149  const QString &keyName = QString()
150  );
151 
152  //
153  // Manual and programmatic column hiding
154  //
155 
164  void setManualColumnHidingEnabled( bool enable );
165 
169  bool manualColumnHidingEnabled() const
170  { return mEnableManualColumnHiding; };
171 
176  void setColumnHidden( int logicalIndex, bool hide );
177 
181  bool isColumnHidden( int logicalIndex ) const;
182 
186  void toggleColumn( int logicalIndex );
187 
201  virtual bool fillHeaderContextMenu( KMenu *menu, const QPoint &clickPoint );
202 
203  //
204  // Facilities for adding and manipulating columns
205  //
206 
219  int addColumn(
220  const QString &label,
221  int headerAlignment = Qt::AlignLeft | Qt::AlignVCenter
222  );
223 
229  bool setColumnText( int columnIndex, const QString &label );
230 
234  QTreeWidgetItem *lastItem() const;
235 
241  QTreeWidgetItem *firstItem() const;
242 
243 Q_SIGNALS:
249  void columnVisibilityChanged( int logicalIndex );
250 
251 protected:
256  virtual void changeEvent( QEvent *e );
257 
258 private Q_SLOTS:
263  void slotHeaderContextMenuRequested( const QPoint &clickPoint );
264 
269  void slotToggleColumnActionTriggered( bool );
270 
271 private:
272  bool mEnableManualColumnHiding;
273 
274 };
275 
276 } // namespace KPIM
277 
278 #endif
KPIM::TreeWidget
A QTreeWidget with expanded capabilities.
Definition: treewidget.h:56
QTreeWidget
QWidget
KPIM::TreeWidget::manualColumnHidingEnabled
bool manualColumnHidingEnabled() const
Definition: treewidget.h:169
knode_export.h
QTreeWidgetItem
KNODE_EXPORT
#define KNODE_EXPORT
Definition: knode_export.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:36 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

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