• 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
instritem.h
Go to the documentation of this file.
1 /* This file is part of KCachegrind.
2  Copyright (C) 2003-2011 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  * Items of instruction view.
21  */
22 
23 #ifndef INSTRITEM_H
24 #define INSTRITEM_H
25 
26 
27 #include <QTreeWidget>
28 #include <QItemDelegate>
29 
30 #include "tracedata.h"
31 
32 class InstrView;
33 
34 class InstrItem: public QTreeWidgetItem
35 {
36 
37 public:
38  // for messages
39  InstrItem(InstrView* iv, QTreeWidget* parent,
40  Addr addr, const QString&);
41 
42  // for instruction lines
43  InstrItem(InstrView* iv, QTreeWidget* parent,
44  Addr addr, bool inside,
45  const QString&, const QString&, const QString&,
46  TraceInstr* instr);
47 
48  // for call instr
49  InstrItem(InstrView* iv, QTreeWidgetItem* parent, Addr addr,
50  TraceInstr* instr, TraceInstrCall* instrCall);
51 
52  // for jump lines
53  InstrItem(InstrView* iv, QTreeWidgetItem* parent, Addr addr,
54  TraceInstr* instr, TraceInstrJump* instrJump);
55 
56  Addr addr() const { return _addr; }
57  bool inside() const { return _inside; }
58  TraceInstr* instr() const { return _instr; }
59  TraceInstrCall* instrCall() const { return _instrCall; }
60  TraceInstrJump* instrJump() const { return _instrJump; }
61  TraceInstrJump* jump(int i) const { return _jump[i]; }
62  int jumpCount() const { return _jump.size(); }
63  bool operator< ( const QTreeWidgetItem & other ) const;
64 
65  void updateGroup();
66  void updateCost();
67 
68  // arrow lines
69  void setJumpArray(const QVector<TraceInstrJump*>& a);
70 
71 private:
72  InstrView* _view;
73  SubCost _pure, _pure2;
74  Addr _addr;
75  TraceInstr* _instr;
76  TraceInstrJump* _instrJump;
77  TraceInstrCall* _instrCall;
78  bool _inside;
79 
80  QVector<TraceInstrJump*> _jump;
81 };
82 
83 // Delegate for drawing the arrows column
84 
85 class InstrItemDelegate : public QItemDelegate
86 {
87 public:
88  InstrItemDelegate(InstrView *parent);
89  void paint(QPainter *painter, const QStyleOptionViewItem &option,
90  const QModelIndex & index ) const;
91  QSize sizeHint(const QStyleOptionViewItem &option,
92  const QModelIndex &index) const;
93 
94 protected:
95  void paintArrows(QPainter *p,
96  const QStyleOptionViewItem &option,
97  const QModelIndex &index) const;
98 
99  InstrView* _parent;
100 };
101 
102 
103 #endif // INSTRITEM_H
InstrItem::jumpCount
int jumpCount() const
Definition: instritem.h:62
InstrItem::operator<
bool operator<(const QTreeWidgetItem &other) const
Definition: instritem.cpp:256
InstrItem::instr
TraceInstr * instr() const
Definition: instritem.h:58
QTreeWidget
InstrItem::setJumpArray
void setJumpArray(const QVector< TraceInstrJump * > &a)
Definition: instritem.cpp:298
TraceInstrCall
A call from an instruction of one function to another function.
Definition: tracedata.h:782
Addr
Addresses are 64bit values like costs to be able to always load profile data produced on 64bit archit...
Definition: addr.h:31
InstrItem::jump
TraceInstrJump * jump(int i) const
Definition: instritem.h:61
InstrItemDelegate
Definition: instritem.h:85
tracedata.h
InstrItemDelegate::_parent
InstrView * _parent
Definition: instritem.h:99
InstrItemDelegate::InstrItemDelegate
InstrItemDelegate(InstrView *parent)
Definition: instritem.cpp:308
TraceInstr
A code instruction address of the program.
Definition: tracedata.h:887
InstrItem::updateGroup
void updateGroup()
Definition: instritem.cpp:168
QTreeWidgetItem
InstrItem::inside
bool inside() const
Definition: instritem.h:57
TraceInstrJump
A jump from an instruction to another inside of a function.
Definition: tracedata.h:725
QItemDelegate
InstrItemDelegate::paintArrows
void paintArrows(QPainter *p, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: instritem.cpp:352
InstrView
Definition: instrview.h:32
InstrItem::addr
Addr addr() const
Definition: instritem.h:56
SubCost
Cost event counter, simple wrapper around a 64bit entity.
Definition: subcost.h:32
InstrItemDelegate::paint
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: instritem.cpp:331
InstrItem
Definition: instritem.h:34
InstrItem::updateCost
void updateCost()
Definition: instritem.cpp:177
InstrItem::InstrItem
InstrItem(InstrView *iv, QTreeWidget *parent, Addr addr, const QString &)
Definition: instritem.cpp:38
InstrItem::instrCall
TraceInstrCall * instrCall() const
Definition: instritem.h:59
InstrItem::instrJump
TraceInstrJump * instrJump() const
Definition: instritem.h:60
InstrItemDelegate::sizeHint
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: instritem.cpp:313
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