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

kcachegrind

  • sources
  • kde-4.12
  • kdesdk
  • kcachegrind
  • libviews
functionselection.h
Go to the documentation of this file.
1 /* This file is part of KCachegrind.
2  Copyright (C) 2002, 2003 Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
3 
4  KCachegrind is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public
6  License as published by the Free Software Foundation, version 2.
7 
8  This program 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  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; see the file COPYING. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 /*
20  * For function selection, to be put into a QDockWindow
21  */
22 
23 #ifndef FUNCTIONSELECTION_H
24 #define FUNCTIONSELECTION_H
25 
26 #include <QTimer>
27 #include <QWidget>
28 #include <QModelIndex>
29 #include <QStyledItemDelegate>
30 
31 #include "tracedata.h"
32 #include "traceitemview.h"
33 #include "listutils.h"
34 #include "toplevelbase.h"
35 
36 class QAction;
37 class QMenu;
38 class QLabel;
39 class QComboBox;
40 class QLineEdit;
41 class QTreeView;
42 class QTreeWidget;
43 class QTreeWidgetItem;
44 class FunctionListModel;
45 
46 class FunctionSelection: public QWidget, public TraceItemView
47 {
48  Q_OBJECT
49 
50 public:
51  explicit FunctionSelection(TopLevelBase*, QWidget* parent = 0);
52 
53  TraceCostItem* group() { return _group; }
54  TraceCostItem* group(QString);
55  void setGroup(TraceCostItem*);
56  void query(QString);
57  bool selectTopFunction();
58 
59  QWidget* widget() { return this; }
60  QString whatsThis() const;
61  void setData(TraceData*);
62 
63  void addGroupMenu(QMenu*);
64 
65 public slots:
66  void searchReturnPressed();
67  void searchChanged(const QString&);
68  void queryDelayed();
69 
70  void groupTypeSelected(QAction*);
71  void groupTypeSelected(int);
72  void groupDoubleClicked(QTreeWidgetItem*, int);
73  void groupSelected(QTreeWidgetItem*, QTreeWidgetItem*);
74  void groupContext(const QPoint &);
75  void groupHeaderClicked(int);
76 
77  void functionActivated(const QModelIndex&);
78  void functionContext(const QPoint &);
79  void functionHeaderClicked(int);
80 
81 private:
82  CostItem* canShow(CostItem* i);
83  void doUpdate(int, bool);
84  void selectFunction();
85  void refresh();
86  void setCostColumnWidths();
87  void updateGroupSizes(bool hideEmpty);
88  void addGroupAction(QMenu*, ProfileContext::Type,
89  const QString& s = QString());
90  void selectFunction(TraceFunction* f, bool ensureVisible = true);
91 
92  TraceCostItem* _group;
93 
94  QString _searchString, _searchDelayed;
95  QTimer _searchTimer;
96  QMap<TraceCostItem*,int> _groupSize;
97 
98  HighestCostList _hc;
99  // when setting a
100  bool _inSetGroup, _inSetFunction;
101 
102  QLabel *searchLabel;
103  QLineEdit *searchEdit;
104  QComboBox *groupBox;
105  QTreeWidget *groupList;
106  QTreeView *functionList;
107  FunctionListModel* functionListModel;
108 
109  Qt::SortOrder _functionListSortOrder;
110 };
111 
112 
113 /* Custom item delegate for function list:
114  * show tooltip for function name if truncated.
115  * (thanks to http://www.mimec.org/node/337)
116  */
117 class AutoToolTipDelegate : public QStyledItemDelegate
118 {
119  Q_OBJECT
120 public:
121  AutoToolTipDelegate(QObject* parent = 0);
122  ~AutoToolTipDelegate();
123 
124 public slots:
125  bool helpEvent( QHelpEvent* e, QAbstractItemView* view,
126  const QStyleOptionViewItem& option,
127  const QModelIndex& index );
128 };
129 
130 #endif
QTreeWidget
QWidget
TraceFunction
A traced function.
Definition: tracedata.h:1122
TraceCostItem
Definition: tracedata.h:980
FunctionSelection::searchChanged
void searchChanged(const QString &)
Definition: functionselection.cpp:270
FunctionSelection::selectTopFunction
bool selectTopFunction()
Definition: functionselection.cpp:846
FunctionSelection::searchReturnPressed
void searchReturnPressed()
Definition: functionselection.cpp:243
CostItem
Base class for cost items.
Definition: costitem.h:37
FunctionSelection::setGroup
void setGroup(TraceCostItem *)
Definition: functionselection.cpp:548
traceitemview.h
AutoToolTipDelegate::helpEvent
bool helpEvent(QHelpEvent *e, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index)
Definition: functionselection.cpp:55
FunctionSelection::group
TraceCostItem * group()
Definition: functionselection.h:53
FunctionSelection::functionContext
void functionContext(const QPoint &)
Definition: functionselection.cpp:285
QStyledItemDelegate
AutoToolTipDelegate
Definition: functionselection.h:117
TraceItemView
Abstract Base Class for KCachegrind Views.
Definition: traceitemview.h:70
FunctionSelection::FunctionSelection
FunctionSelection(TopLevelBase *, QWidget *parent=0)
Definition: functionselection.cpp:88
tracedata.h
toplevelbase.h
HighestCostList
A class to calculate the ProfileCostArray items with highest cost.
Definition: subcost.h:78
listutils.h
TopLevelBase
Definition: toplevelbase.h:34
FunctionSelection::functionActivated
void functionActivated(const QModelIndex &)
Definition: functionselection.cpp:754
FunctionSelection::widget
QWidget * widget()
Definition: functionselection.h:59
FunctionSelection::functionHeaderClicked
void functionHeaderClicked(int)
Definition: functionselection.cpp:874
AutoToolTipDelegate::~AutoToolTipDelegate
~AutoToolTipDelegate()
Definition: functionselection.cpp:52
FunctionSelection::groupHeaderClicked
void groupHeaderClicked(int)
Definition: functionselection.cpp:736
FunctionSelection::whatsThis
QString whatsThis() const
Definition: functionselection.cpp:215
FunctionSelection
Definition: functionselection.h:46
FunctionSelection::query
void query(QString)
Definition: functionselection.cpp:777
FunctionSelection::groupContext
void groupContext(const QPoint &)
Definition: functionselection.cpp:315
QTreeWidgetItem
FunctionSelection::setData
void setData(TraceData *)
Definition: functionselection.cpp:232
FunctionSelection::groupDoubleClicked
void groupDoubleClicked(QTreeWidgetItem *, int)
Definition: functionselection.cpp:723
FunctionSelection::groupSelected
void groupSelected(QTreeWidgetItem *, QTreeWidgetItem *)
Definition: functionselection.cpp:702
FunctionSelection::groupTypeSelected
void groupTypeSelected(QAction *)
Definition: functionselection.cpp:364
ProfileContext::Type
Type
Definition: context.h:36
FunctionSelection::queryDelayed
void queryDelayed()
Definition: functionselection.cpp:280
TraceData
This class holds profiling data of multiple tracefiles generated with cachegrind on one command...
Definition: tracedata.h:1363
FunctionListModel
Definition: functionlistmodel.h:31
FunctionSelection::addGroupMenu
void addGroupMenu(QMenu *)
Definition: functionselection.cpp:346
AutoToolTipDelegate::AutoToolTipDelegate
AutoToolTipDelegate(QObject *parent=0)
Definition: functionselection.cpp:48
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:03:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kcachegrind

Skip menu "kcachegrind"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

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