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

kcachegrind

  • sources
  • kde-4.14
  • kdesdk
  • kcachegrind
  • qcachegrind
qcgtoplevel.cpp
Go to the documentation of this file.
1 /* This file is part of KCachegrind.
2  Copyright (C) 2002 - 2009 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  * QCachegrind top level window
21  */
22 
23 #define TRACE_UPDATES 0
24 
25 #include "qcgtoplevel.h"
26 
27 #include <stdlib.h> // for system()
28 
29 #include <QApplication>
30 #include <QDebug>
31 #include <QDockWidget>
32 #include <QTimer>
33 #include <QByteArray>
34 #include <QLabel>
35 #include <QMenuBar>
36 #include <QProgressBar>
37 #include <QFile>
38 #include <QFileDialog>
39 #include <QEventLoop>
40 #include <QToolBar>
41 #include <QComboBox>
42 #include <QMessageBox>
43 #include <QStatusBar>
44 #include <QWhatsThis>
45 
46 #ifdef QT_DBUS_SUPPORT
47 #include <QtDBus/QDBusConnection>
48 #endif
49 
50 #include "partselection.h"
51 #include "functionselection.h"
52 #include "stackselection.h"
53 #include "stackbrowser.h"
54 #include "tracedata.h"
55 #include "config.h"
56 #include "globalguiconfig.h"
57 #include "multiview.h"
58 #include "callgraphview.h"
59 #include "configdialog.h"
60 
61 QCGTopLevel::QCGTopLevel()
62 {
63 #ifdef QT_DBUS_SUPPORT
64  QDBusConnection con = QDBusConnection::sessionBus();
65  con.registerObject("/QCachegrind", this,
66  QDBusConnection::ExportScriptableSlots);
67 #endif
68 
69  _progressBar = 0;
70  _statusbar = statusBar();
71  _statusLabel = new QLabel(_statusbar);
72  _statusbar->addWidget(_statusLabel, 1);
73 
74  _layoutCount = 1;
75  _layoutCurrent = 0;
76 
77  resetState();
78 
79  GlobalGUIConfig::config()->readOptions();
80 
81  createActions();
82  createDocks();
83  createMenu();
84  createToolbar();
85 
86  _multiView = new MultiView(this, this);
87  _multiView->setObjectName("MultiView");
88  setCentralWidget(_multiView);
89 
90  // restore current state settings (not configuration options)
91  restoreCurrentState(QString::null);
92 
93  // restore docks & toolbars from config
94  QByteArray state, geometry;
95  ConfigGroup* topConfig = ConfigStorage::group("TopWindow");
96  _forcePartDock = topConfig->value("ForcePartDockVisible", false).toBool();
97  state = topConfig->value("State", QByteArray()).toByteArray();
98  geometry = topConfig->value("Geometry", QByteArray()).toByteArray();
99  delete topConfig;
100 
101  if (!geometry.isEmpty())
102  restoreGeometry(geometry);
103  if (!state.isEmpty())
104  restoreState(state);
105 
106  setWindowIcon(QIcon(":/app.png"));
107  setAttribute(Qt::WA_DeleteOnClose);
108 }
109 
110 QCGTopLevel::~QCGTopLevel()
111 {
112  delete _data;
113 }
114 
115 // reset the visualization state, e.g. before loading new data
116 void QCGTopLevel::resetState()
117 {
118  _activeParts.clear();
119  _hiddenParts.clear();
120 
121  _data = 0;
122  _function = 0;
123  _eventType = 0;
124  _eventType2 = 0;
125  _groupType = ProfileContext::InvalidType;
126  _group = 0;
127 
128  // for delayed slots
129  _traceItemDelayed = 0;
130  _eventTypeDelayed = 0;
131  _eventType2Delayed = 0;
132  _groupTypeDelayed = ProfileContext::InvalidType;
133  _groupDelayed = 0;
134  _directionDelayed = TraceItemView::None;
135  _lastSender = 0;
136 }
137 
138 
146 void QCGTopLevel::saveCurrentState(const QString& postfix)
147 {
148  QString eventType, eventType2;
149  if (_eventType) eventType = _eventType->name();
150  if (_eventType2) eventType2 = _eventType2->name();
151 
152  ConfigGroup* stateConfig = ConfigStorage::group(QString("CurrentState") + postfix);
153  stateConfig->setValue("EventType", eventType);
154  stateConfig->setValue("EventType2", eventType2);
155  stateConfig->setValue("GroupType", ProfileContext::typeName(_groupType));
156  delete stateConfig;
157 
158  _partSelection->saveOptions(QString("PartOverview"), postfix);
159  _multiView->saveLayout(QString("MainView"), postfix);
160  _multiView->saveOptions(QString("MainView"), postfix);
161 }
162 
167 void QCGTopLevel::saveTraceSettings()
168 {
169  QString key = traceKey();
170 
171  ConfigGroup* lConfig = ConfigStorage::group("Layouts");
172  lConfig->setValue(QString("Count%1").arg(key), _layoutCount);
173  lConfig->setValue(QString("Current%1").arg(key), _layoutCurrent);
174  delete lConfig;
175 
176  ConfigGroup* pConfig = ConfigStorage::group("TracePositions");
177  if (_eventType)
178  pConfig->setValue(QString("EventType%1").arg(key), _eventType->name());
179  if (_eventType2)
180  pConfig->setValue(QString("EventType2%1").arg(key), _eventType2->name());
181  if (_groupType != ProfileContext::InvalidType)
182  pConfig->setValue(QString("GroupType%1").arg(key),
183  ProfileContext::typeName(_groupType));
184 
185  if (_data) {
186  if (_group)
187  pConfig->setValue(QString("Group%1").arg(key), _group->name());
188  saveCurrentState(key);
189  }
190  delete pConfig;
191 }
192 
197 void QCGTopLevel::restoreCurrentState(const QString& postfix)
198 {
199  _partSelection->restoreOptions(QString("PartOverview"), postfix);
200  _multiView->restoreLayout(QString("MainView"), postfix);
201  _multiView->restoreOptions(QString("MainView"), postfix);
202 
203  _splittedToggleAction->setChecked(_multiView->childCount()>1);
204  _splitDirectionToggleAction->setEnabled(_multiView->childCount()>1);
205  _splitDirectionToggleAction->setChecked(_multiView->orientation() ==
206  Qt::Horizontal);
207 }
208 
209 void QCGTopLevel::sidebarMenuAboutToShow()
210 {
211  QAction* action;
212  QMenu *popup = _sidebarMenuAction->menu();
213 
214  popup->clear();
215 
216  action = popup->addAction(tr("Parts Overview"));
217  action->setCheckable(true);
218  action->setChecked(_partDock->isVisible());
219  connect(action, SIGNAL(triggered(bool)), this, SLOT(togglePartDock()));
220 
221  action = popup->addAction(tr("Top Cost Call Stack"));
222  action->setCheckable(true);
223  action->setChecked(_stackDock->isVisible());
224  connect(action, SIGNAL(triggered(bool)), this, SLOT(toggleStackDock()));
225 
226  action = popup->addAction(tr("Flat Profile"));
227  action->setCheckable(true);
228  action->setChecked(_functionDock->isVisible());
229  connect(action, SIGNAL(triggered(bool)), this, SLOT(toggleFunctionDock()));
230 }
231 
232 void QCGTopLevel::recentFilesMenuAboutToShow()
233 {
234  QStringList recentFiles;
235  QMenu *popup = _recentFilesMenuAction->menu();
236 
237  popup->clear();
238 
239  ConfigGroup* generalConfig = ConfigStorage::group("GeneralSettings");
240  recentFiles = generalConfig->value("RecentFiles",
241  QStringList()).toStringList();
242  delete generalConfig;
243 
244  if (recentFiles.count() == 0)
245  popup->addAction(tr("(No recent files)"));
246  else {
247  foreach(const QString& file, recentFiles) {
248  // paths shown to user should use OS-native separators
249  popup->addAction(QDir::toNativeSeparators(file));
250  }
251  }
252 }
253 
254 void QCGTopLevel::recentFilesTriggered(QAction* action)
255 {
256  if (action)
257  load(QStringList(QDir::fromNativeSeparators(action->text())));
258 }
259 
260 void QCGTopLevel::createDocks()
261 {
262  // part visualization/selection side bar
263  _partDock = new QDockWidget(this);
264  _partDock->setObjectName("part-dock");
265  _partDock->setWindowTitle(tr("Parts Overview"));
266  _partSelection = new PartSelection(this, _partDock);
267  _partDock->setWidget(_partSelection);
268 
269  connect(_partSelection, SIGNAL(partsHideSelected()),
270  this, SLOT(partsHideSelectedSlotDelayed()));
271  connect(_partSelection, SIGNAL(partsUnhideAll()),
272  this, SLOT(partsUnhideAllSlotDelayed()));
273 
274  // stack selection side bar
275  _stackDock = new QDockWidget(this);
276  _stackDock->setObjectName("stack-dock");
277  _stackSelection = new StackSelection(_stackDock);
278  _stackDock->setWidget(_stackSelection);
279  _stackDock->setWindowTitle(tr("Top Cost Call Stack"));
280  _stackSelection->setWhatsThis( tr(
281  "<b>The Top Cost Call Stack</b>"
282  "<p>This is a purely fictional 'most probable' call stack. "
283  "It is built up by starting with the current selected "
284  "function and adds the callers/callees with highest cost "
285  "at the top and to bottom.</p>"
286  "<p>The <b>Cost</b> and <b>Calls</b> columns show the "
287  "cost used for all calls from the function in the line "
288  "above.</p>"));
289  connect(_stackSelection, SIGNAL(functionSelected(CostItem*)),
290  this, SLOT(setTraceItemDelayed(CostItem*)));
291  // actions are already created
292  connect(_upAction, SIGNAL(triggered(bool)),
293  _stackSelection, SLOT(browserUp()) );
294  connect(_backAction, SIGNAL(triggered(bool)),
295  _stackSelection, SLOT(browserBack()) );
296  connect(_forwardAction, SIGNAL(triggered(bool)),
297  _stackSelection, SLOT(browserForward()));
298 
299  // flat function profile side bar
300  _functionDock = new QDockWidget(this);
301  _functionDock->setObjectName("function-dock");
302  _functionDock->setWindowTitle(tr("Flat Profile"));
303  _functionSelection = new FunctionSelection(this, _functionDock);
304  _functionDock->setWidget(_functionSelection);
305  // functionDock needs call to updateView() when getting visible
306  connect(_functionDock, SIGNAL(visibilityChanged(bool)),
307  this, SLOT(functionVisibilityChanged(bool)));
308 
309  // defaults (later to be adjusted from stored state in config)
310  addDockWidget(Qt::LeftDockWidgetArea, _partDock );
311  addDockWidget(Qt::LeftDockWidgetArea, _stackDock );
312  addDockWidget(Qt::LeftDockWidgetArea, _functionDock );
313  _stackDock->hide();
314  _partDock->hide();
315 }
316 
317 
318 
319 
320 void QCGTopLevel::createActions()
321 {
322  QString hint;
323  QIcon icon;
324 
325  // file menu actions
326  _newAction = new QAction(tr("&New"), this);
327  _newAction->setShortcuts(QKeySequence::New);
328  _newAction->setStatusTip(tr("Open new empty window"));
329  connect(_newAction, SIGNAL(triggered()), this, SLOT(newWindow()));
330 
331  icon = QApplication::style()->standardIcon(QStyle::SP_DialogOpenButton);
332  _openAction = new QAction(icon, tr("&Open..."), this);
333  _openAction->setShortcuts(QKeySequence::Open);
334  _openAction->setStatusTip(tr("Open profile data file"));
335  connect(_openAction, SIGNAL(triggered()), this, SLOT(load()));
336 
337  _addAction = new QAction(tr( "&Add..." ), this);
338  _addAction->setStatusTip(tr("Add profile data to current window"));
339  connect(_addAction, SIGNAL(triggered(bool)), SLOT(add()));
340 
341  _exportAction = new QAction(tr("Export Graph"), this);
342  _exportAction->setStatusTip(tr("Generate GraphViz file 'callgraph.dot'"));
343  connect(_exportAction, SIGNAL(triggered(bool)), SLOT(exportGraph()));
344 
345  _recentFilesMenuAction = new QAction(tr("Open &Recent"), this);
346  _recentFilesMenuAction->setMenu(new QMenu(this));
347  connect(_recentFilesMenuAction->menu(), SIGNAL(aboutToShow()),
348  this, SLOT(recentFilesMenuAboutToShow()));
349  connect(_recentFilesMenuAction->menu(), SIGNAL(triggered(QAction*)),
350  this, SLOT(recentFilesTriggered(QAction*)));
351 
352  _exitAction = new QAction(tr("E&xit"), this);
353  _exitAction->setShortcut(tr("Ctrl+Q"));
354  _exitAction->setStatusTip(tr("Exit the application"));
355  connect(_exitAction, SIGNAL(triggered()), this, SLOT(close()));
356 
357  // view menu actions
358  icon = QApplication::style()->standardIcon(QStyle::SP_BrowserReload);
359  _cyclesToggleAction = new QAction(icon, tr("Detect Cycles"), this);
360  _cyclesToggleAction->setCheckable(true);
361  _cyclesToggleAction->setStatusTip(tr("Do Cycle Detection"));
362  hint = tr("<b>Detect recursive cycles</b>"
363  "<p>If this is switched off, the treemap drawing will show "
364  "black areas when a recursive call is made instead of drawing "
365  "the recursion ad infinitum. Note that "
366  "the size of black areas often will be wrong, as inside "
367  "recursive cycles the cost of calls cannot be determined; "
368  "the error is small, "
369  "however, for false cycles (see documentation).</p>"
370  "<p>The correct handling for cycles is to detect them and "
371  "collapse all functions of a cycle into an artificial "
372  "function, which is done when this option is selected. "
373  "Unfortunately, with GUI applications, this often will "
374  "lead to huge false cycles, making the analysis impossible; "
375  "therefore, there is the option to switch this off.</p>");
376  _cyclesToggleAction->setWhatsThis(hint);
377  connect(_cyclesToggleAction, SIGNAL(triggered(bool)),
378  this, SLOT(toggleCycles()));
379  _cyclesToggleAction->setChecked(GlobalConfig::showCycles());
380 
381  _percentageToggleAction = new QAction(QIcon(":/percent.png"),
382  tr("Relative Cost"), this);
383  _percentageToggleAction->setCheckable(true);
384  _percentageToggleAction->setStatusTip(tr("Show Relative Costs"));
385  connect(_percentageToggleAction, SIGNAL(triggered(bool)),
386  this, SLOT(togglePercentage()));
387  _percentageToggleAction->setChecked(GlobalConfig::showPercentage());
388 
389  _hideTemplatesToggleAction = new QAction(QIcon(":/hidetemplates.png"),
390  tr("Shorten Templates"), this);
391  _hideTemplatesToggleAction->setCheckable(true);
392  _hideTemplatesToggleAction->setStatusTip(tr("Hide Template Parameters "
393  "in C++ Symbols"));
394  connect(_hideTemplatesToggleAction, SIGNAL(triggered(bool)),
395  this, SLOT(toggleHideTemplates()));
396  _hideTemplatesToggleAction->setChecked(GlobalConfig::hideTemplates());
397  hint = tr("<b>Hide Template Parameters in C++ Symbols</b>"
398  "<p>If this is switched on, every symbol displayed will have "
399  "any C++ template parameters hidden, just showing &lt;&gt; "
400  "instead of a potentially nested template parameter.</p>"
401  "<p>In this mode, you can hover the mouse pointer over the "
402  "activated symbol label to show a tooltip with the "
403  "unabbreviated symbol.</p>");
404  _hideTemplatesToggleAction->setWhatsThis(hint);
405 
406  _expandedToggleAction = new QAction(QIcon(":/move.png"),
407  tr("Relative to Parent"), this);
408  _expandedToggleAction->setCheckable(true);
409  _expandedToggleAction->setStatusTip(
410  tr("Show Percentage relative to Parent"));
411  hint = tr("<b>Show percentage costs relative to parent</b>"
412  "<p>If this is switched off, percentage costs are always "
413  "shown relative to the total cost of the profile part(s) "
414  "that are currently browsed. By turning on this option, "
415  "percentage cost of shown cost items will be relative "
416  "to the parent cost item.</p>"
417  "<ul><table>"
418  "<tr><td><b>Cost Type</b></td><td><b>Parent Cost</b></td></tr>"
419  "<tr><td>Function Inclusive</td><td>Total</td></tr>"
420  "<tr><td>Function Self</td><td>Function Group (*)/Total</td></tr>"
421  "<tr><td>Call</td><td>Function Inclusive</td></tr>"
422  "<tr><td>Source Line</td><td>Function Inclusive</td></tr>"
423  "</table></ul>"
424  "<p>(*) Only if function grouping is switched on "
425  "(e.g. ELF object grouping).</p>");
426  _expandedToggleAction->setWhatsThis( hint );
427  connect(_expandedToggleAction, SIGNAL(triggered(bool)),
428  this, SLOT(toggleExpanded()));
429  _expandedToggleAction->setChecked(GlobalConfig::showExpanded());
430 
431  _splittedToggleAction = new QAction(tr("Splitted Visualization"), this);
432  _splittedToggleAction->setCheckable(true);
433  _splittedToggleAction->setStatusTip(
434  tr("Show visualization of two cost items"));
435  connect(_splittedToggleAction, SIGNAL(triggered(bool)),
436  this, SLOT(toggleSplitted()));
437 
438  _splitDirectionToggleAction = new QAction(tr("Split Horizontal"), this);
439  _splitDirectionToggleAction->setCheckable(true);
440  _splitDirectionToggleAction->setStatusTip(
441  tr("Split visualization area horizontally"));
442  connect(_splitDirectionToggleAction, SIGNAL(triggered(bool)),
443  this, SLOT(toggleSplitDirection()));
444 
445  _sidebarMenuAction = new QAction(tr("Sidebars"), this);
446  _sidebarMenuAction->setMenu(new QMenu(this));
447  connect( _sidebarMenuAction->menu(), SIGNAL( aboutToShow() ),
448  this, SLOT( sidebarMenuAboutToShow() ));
449 
450  _layoutDup = new QAction(tr("&Duplicate"), this);
451  connect(_layoutDup, SIGNAL(triggered()), SLOT(layoutDuplicate()));
452  _layoutDup->setShortcut(Qt::CTRL + Qt::Key_Plus);
453  _layoutDup->setStatusTip(tr("Duplicate current layout"));
454 
455  _layoutRemove = new QAction(tr("&Remove"), this);
456  connect(_layoutRemove, SIGNAL(triggered()), SLOT(layoutRemove()));
457  _layoutRemove->setStatusTip(tr("Remove current layout"));
458 
459  _layoutNext = new QAction(tr("Go to &Next"), this);
460  connect(_layoutNext, SIGNAL(triggered()), SLOT(layoutNext()));
461  _layoutNext->setShortcut(Qt::CTRL + Qt::Key_Right);
462  _layoutNext->setStatusTip(tr("Switch to next layout"));
463 
464  _layoutPrev = new QAction(tr("Go to &Previous"), this);
465  connect(_layoutPrev, SIGNAL(triggered()), SLOT(layoutPrevious()));
466  _layoutPrev->setShortcut(Qt::CTRL + Qt::Key_Left);
467  _layoutPrev->setStatusTip(tr("Switch to previous layout"));
468 
469  _layoutRestore = new QAction(tr("&Restore to Default"), this);
470  connect(_layoutRestore, SIGNAL(triggered()), SLOT(layoutRestore()));
471  _layoutRestore->setStatusTip(tr("Restore layouts to default"));
472 
473  _layoutSave = new QAction(tr("&Save as Default"), this);
474  connect(_layoutSave, SIGNAL(triggered()), SLOT(layoutSave()));
475  _layoutSave->setStatusTip(tr("Save layouts as default"));
476 
477  // go menu actions
478  icon = QApplication::style()->standardIcon(QStyle::SP_ArrowUp);
479  _upAction = new QAction(icon, tr( "Up" ), this );
480  _upAction->setShortcut( QKeySequence(Qt::ALT+Qt::Key_Up) );
481  _upAction->setStatusTip(tr("Go Up in Call Stack"));
482  _upAction->setMenu(new QMenu(this));
483  connect(_upAction->menu(), SIGNAL(aboutToShow()),
484  this, SLOT(upAboutToShow()) );
485  connect(_upAction->menu(), SIGNAL(triggered(QAction*)),
486  this, SLOT(upTriggered(QAction*)) );
487  hint = tr("Go to last selected caller of current function");
488  _upAction->setToolTip(hint);
489 
490  icon = QApplication::style()->standardIcon(QStyle::SP_ArrowBack);
491  _backAction = new QAction(icon, tr("Back"), this);
492  _backAction->setShortcut( QKeySequence(Qt::ALT+Qt::Key_Left) );
493  _backAction->setStatusTip(tr("Go Back"));
494  _backAction->setMenu(new QMenu(this));
495  connect(_backAction->menu(), SIGNAL(aboutToShow()),
496  this, SLOT(backAboutToShow()) );
497  connect(_backAction->menu(), SIGNAL(triggered(QAction*)),
498  this, SLOT(backTriggered(QAction*)) );
499  hint = tr("Go back in function selection history");
500  _backAction->setToolTip(hint);
501 
502  icon = QApplication::style()->standardIcon(QStyle::SP_ArrowForward);
503  _forwardAction = new QAction(icon, tr("Forward"), this);
504  _forwardAction->setShortcut( QKeySequence(Qt::ALT+Qt::Key_Right) );
505  _forwardAction->setStatusTip(tr("Go Forward"));
506  _forwardAction->setMenu(new QMenu(this));
507  connect(_forwardAction->menu(), SIGNAL(aboutToShow()),
508  this, SLOT(forwardAboutToShow()) );
509  connect(_forwardAction->menu(), SIGNAL(triggered(QAction*)),
510  this, SLOT(forwardTriggered(QAction*)) );
511  hint = tr("Go forward in function selection history");
512  _forwardAction->setToolTip( hint );
513 
514  // settings menu actions
515  _configureAction = new QAction(tr("&Configure..."), this);
516  _configureAction->setStatusTip(tr("Configure QCachegrind"));
517  connect(_configureAction, SIGNAL(triggered()), this, SLOT(configure()));
518 
519  // help menu actions
520  _aboutAction = new QAction(tr("&About QCachegrind..."), this);
521  _aboutAction->setStatusTip(tr("Show the application's About box"));
522  connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about()));
523 
524  _aboutQtAction = new QAction(tr("About Qt..."), this);
525  connect(_aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
526 
527  // toolbar actions
528  _eventTypeBox = new QComboBox(this);
529  _eventTypeBox->setMinimumContentsLength(25);
530  hint = tr("Select primary event type of costs");
531  _eventTypeBox->setToolTip( hint );
532  connect( _eventTypeBox, SIGNAL(activated(const QString&)),
533  this, SLOT(eventTypeSelected(const QString&)));
534 }
535 
536 void QCGTopLevel::createMenu()
537 {
538  QMenuBar* mBar = menuBar();
539 
540  QMenu* fileMenu = mBar->addMenu(tr("&File"));
541  fileMenu->addAction(_newAction);
542  fileMenu->addAction(_openAction);
543  fileMenu->addAction(_recentFilesMenuAction);
544  fileMenu->addAction(_addAction);
545  fileMenu->addSeparator();
546  fileMenu->addAction(_exportAction);
547  fileMenu->addSeparator();
548  fileMenu->addAction(_exitAction);
549 
550  QMenu* layoutMenu = new QMenu(tr("&Layout"), this);
551  layoutMenu->addAction(_layoutDup);
552  layoutMenu->addAction(_layoutRemove);
553  layoutMenu->addSeparator();
554  layoutMenu->addAction(_layoutPrev);
555  layoutMenu->addAction(_layoutNext);
556  layoutMenu->addSeparator();
557  layoutMenu->addAction(_layoutSave);
558  layoutMenu->addAction(_layoutRestore);
559 
560  QMenu* viewMenu = mBar->addMenu(tr("&View"));
561  viewMenu->addAction(_cyclesToggleAction);
562  viewMenu->addAction(_percentageToggleAction);
563  viewMenu->addAction(_expandedToggleAction);
564  viewMenu->addAction(_hideTemplatesToggleAction);
565  viewMenu->addSeparator();
566  viewMenu->addAction(_splittedToggleAction);
567  viewMenu->addAction(_splitDirectionToggleAction);
568  viewMenu->addMenu(layoutMenu);
569 
570  QMenu* goMenu = mBar->addMenu(tr("&Go"));
571  goMenu->addAction(_backAction);
572  goMenu->addAction(_forwardAction);
573  goMenu->addAction(_upAction);
574 
575  QMenu* settingsMenu = mBar->addMenu(tr("&Settings"));
576  settingsMenu->addAction(_sidebarMenuAction);
577  settingsMenu->addSeparator();
578  settingsMenu->addAction(_configureAction);
579 
580  QMenu* helpMenu = mBar->addMenu(tr("&Help"));
581  helpMenu->addAction(QWhatsThis::createAction(this));
582  helpMenu->addSeparator();
583  helpMenu->addAction(_aboutAction);
584  helpMenu->addAction(_aboutQtAction);
585 }
586 
587 void QCGTopLevel::createToolbar()
588 {
589  QToolBar* tb = new QToolBar(tr("Main Toolbar"), this);
590  tb->setObjectName("main-toolbar");
591  addToolBar(Qt::TopToolBarArea, tb);
592 
593  tb->addAction(_openAction);
594  tb->addSeparator();
595 
596  tb->addAction(_cyclesToggleAction);
597  tb->addAction(_percentageToggleAction);
598  tb->addAction(_expandedToggleAction);
599  tb->addAction(_hideTemplatesToggleAction);
600  tb->addSeparator();
601 
602  tb->addAction(_backAction);
603  tb->addAction(_forwardAction);
604  tb->addAction(_upAction);
605  tb->addSeparator();
606 
607  tb->addWidget(_eventTypeBox);
608 }
609 
610 
611 void QCGTopLevel::about()
612 {
613  QString text, version;
614  version = QLatin1String("0.7.4kde");
615  text = QString("<h3>QCachegrind %1</h3>").arg(version);
616  text += tr("<p>QCachegrind is a graphical user interface for analysing "
617  "profiling data, which helps in the performance optimization "
618  "phase of developing a computer program. "
619  "QCachegrind is open-source, and it is distributed under the "
620  "terms of the GPL v2. For details and source code, see the "
621  "<a href=\"http://kcachegrind.sf.net\">homepage</a> of the "
622  "KCachegrind project.</p>"
623  "Main author and maintainer: "
624  "<a href=\"mailto:Josef.Weidendorfer@gmx.de\">"
625  "Josef Weidendorfer</a><br>"
626  "(with lots of bug fixes and porting to Qt4 by the KDE team)");
627  QMessageBox::about(this, tr("About QCachegrind"), text);
628 }
629 
630 void QCGTopLevel::configure(QString s)
631 {
632  static QString lastPage = QString::null;
633 
634  // if no specific config item should be focused, use last page
635  if (s.isEmpty()) s = lastPage;
636  ConfigDialog d(_data, this, s);
637 
638  if (d.exec() == QDialog::Accepted) {
639  GlobalConfig::config()->saveOptions();
640  configChanged();
641  }
642  lastPage = d.currentPage();
643 }
644 
645 void QCGTopLevel::togglePartDock()
646 {
647  if (!_partDock->isVisible())
648  _partDock->show();
649  else
650  _partDock->hide();
651 }
652 
653 void QCGTopLevel::toggleStackDock()
654 {
655  if (!_stackDock->isVisible())
656  _stackDock->show();
657  else
658  _stackDock->hide();
659 }
660 
661 void QCGTopLevel::toggleFunctionDock()
662 {
663  if (!_functionDock->isVisible())
664  _functionDock->show();
665  else
666  _functionDock->hide();
667 }
668 
669 void QCGTopLevel::togglePercentage()
670 {
671  setPercentage(_percentageToggleAction->isChecked());
672 }
673 
674 
675 void QCGTopLevel::setAbsoluteCost()
676 {
677  setPercentage(false);
678 }
679 
680 void QCGTopLevel::setRelativeCost()
681 {
682  setPercentage(true);
683 }
684 
685 void QCGTopLevel::setPercentage(bool show)
686 {
687  if (GlobalConfig::showPercentage() == show) return;
688  if (_percentageToggleAction->isChecked() != show)
689  _percentageToggleAction->setChecked(show);
690  _expandedToggleAction->setEnabled(show);
691  GlobalConfig::setShowPercentage(show);
692 
693  _partSelection->notifyChange(TraceItemView::configChanged);
694  _stackSelection->refresh();
695  _functionSelection->notifyChange(TraceItemView::configChanged);
696  _multiView->notifyChange(TraceItemView::configChanged);
697 }
698 
699 void QCGTopLevel::toggleHideTemplates()
700 {
701  bool show = _hideTemplatesToggleAction->isChecked();
702  if (GlobalConfig::hideTemplates() == show) return;
703  GlobalConfig::setHideTemplates(show);
704 
705  _partSelection->notifyChange(TraceItemView::configChanged);
706  _stackSelection->refresh();
707  _functionSelection->notifyChange(TraceItemView::configChanged);
708  _multiView->notifyChange(TraceItemView::configChanged);
709 }
710 
711 void QCGTopLevel::toggleExpanded()
712 {
713  bool show = _expandedToggleAction->isChecked();
714  if (GlobalConfig::showExpanded() == show) return;
715  GlobalConfig::setShowExpanded(show);
716 
717  _partSelection->notifyChange(TraceItemView::configChanged);
718  _stackSelection->refresh();
719  _functionSelection->notifyChange(TraceItemView::configChanged);
720  _multiView->notifyChange(TraceItemView::configChanged);
721 }
722 
723 void QCGTopLevel::toggleCycles()
724 {
725  bool show = _cyclesToggleAction->isChecked();
726  if (GlobalConfig::showCycles() == show) return;
727  GlobalConfig::setShowCycles(show);
728 
729  if (!_data) return;
730 
731  _data->invalidateDynamicCost();
732  _data->updateFunctionCycles();
733 
734  _partSelection->notifyChange(TraceItemView::configChanged);
735  _stackSelection->rebuildStackList();
736  _functionSelection->notifyChange(TraceItemView::configChanged);
737  _multiView->notifyChange(TraceItemView::configChanged);
738 }
739 
740 
741 void QCGTopLevel::functionVisibilityChanged(bool v)
742 {
743  if (v)
744  _functionSelection->updateView();
745 }
746 
747 
748 void QCGTopLevel::newWindow()
749 {
750  QCGTopLevel* t = new QCGTopLevel();
751  t->show();
752 }
753 
754 
755 void QCGTopLevel::load()
756 {
757  QStringList files;
758  files = QFileDialog::getOpenFileNames(this,
759  tr("Open Callgrind Data"),
760  _lastFile,
761  tr("Callgrind Files (callgrind.*);;All Files (*)"));
762  load(files);
763 }
764 
765 void QCGTopLevel::load(QStringList files, bool addToRecentFiles)
766 {
767  if (files.isEmpty()) return;
768  _lastFile = files[0];
769 
770  if (_data && _data->parts().count()>0) {
771 
772  // In new window
773  QCGTopLevel* t = new QCGTopLevel();
774  t->show();
775  t->loadDelayed(files, addToRecentFiles);
776  return;
777  }
778 
779  // this constructor enables progress bar callbacks
780  TraceData* d = new TraceData(this);
781  int filesLoaded = d->load(files);
782  if (filesLoaded >0)
783  setData(d);
784 
785  if (!addToRecentFiles) return;
786 
787  // add to recent file list in config
788  QStringList recentFiles;
789  ConfigGroup* generalConfig = ConfigStorage::group("GeneralSettings");
790  recentFiles = generalConfig->value("RecentFiles",
791  QStringList()).toStringList();
792  foreach(QString file, files) {
793  recentFiles.removeAll(file);
794  if (filesLoaded >0)
795  recentFiles.prepend(file);
796  if (recentFiles.count() >5)
797  recentFiles.removeLast();
798  }
799  generalConfig->setValue("RecentFiles", recentFiles);
800  delete generalConfig;
801 }
802 
803 
804 void QCGTopLevel::add()
805 {
806  QStringList files;
807  files = QFileDialog::getOpenFileNames(this,
808  tr("Add Callgrind Data"),
809  _lastFile,
810  tr("Callgrind Files (callgrind.*);;All Files (*)"));
811  add(files);
812 }
813 
814 
815 void QCGTopLevel::add(QStringList files)
816 {
817  if (files.isEmpty()) return;
818  _lastFile = files[0];
819 
820  if (_data) {
821  _data->load(files);
822 
823  // GUI update for added data
824  configChanged();
825  return;
826  }
827 
828  // this constructor enables progress bar callbacks
829  TraceData* d = new TraceData(this);
830  int filesLoaded = d->load(files);
831  if (filesLoaded >0)
832  setData(d);
833 }
834 
835 void QCGTopLevel::loadDelayed(QString file, bool addToRecentFiles)
836 {
837  _loadFilesDelayed << file;
838 
839  _addToRecentFiles = addToRecentFiles;
840  QTimer::singleShot(0, this, SLOT(loadFilesDelayed()));
841 }
842 
843 void QCGTopLevel::loadDelayed(QStringList files, bool addToRecentFiles)
844 {
845  _loadFilesDelayed << files;
846 
847  _addToRecentFiles = addToRecentFiles;
848  QTimer::singleShot(0, this, SLOT(loadFilesDelayed()));
849 }
850 
851 void QCGTopLevel::loadFilesDelayed()
852 {
853  if (_loadFilesDelayed.isEmpty()) return;
854 
855  load(_loadFilesDelayed, _addToRecentFiles);
856  _loadFilesDelayed.clear();
857 }
858 
859 
860 void QCGTopLevel::exportGraph()
861 {
862  if (!_data || !_function) return;
863 
864  QString n = QString("callgraph.dot");
865  GraphExporter ge(_data, _function, _eventType, _groupType, n);
866  ge.writeDot();
867 
868 #ifdef Q_OS_UNIX
869  // shell commands only work in UNIX
870  QString cmd = QString("(dot %1 -Tps > %2.ps; xdg-open %3.ps)&")
871  .arg(n).arg(n).arg(n);
872  if (::system(QFile::encodeName( cmd ))<0)
873  qDebug() << "QCGTopLevel::exportGraph: can not run " << cmd;
874 #endif
875 }
876 
877 
878 bool QCGTopLevel::setEventType(QString s)
879 {
880  EventType* ct;
881 
882  ct = (_data) ? _data->eventTypes()->type(s) : 0;
883 
884  // if costtype with given name not found, use first available
885  if (!ct && _data) ct = _data->eventTypes()->type(0);
886 
887  return setEventType(ct);
888 }
889 
890 bool QCGTopLevel::setEventType2(QString s)
891 {
892  EventType* ct;
893 
894  // Special type tr("(Hidden)") gives 0
895  ct = (_data) ? _data->eventTypes()->type(s) : 0;
896 
897  return setEventType2(ct);
898 }
899 
900 void QCGTopLevel::eventTypeSelected(const QString& s)
901 {
902  EventType* ct;
903 
904  ct = (_data) ? _data->eventTypes()->typeForLong(s) : 0;
905  setEventType(ct);
906 }
907 
908 void QCGTopLevel::eventType2Selected(const QString& s)
909 {
910  EventType* ct;
911 
912  ct = (_data) ? _data->eventTypes()->typeForLong(s) : 0;
913  setEventType2(ct);
914 }
915 
916 bool QCGTopLevel::setEventType(EventType* ct)
917 {
918  if (_eventType == ct) return false;
919  _eventType = ct;
920 
921  if (ct) {
922  int idx = _eventTypeBox->findText(ct->longName());
923  if (idx >=0) _eventTypeBox->setCurrentIndex(idx);
924  }
925 
926  _partSelection->setEventType(_eventType);
927  _stackSelection->setEventType(_eventType);
928  _functionSelection->setEventType(_eventType);
929  _multiView->setEventType(_eventType);
930 
931  updateStatusBar();
932 
933  return true;
934 }
935 
936 bool QCGTopLevel::setEventType2(EventType* ct)
937 {
938  if (_eventType2 == ct) return false;
939  _eventType2 = ct;
940 
941  QString longName = ct ? ct->longName() : tr("(Hidden)");
942 
943  _partSelection->setEventType2(_eventType2);
944  _stackSelection->setEventType2(_eventType2);
945  _functionSelection->setEventType2(_eventType2);
946  _multiView->setEventType2(_eventType2);
947 
948  updateStatusBar();
949 
950  return true;
951 }
952 
953 
954 void QCGTopLevel::groupTypeSelected(int cg)
955 {
956  switch(cg) {
957  case 0: setGroupType( ProfileContext::Function ); break;
958  case 1: setGroupType( ProfileContext::Object ); break;
959  case 2: setGroupType( ProfileContext::File ); break;
960  case 3: setGroupType( ProfileContext::Class ); break;
961  case 4: setGroupType( ProfileContext::FunctionCycle ); break;
962  default: break;
963  }
964 }
965 
966 bool QCGTopLevel::setGroupType(QString s)
967 {
968  ProfileContext::Type gt;
969 
970  gt = ProfileContext::type(s);
971  // only allow Function/Object/File/Class as grouptype
972  switch(gt) {
973  case ProfileContext::Object:
974  case ProfileContext::File:
975  case ProfileContext::Class:
976  case ProfileContext::FunctionCycle:
977  break;
978  default:
979  gt = ProfileContext::Function;
980  }
981 
982  return setGroupType(gt);
983 }
984 
985 bool QCGTopLevel::setGroupType(ProfileContext::Type gt)
986 {
987  if (_groupType == gt) return false;
988  _groupType = gt;
989 
990  int idx = -1;
991  switch(gt) {
992  case ProfileContext::Function: idx = 0; break;
993  case ProfileContext::Object: idx = 1; break;
994  case ProfileContext::File: idx = 2; break;
995  case ProfileContext::Class: idx = 3; break;
996  case ProfileContext::FunctionCycle: idx = 4; break;
997  default:
998  break;
999  }
1000 
1001  if (idx==-1) return false;
1002 
1003 #if 0
1004  if (saGroup->currentItem() != idx)
1005  saGroup->setCurrentItem(idx);
1006 #endif
1007 
1008  _stackSelection->setGroupType(_groupType);
1009 
1010  _partSelection->set(_groupType);
1011  _functionSelection->set(_groupType);
1012  _multiView->set(_groupType);
1013 
1014  updateStatusBar();
1015 
1016  return true;
1017 }
1018 
1019 bool QCGTopLevel::setGroup(QString s)
1020 {
1021  TraceCostItem* ci = _functionSelection->group(s);
1022  if (!ci)
1023  return false;
1024 
1025  return setGroup(ci);
1026 }
1027 
1028 
1029 bool QCGTopLevel::setGroup(TraceCostItem* g)
1030 {
1031  if (_group == g) return false;
1032  _group = g;
1033 
1034  _functionSelection->setGroup(g);
1035  updateStatusBar();
1036 
1037  return true;
1038 }
1039 
1040 bool QCGTopLevel::setFunction(QString s)
1041 {
1042  if (!_data) return false;
1043 
1044  ProfileCostArray* f = _data->search(ProfileContext::Function, s, _eventType);
1045  if (!f) return false;
1046 
1047  return setFunction((TraceFunction*)f);
1048 }
1049 
1050 bool QCGTopLevel::setFunction(TraceFunction* f)
1051 {
1052  if (_function == f) return false;
1053  _function = f;
1054 
1055  _multiView->activate(f);
1056  _functionSelection->activate(f);
1057  _partSelection->activate(f);
1058  _stackSelection->setFunction(_function);
1059 
1060  StackBrowser* b = _stackSelection->browser();
1061  if (b) {
1062  // do not disable up: a press forces stack-up extending...
1063  _forwardAction->setEnabled(b->canGoForward());
1064  _backAction->setEnabled(b->canGoBack());
1065  }
1066 
1067 #if TRACE_UPDATES
1068  qDebug("QCGTopLevel::setFunction(%s), lastSender %s",
1069  f ? f->prettyName().toAscii() : "0",
1070  _lastSender ? _lastSender->name() :"0" );
1071 #endif
1072 
1073  return true;
1074 }
1075 
1076 
1084 void QCGTopLevel::setEventTypeDelayed(EventType* ct)
1085 {
1086  _eventTypeDelayed = ct;
1087  QTimer::singleShot (0, this, SLOT(setEventTypeDelayed()));
1088 }
1089 
1090 void QCGTopLevel::setEventType2Delayed(EventType* ct)
1091 {
1092  _eventType2Delayed = ct;
1093  QTimer::singleShot (0, this, SLOT(setEventType2Delayed()));
1094 }
1095 
1096 void QCGTopLevel::setEventTypeDelayed()
1097 {
1098  setEventType(_eventTypeDelayed);
1099 }
1100 
1101 void QCGTopLevel::setEventType2Delayed()
1102 {
1103  setEventType2(_eventType2Delayed);
1104 }
1105 
1106 void QCGTopLevel::setGroupTypeDelayed(ProfileContext::Type gt)
1107 {
1108  _groupTypeDelayed = gt;
1109  QTimer::singleShot (0, this, SLOT(setGroupTypeDelayed()));
1110 }
1111 
1112 void QCGTopLevel::setGroupTypeDelayed()
1113 {
1114  setGroupType(_groupTypeDelayed);
1115 }
1116 
1117 void QCGTopLevel::setGroupDelayed(TraceCostItem* g)
1118 {
1119 #if TRACE_UPDATES
1120  qDebug("QCGTopLevel::setGroupDelayed(%s), sender %s",
1121  g ? g->prettyName().toAscii() : "0",
1122  _lastSender ? _lastSender->name() :"0" );
1123 #endif
1124 
1125  _groupDelayed = g;
1126  QTimer::singleShot (0, this, SLOT(setGroupDelayed()));
1127 }
1128 
1129 void QCGTopLevel::setGroupDelayed()
1130 {
1131  setGroup(_groupDelayed);
1132 }
1133 
1134 void QCGTopLevel::setDirectionDelayed(TraceItemView::Direction d)
1135 {
1136  _directionDelayed = d;
1137  QTimer::singleShot (0, this, SLOT(setDirectionDelayed()));
1138 }
1139 
1140 void QCGTopLevel::setDirectionDelayed()
1141 {
1142  switch(_directionDelayed) {
1143  case TraceItemView::Back:
1144  _stackSelection->browserBack();
1145  break;
1146 
1147  case TraceItemView::Forward:
1148  _stackSelection->browserForward();
1149  break;
1150 
1151  case TraceItemView::Up:
1152  {
1153  StackBrowser* b = _stackSelection ? _stackSelection->browser() : 0;
1154  HistoryItem* hi = b ? b->current() : 0;
1155  TraceFunction* f = hi ? hi->function() : 0;
1156 
1157  if (!f) break;
1158  f = hi->stack()->caller(f, false);
1159  if (f) setFunction(f);
1160  }
1161  break;
1162 
1163  default: break;
1164  }
1165 
1166  _directionDelayed = TraceItemView::None;
1167 }
1168 
1169 
1170 void QCGTopLevel::setTraceItemDelayed(CostItem* i)
1171 {
1172  // no need to select same item a 2nd time...
1173  if (_traceItemDelayed == i) return;
1174  _traceItemDelayed = i;
1175  _lastSender = sender();
1176 
1177  qDebug() << "Selected " << (i ? i->fullName() : "(none)");
1178 
1179 #if TRACE_UPDATES
1180  qDebug("QCGTopLevel::setTraceItemDelayed(%s), sender %s",
1181  i ? i->prettyName().toAscii() : "0",
1182  _lastSender ? _lastSender->name() :"0" );
1183 #endif
1184 
1185  QTimer::singleShot (0, this, SLOT(setTraceItemDelayed()));
1186 }
1187 
1188 void QCGTopLevel::setTraceItemDelayed()
1189 {
1190  if (!_traceItemDelayed) return;
1191 
1192  switch(_traceItemDelayed->type()) {
1193  case ProfileContext::Function:
1194  case ProfileContext::FunctionCycle:
1195  setFunction((TraceFunction*)_traceItemDelayed);
1196  break;
1197 
1198  case ProfileContext::Object:
1199  case ProfileContext::File:
1200  case ProfileContext::Class:
1201  _multiView->activate(_traceItemDelayed);
1202  break;
1203 
1204  case ProfileContext::Instr:
1205  case ProfileContext::Line:
1206  // only for multiview
1207  _multiView->activate(_traceItemDelayed);
1208  break;
1209 
1210  default: break;
1211  }
1212 
1213  _traceItemDelayed = 0;
1214  _lastSender = 0;
1215 }
1216 
1223 void QCGTopLevel::setData(TraceData* data)
1224 {
1225  if (data == _data) return;
1226 
1227  _lastSender = 0;
1228 
1229  saveTraceSettings();
1230 
1231  if (_data) {
1232  _partSelection->setData(0);
1233  _stackSelection->setData(0);
1234  _functionSelection->setData(0);
1235  _multiView->setData(0);
1236  _multiView->updateView(true);
1237 
1238  // we are the owner...
1239  delete _data;
1240  }
1241 
1242  // reset members
1243  resetState();
1244 
1245  _data = data;
1246 
1247  // fill cost type list
1248  QStringList types;
1249 
1250  if (_data) {
1251  /* add all supported virtual types */
1252  EventTypeSet* m = _data->eventTypes();
1253  m->addKnownDerivedTypes();
1254 
1255  /* first, fill selection list with available cost types */
1256  for (int i=0;i<m->realCount();i++)
1257  types << m->realType(i)->longName();
1258  for (int i=0;i<m->derivedCount();i++)
1259  types << m->derivedType(i)->longName();
1260  }
1261  _eventTypes = types;
1262  _eventTypeBox->addItems(types);
1263 
1264  _stackSelection->setData(_data);
1265  _partSelection->setData(_data);
1266  _functionSelection->setData(_data);
1267  _multiView->setData(_data);
1268  // Force update of _data in all children of _multiView
1269  // This is needed to make restoring of activeItem work!
1270  _multiView->updateView(true);
1271 
1272  /* this is needed to let the other widgets know the types */
1273  restoreTraceTypes();
1274 
1275  restoreTraceSettings();
1276 
1277  QString caption;
1278  if (_data) {
1279  caption = QDir::toNativeSeparators(_data->traceName());
1280  if (!_data->command().isEmpty())
1281  caption += " [" + _data->command() + ']';
1282  }
1283  setWindowTitle(caption);
1284 
1285  if (!_data || (!_forcePartDock && _data->parts().count()<2))
1286  _partDock->hide();
1287  else
1288  _partDock->show();
1289 
1290  updateStatusBar();
1291 }
1292 
1293 void QCGTopLevel::addEventTypeMenu(QMenu* popup, bool withCost2)
1294 {
1295  if (_data) {
1296  QMenu *popup1, *popup2 = 0;
1297  QAction* action;
1298 
1299  popup1 = popup->addMenu(tr("Primary Event Type"));
1300  connect(popup1, SIGNAL(triggered(QAction*)),
1301  this, SLOT(setEventType(QAction*)));
1302 
1303  if (withCost2) {
1304  popup2 = popup->addMenu(tr("Secondary Event Type"));
1305  connect(popup2, SIGNAL(triggered(QAction*)),
1306  this, SLOT(setEventType2(QAction*)));
1307 
1308  if (_eventType2) {
1309  action = popup2->addAction(tr("Hide"));
1310  action->setData(199);
1311  popup2->addSeparator();
1312  }
1313  }
1314 
1315  EventTypeSet* m = _data->eventTypes();
1316  EventType* ct;
1317  for (int i=0;i<m->realCount();i++) {
1318  ct = m->realType(i);
1319 
1320  action = popup1->addAction(ct->longName());
1321  action->setCheckable(true);
1322  action->setData(100+i);
1323  if (_eventType == ct) action->setChecked(true);
1324 
1325  if (popup2) {
1326  action = popup2->addAction(ct->longName());
1327  action->setCheckable(true);
1328  action->setData(100+i);
1329  if (_eventType2 == ct) action->setChecked(true);
1330  }
1331  }
1332 
1333  for (int i=0;i<m->derivedCount();i++) {
1334  ct = m->derivedType(i);
1335 
1336  action = popup1->addAction(ct->longName());
1337  action->setCheckable(true);
1338  action->setData(200+i);
1339  if (_eventType == ct) action->setChecked(true);
1340 
1341  if (popup2) {
1342  action = popup2->addAction(ct->longName());
1343  action->setCheckable(true);
1344  action->setData(200+i);
1345  if (_eventType2 == ct) action->setChecked(true);
1346  }
1347  }
1348  }
1349 
1350  if (GlobalConfig::showPercentage())
1351  popup->addAction(tr("Show Absolute Cost"),
1352  this, SLOT(setAbsoluteCost()));
1353  else
1354  popup->addAction(tr("Show Relative Cost"),
1355  this, SLOT(setRelativeCost()));
1356 }
1357 
1358 bool QCGTopLevel::setEventType(QAction* action)
1359 {
1360  if (!_data) return false;
1361  int id = action->data().toInt(0);
1362 
1363  EventTypeSet* m = _data->eventTypes();
1364  EventType* ct=0;
1365  if (id >=100 && id<199) ct = m->realType(id-100);
1366  if (id >=200 && id<299) ct = m->derivedType(id-200);
1367 
1368  return ct ? setEventType(ct) : false;
1369 }
1370 
1371 bool QCGTopLevel::setEventType2(QAction* action)
1372 {
1373  if (!_data) return false;
1374  int id = action->data().toInt(0);
1375 
1376  EventTypeSet* m = _data->eventTypes();
1377  EventType* ct=0;
1378  if (id >=100 && id<199) ct = m->realType(id-100);
1379  if (id >=200 && id<299) ct = m->derivedType(id-200);
1380 
1381  return setEventType2(ct);
1382 }
1383 
1384 void QCGTopLevel::addGoMenu(QMenu* popup)
1385 {
1386  StackBrowser* b = _stackSelection->browser();
1387  if (b) {
1388  if (b->canGoBack())
1389  popup->addAction(tr("Go Back"), this, SLOT(goBack()));
1390  if (b->canGoForward())
1391  popup->addAction(tr("Go Forward"), this, SLOT(goForward()));
1392  }
1393  // do not disable up: a press forces stack-up extending...
1394  popup->addAction(tr("Go Up"), this, SLOT(goUp()));
1395 }
1396 
1397 void QCGTopLevel::goBack()
1398 {
1399  setDirectionDelayed(TraceItemView::Back);
1400 }
1401 
1402 void QCGTopLevel::goForward()
1403 {
1404  setDirectionDelayed(TraceItemView::Forward);
1405 }
1406 
1407 void QCGTopLevel::goUp()
1408 {
1409  setDirectionDelayed(TraceItemView::Up);
1410 }
1411 
1412 QString QCGTopLevel::traceKey()
1413 {
1414  if (!_data || _data->command().isEmpty()) return QString();
1415 
1416  QString name = _data->command();
1417  QString key;
1418  for (int l=0;l<name.length();l++)
1419  if (name[l].isLetterOrNumber()) key += name[l];
1420 
1421  return QString("-") + key;
1422 }
1423 
1424 
1425 void QCGTopLevel::restoreTraceTypes()
1426 {
1427  QString key = traceKey();
1428  QString groupType, eventType, eventType2;
1429 
1430  ConfigGroup* pConfig = ConfigStorage::group("TracePositions");
1431  groupType = pConfig->value(QString("GroupType%1").arg(key),QString()).toString();
1432  eventType = pConfig->value(QString("EventType%1").arg(key),QString()).toString();
1433  eventType2 = pConfig->value(QString("EventType2%1").arg(key),QString()).toString();
1434  delete pConfig;
1435 
1436  ConfigGroup* cConfig = ConfigStorage::group("CurrentState");
1437  if (groupType.isEmpty())
1438  groupType = cConfig->value("GroupType",QString()).toString();
1439  if (eventType.isEmpty())
1440  eventType = cConfig->value("EventType",QString()).toString();
1441  if (eventType2.isEmpty())
1442  eventType2 = cConfig->value("EventType2",QString()).toString();
1443  delete cConfig;
1444 
1445  setGroupType(groupType);
1446  setEventType(eventType);
1447  setEventType2(eventType2);
1448 
1449  // if still no event type set, use first available
1450  if (!_eventType && !_eventTypes.isEmpty())
1451  eventTypeSelected(_eventTypes.first());
1452 
1453  ConfigGroup* aConfig = ConfigStorage::group("Layouts");
1454  _layoutCount = aConfig->value(QString("Count%1").arg(key), 0).toInt();
1455  _layoutCurrent = aConfig->value(QString("Current%1").arg(key), 0).toInt();
1456  delete aConfig;
1457 
1458  if (_layoutCount == 0) layoutRestore();
1459  updateLayoutActions();
1460 }
1461 
1462 
1468 void QCGTopLevel::restoreTraceSettings()
1469 {
1470  if (!_data) return;
1471 
1472  QString key = traceKey();
1473 
1474  restoreCurrentState(key);
1475 
1476  ConfigGroup* pConfig = ConfigStorage::group("TracePositions");
1477  QString group = pConfig->value(QString("Group%1").arg(key),QString()).toString();
1478  delete pConfig;
1479  if (!group.isEmpty()) setGroup(group);
1480 
1481  // restoreCurrentState() usually leads to a call to setTraceItemDelayed()
1482  // to restore last active item...
1483  if (!_traceItemDelayed) {
1484  // function not available any more.. try with "main"
1485  if (!setFunction("main")) {
1486 #if 1
1487  _functionSelection->selectTopFunction();
1488 #else
1489  HighestCostList hc;
1490  hc.clear(50);
1491  TraceFunctionMap::Iterator it;
1492  for ( it = _data->functionMap().begin();
1493  it != _data->functionMap().end(); ++it )
1494  hc.addCost(&(*it), (*it).inclusive()->subCost(_eventType));
1495 
1496  setFunction( (TraceFunction*) hc[0]);
1497 #endif
1498  }
1499  }
1500 }
1501 
1502 
1503 /* Layout */
1504 
1505 void QCGTopLevel::layoutDuplicate()
1506 {
1507  // save current and allocate a new slot
1508  _multiView->saveLayout(QString("Layout%1-MainView").arg(_layoutCurrent),
1509  traceKey());
1510  _layoutCurrent = _layoutCount;
1511  _layoutCount++;
1512 
1513  updateLayoutActions();
1514 
1515  qDebug() << "QCGTopLevel::layoutDuplicate: count " << _layoutCount;
1516 }
1517 
1518 void QCGTopLevel::layoutRemove()
1519 {
1520  if (_layoutCount <2) return;
1521 
1522  int from = _layoutCount-1;
1523  if (_layoutCurrent == from) { _layoutCurrent--; from--; }
1524 
1525  // restore from last and decrement count
1526  _multiView->restoreLayout(QString("Layout%1-MainView").arg(from),
1527  traceKey());
1528  _layoutCount--;
1529 
1530  updateLayoutActions();
1531 
1532  qDebug() << "QCGTopLevel::layoutRemove: count " << _layoutCount;
1533 }
1534 
1535 void QCGTopLevel::layoutNext()
1536 {
1537  if (_layoutCount <2) return;
1538 
1539  QString key = traceKey();
1540  QString layoutPrefix = QString("Layout%1-MainView");
1541 
1542  _multiView->saveLayout(layoutPrefix.arg(_layoutCurrent), key);
1543  _layoutCurrent++;
1544  if (_layoutCurrent == _layoutCount) _layoutCurrent = 0;
1545  _multiView->restoreLayout(layoutPrefix.arg(_layoutCurrent), key);
1546 
1547  qDebug() << "QCGTopLevel::layoutNext: current " << _layoutCurrent;
1548 }
1549 
1550 void QCGTopLevel::layoutPrevious()
1551 {
1552  if (_layoutCount <2) return;
1553 
1554  QString key = traceKey();
1555  QString layoutPrefix = QString("Layout%1-MainView");
1556 
1557  _multiView->saveLayout(layoutPrefix.arg(_layoutCurrent), key);
1558  _layoutCurrent--;
1559  if (_layoutCurrent <0) _layoutCurrent = _layoutCount-1;
1560  _multiView->restoreLayout(layoutPrefix.arg(_layoutCurrent), key);
1561 
1562  qDebug() << "QCGTopLevel::layoutPrevious: current " << _layoutCurrent;
1563 }
1564 
1565 void QCGTopLevel::layoutSave()
1566 {
1567  QString key = traceKey();
1568  QString layoutPrefix = QString("Layout%1-MainView");
1569 
1570  _multiView->saveLayout(layoutPrefix.arg(_layoutCurrent), key);
1571 
1572  // save all layouts as defaults (ie. without any group name postfix)
1573  for(int i=0;i<_layoutCount;i++) {
1574  _multiView->restoreLayout(layoutPrefix.arg(i), key);
1575  _multiView->saveLayout(layoutPrefix.arg(i), QString());
1576  }
1577  // restore the previously saved current layout
1578  _multiView->restoreLayout(layoutPrefix.arg(_layoutCurrent), key);
1579 
1580  ConfigGroup* layoutConfig = ConfigStorage::group("Layouts");
1581  layoutConfig->setValue("DefaultCount", _layoutCount);
1582  layoutConfig->setValue("DefaultCurrent", _layoutCurrent);
1583  delete layoutConfig;
1584 }
1585 
1586 void QCGTopLevel::layoutRestore()
1587 {
1588  ConfigGroup* layoutConfig = ConfigStorage::group("Layouts");
1589  _layoutCount = layoutConfig->value("DefaultCount", 0).toInt();
1590  _layoutCurrent = layoutConfig->value("DefaultCurrent", 0).toInt();
1591  delete layoutConfig;
1592 
1593  if (_layoutCount == 0) {
1594  _layoutCount++;
1595  return;
1596  }
1597 
1598  QString layoutPrefix = QString("Layout%1-MainView");
1599  _multiView->restoreLayout( layoutPrefix.arg(_layoutCurrent), traceKey());
1600 
1601  updateLayoutActions();
1602 }
1603 
1604 
1605 void QCGTopLevel::updateLayoutActions()
1606 {
1607  if (_layoutNext)
1608  _layoutNext->setEnabled(_layoutCount>1);
1609 
1610  if (_layoutPrev)
1611  _layoutPrev->setEnabled(_layoutCount>1);
1612 
1613  if (_layoutRemove)
1614  _layoutRemove->setEnabled(_layoutCount>1);
1615 
1616  if (_statusbar)
1617  _statusbar->showMessage(tr("Layout Count: %1").arg(_layoutCount),
1618  1000);
1619 }
1620 
1621 
1622 void QCGTopLevel::updateStatusBar()
1623 {
1624  if (!_data || _data->parts().count()==0) {
1625  _statusLabel->setText(tr("No profile data file loaded."));
1626  return;
1627  }
1628 
1629  QString status = QString("%1 [%2] - ")
1630  .arg(_data->shortTraceName())
1631  .arg(_data->activePartRange());
1632 
1633  if (_eventType) {
1634  status += tr("Total %1 Cost: %2")
1635  .arg(_eventType->longName())
1636  .arg(_data->prettySubCost(_eventType));
1637 
1638  /* this gets too long...
1639  if (_eventType2 && (_eventType2 != _eventType))
1640  status += tr(", %1 Cost: %2")
1641  .arg(_eventType2->longName())
1642  .arg(_data->prettySubCost(_eventType2));
1643  */
1644  }
1645  else
1646  status += tr("No event type selected");
1647 
1648  /* Not working... should give group of selected function
1649 
1650  if (_groupType != ProfileContext::Function) {
1651  status += QString(" - %1 '%2'")
1652  .arg(ProfileContext::trTypeName(_groupType))
1653  .arg(_group ? _group->prettyName() : tr("(None)"));
1654  }
1655  */
1656 
1657  _statusLabel->setText(status);
1658 }
1659 
1660 
1661 void QCGTopLevel::closeEvent(QCloseEvent* event)
1662 {
1663  GlobalConfig::config()->saveOptions();
1664 
1665  saveTraceSettings();
1666  saveCurrentState(QString::null);
1667 
1668  // if part dock was chosen visible even for only 1 part loaded,
1669  // keep this choice...
1670  _forcePartDock = false;
1671  if (_data && (_data->parts().count()<2) && _partDock->isVisible())
1672  _forcePartDock=true;
1673 
1674  ConfigGroup* topConfig = ConfigStorage::group("TopWindow");
1675  topConfig->setValue("ForcePartDockVisible", _forcePartDock, false);
1676  topConfig->setValue("State", saveState());
1677  topConfig->setValue("Geometry", saveGeometry());
1678  delete topConfig;
1679 
1680  event->accept();
1681 }
1682 
1683 
1684 void QCGTopLevel::toggleSplitted()
1685 {
1686  int count = _multiView->childCount();
1687  if (count<1) count = 1;
1688  if (count>2) count = 2;
1689  count = 3-count;
1690  _multiView->setChildCount(count);
1691 
1692  _splittedToggleAction->setChecked(count>1);
1693  _splitDirectionToggleAction->setEnabled(count>1);
1694  _splitDirectionToggleAction->setChecked(_multiView->orientation() ==
1695  Qt::Horizontal);
1696 }
1697 
1698 void QCGTopLevel::toggleSplitDirection()
1699 {
1700  _multiView->setOrientation( _splitDirectionToggleAction->isChecked() ?
1701  Qt::Horizontal : Qt::Vertical );
1702 }
1703 
1704 
1705 
1706 // this is called after a config change in the dialog
1707 void QCGTopLevel::configChanged()
1708 {
1709  // invalidate found/cached dirs of source files
1710  if (_data)
1711  _data->resetSourceDirs();
1712 
1713  _partSelection->notifyChange(TraceItemView::configChanged);
1714  _stackSelection->refresh();
1715  _functionSelection->notifyChange(TraceItemView::configChanged);
1716  _multiView->notifyChange(TraceItemView::configChanged);
1717 }
1718 
1719 
1720 
1721 void QCGTopLevel::activePartsChangedSlot(const TracePartList& list)
1722 {
1723  if (!_data) return;
1724 
1725  if (!_data->activateParts(list)) {
1726 // qDebug("QCGTopLevel::activePartsChangedSlot: No Change!");
1727  return;
1728  }
1729  _activeParts = list;
1730 
1731  _partSelection->set(list);
1732  _stackSelection->refresh();
1733  _functionSelection->set(list);
1734  _multiView->set(list);
1735 
1736  updateStatusBar();
1737 }
1738 
1739 void QCGTopLevel::partsHideSelectedSlotDelayed()
1740 {
1741  QTimer::singleShot( 0, this, SLOT(partsHideSelectedSlot()) );
1742 }
1743 
1744 // this puts selected parts into hidden list,
1745 // deselects them and makes the remaining parts selected
1746 void QCGTopLevel::partsHideSelectedSlot()
1747 {
1748  if (!_data) return;
1749 
1750  TracePartList newHidden, newActive;
1751  foreach(TracePart* part, _data->parts()) {
1752  if (_activeParts.contains(part) ||
1753  _hiddenParts.contains(part))
1754  newHidden.append(part);
1755  else
1756  newActive.append(part);
1757  }
1758 
1759  _hiddenParts = newHidden;
1760  _partSelection->hiddenPartsChangedSlot(_hiddenParts);
1761 
1762 #if 0
1763  _mainWidget1->hiddenPartsChangedSlot(_hiddenParts);
1764  _mainWidget2->hiddenPartsChangedSlot(_hiddenParts);
1765 #endif
1766 
1767  activePartsChangedSlot(newActive);
1768 }
1769 
1770 void QCGTopLevel::partsUnhideAllSlotDelayed()
1771 {
1772  QTimer::singleShot( 0, this, SLOT(partsUnhideAllSlot()) );
1773 }
1774 
1775 // this unhides all hidden parts. Does NOT change selection
1776 void QCGTopLevel::partsUnhideAllSlot()
1777 {
1778  if (!_data) return;
1779 
1780  _hiddenParts.clear();
1781  _partSelection->hiddenPartsChangedSlot(_hiddenParts);
1782 
1783 #if 0
1784  _mainWidget1->hiddenPartsChangedSlot(_hiddenParts);
1785  _mainWidget2->hiddenPartsChangedSlot(_hiddenParts);
1786 #endif
1787 }
1788 
1789 void QCGTopLevel::forwardAboutToShow()
1790 {
1791  QMenu *popup = _forwardAction->menu();
1792 
1793  popup->clear();
1794  StackBrowser* b = _stackSelection ? _stackSelection->browser() : 0;
1795  HistoryItem* hi = b ? b->current() : 0;
1796  TraceFunction* f;
1797  QAction* action;
1798 
1799  if (!hi) {
1800  popup->addAction(tr("(No Stack)"));
1801  return;
1802  }
1803 
1804  hi = hi->next();
1805  if (!hi) {
1806  popup->addAction(tr("(No next function)"));
1807  return;
1808  }
1809 
1810  int count = 1;
1811  while (count<GlobalConfig::maxSymbolCount() && hi) {
1812  f = hi->function();
1813  if (!f) break;
1814 
1815  QString name = GlobalConfig::shortenSymbol(f->prettyName());
1816 
1817  //qDebug("forward: Adding %s", name.toAscii());
1818  action = popup->addAction(name);
1819  action->setData(count);
1820 
1821  hi = hi->next();
1822  count++;
1823  }
1824 }
1825 
1826 void QCGTopLevel::backAboutToShow()
1827 {
1828  QMenu *popup = _backAction->menu();
1829 
1830  popup->clear();
1831  StackBrowser* b = _stackSelection ? _stackSelection->browser() : 0;
1832  HistoryItem* hi = b ? b->current() : 0;
1833  TraceFunction* f;
1834  QAction* action;
1835 
1836  if (!hi) {
1837  popup->addAction(tr("(No Stack)"));
1838  return;
1839  }
1840 
1841  hi = hi->last();
1842  if (!hi) {
1843  popup->addAction(tr("(No previous function)"));
1844  return;
1845  }
1846 
1847  int count = 1;
1848  while (count<GlobalConfig::maxSymbolCount() && hi) {
1849  f = hi->function();
1850  if (!f) break;
1851 
1852  QString name = GlobalConfig::shortenSymbol(f->prettyName());
1853 
1854  //qDebug("back: Adding %s", name.toAscii());
1855  action = popup->addAction(name);
1856  action->setData(count);
1857 
1858  hi = hi->last();
1859  count++;
1860  }
1861 }
1862 
1863 void QCGTopLevel::upAboutToShow()
1864 {
1865  QMenu *popup = _upAction->menu();
1866 
1867  popup->clear();
1868  StackBrowser* b = _stackSelection ? _stackSelection->browser() : 0;
1869  HistoryItem* hi = b ? b->current() : 0;
1870  TraceFunction* f = hi ? hi->function() : 0;
1871  QAction* action;
1872 
1873  if (!f) {
1874  popup->addAction(tr("(No Stack)"));
1875  return;
1876  }
1877  f = hi->stack()->caller(f, false);
1878  if (!f) {
1879  popup->addAction(tr("(No Function Up)"));
1880  return;
1881  }
1882 
1883  int count = 1;
1884  while (count<GlobalConfig::maxSymbolCount() && f) {
1885  QString name = GlobalConfig::shortenSymbol(f->prettyName());
1886 
1887  action = popup->addAction(name);
1888  action->setData(count);
1889 
1890  f = hi->stack()->caller(f, false);
1891  count++;
1892  }
1893 }
1894 
1895 void QCGTopLevel::forwardTriggered(QAction* action)
1896 {
1897  int count = action->data().toInt(0);
1898  //qDebug("forwardTriggered: %d", count);
1899  if( count <= 0)
1900  return;
1901 
1902  StackBrowser* b = _stackSelection ? _stackSelection->browser() : 0;
1903  if (!b) return;
1904 
1905  while (count>1) {
1906  b->goForward();
1907  count--;
1908  }
1909  _stackSelection->browserForward();
1910 }
1911 
1912 void QCGTopLevel::backTriggered(QAction* action)
1913 {
1914  int count = action->data().toInt(0);
1915  //qDebug("backTriggered: %d", count);
1916  if( count <= 0)
1917  return;
1918 
1919  StackBrowser* b = _stackSelection ? _stackSelection->browser() : 0;
1920  if (!b) return;
1921 
1922  while (count>1) {
1923  b->goBack();
1924  count--;
1925  }
1926  _stackSelection->browserBack();
1927 }
1928 
1929 void QCGTopLevel::upTriggered(QAction* action)
1930 {
1931  int count = action->data().toInt(0);
1932  //qDebug("upTriggered: %d", count);
1933  if( count <= 0)
1934  return;
1935 
1936  StackBrowser* b = _stackSelection ? _stackSelection->browser() : 0;
1937  HistoryItem* hi = b ? b->current() : 0;
1938  if (!hi) return;
1939 
1940  TraceFunction* f = hi->function();
1941 
1942  while (count>0 && f) {
1943  f = hi->stack()->caller(f, false);
1944  count--;
1945  }
1946 
1947  //qDebug("upActivated: %s", f ? f->prettyName().toAscii() : "??" );
1948  if (f)
1949  setFunction(f);
1950 }
1951 
1952 void QCGTopLevel::showMessage(const QString& msg, int ms)
1953 {
1954  if (_statusbar)
1955  _statusbar->showMessage(msg, ms);
1956 }
1957 
1958 void QCGTopLevel::showStatus(const QString& msg, int progress)
1959 {
1960  static bool msgUpdateNeeded = true;
1961 
1962  if (!_statusbar) return;
1963 
1964  if (msg.isEmpty()) {
1965  //reset status
1966  if (_progressBar) {
1967  _statusbar->removeWidget(_progressBar);
1968  delete _progressBar;
1969  _progressBar = 0;
1970  }
1971  _statusbar->clearMessage();
1972  _progressMsg = msg;
1973  return;
1974  }
1975 
1976  if (_progressMsg.isEmpty())
1977  _progressStart.start();
1978 
1979  if (msg != _progressMsg) {
1980  _progressMsg = msg;
1981  msgUpdateNeeded = true;
1982  }
1983 
1984  // do nothing if last change was less than 0.5 seconds ago
1985  if (_progressStart.elapsed() < 500)
1986  return;
1987 
1988  if (!_progressBar) {
1989  _progressBar = new QProgressBar(_statusbar);
1990  _progressBar->setMaximumSize(200, _statusbar->height()-4);
1991  _statusbar->addPermanentWidget(_progressBar, 1);
1992  _progressBar->show();
1993  msgUpdateNeeded = true;
1994  }
1995 
1996  _progressStart.restart();
1997 
1998  if (msgUpdateNeeded) {
1999  _statusbar->showMessage(msg);
2000  msgUpdateNeeded = false;
2001  }
2002  _progressBar->setValue(progress);
2003 
2004  // let the progress bar update itself
2005  qApp->processEvents(QEventLoop::ExcludeUserInputEvents);
2006 }
2007 
2008 void QCGTopLevel::loadStart(const QString& filename)
2009 {
2010  showStatus(QString("Loading %1").arg(filename), 0);
2011  Logger::_filename = filename;
2012 }
2013 
2014 void QCGTopLevel::loadFinished(const QString& msg)
2015 {
2016  showStatus(QString::null, 0);
2017  if (!msg.isEmpty())
2018  showMessage(QString("Error loading %1: %2").arg(_filename).arg(msg),
2019  2000);
2020 }
2021 
2022 void QCGTopLevel::loadProgress(int progress)
2023 {
2024  showStatus(QString("Loading %1").arg(_filename), progress);
2025 }
2026 
2027 void QCGTopLevel::loadError(int line, const QString& msg)
2028 {
2029  qCritical() << "Loading" << _filename
2030  << ":" << line << ": " << msg;
2031 }
2032 
2033 void QCGTopLevel::loadWarning(int line, const QString& msg)
2034 {
2035  qWarning() << "Loading" << _filename
2036  << ":" << line << ": " << msg;
2037 }
2038 
2039 #include "qcgtoplevel.moc"
QAction::text
text
StackSelection::browser
StackBrowser * browser() const
Definition: stackselection.h:48
StackSelection::setEventType2
void setEventType2(EventType *)
Definition: stackselection.cpp:246
QCGTopLevel::updateStatusBar
void updateStatusBar()
Definition: qcgtoplevel.cpp:1622
QProgressBar
QList::clear
void clear()
QMainWindow::addToolBar
void addToolBar(Qt::ToolBarArea area, QToolBar *toolbar)
QCGTopLevel::QCGTopLevel
QCGTopLevel()
Definition: qcgtoplevel.cpp:61
ProfileContext::type
ProfileContext::Type type()
Definition: context.h:55
QMenuBar
QVariant::toByteArray
QByteArray toByteArray() const
EventTypeSet::realCount
int realCount()
Definition: eventtype.h:133
GlobalConfig::setShowPercentage
static void setShowPercentage(bool)
Definition: globalconfig.cpp:348
QWidget::close
bool close()
QCGTopLevel::eventType2
EventType * eventType2()
Definition: qcgtoplevel.h:72
HistoryItem::function
TraceFunction * function()
Definition: stackbrowser.h:71
QDir::toNativeSeparators
QString toNativeSeparators(const QString &pathName)
GlobalConfig::showPercentage
static bool showPercentage()
Definition: globalconfig.cpp:328
PartSelection
Definition: partselection.h:38
QCGTopLevel::eventType
EventType * eventType()
Definition: qcgtoplevel.h:71
ProfileContext::Line
Definition: context.h:39
QCGTopLevel::layoutDuplicate
void layoutDuplicate()
Definition: qcgtoplevel.cpp:1505
QCGTopLevel::about
void about()
Definition: qcgtoplevel.cpp:611
QCGTopLevel::~QCGTopLevel
~QCGTopLevel()
Definition: qcgtoplevel.cpp:110
ProfileContext::FunctionCycle
Definition: context.h:46
QCGTopLevel::toggleHideTemplates
void toggleHideTemplates()
Definition: qcgtoplevel.cpp:699
MultiView::saveLayout
void saveLayout(const QString &prefix, const QString &postfix)
Definition: multiview.cpp:202
QCGTopLevel::loadProgress
virtual void loadProgress(int progress)
Definition: qcgtoplevel.cpp:2022
QCGTopLevel::createToolbar
void createToolbar()
Definition: qcgtoplevel.cpp:587
QStatusBar::clearMessage
void clearMessage()
StackSelection::rebuildStackList
void rebuildStackList()
Definition: stackselection.cpp:109
QCGTopLevel::recentFilesMenuAboutToShow
void recentFilesMenuAboutToShow()
Definition: qcgtoplevel.cpp:232
TraceItemView::set
void set(ProfileContext::Type g)
Definition: traceitemview.h:115
QDir::fromNativeSeparators
QString fromNativeSeparators(const QString &pathName)
QCGTopLevel::layoutRemove
void layoutRemove()
Definition: qcgtoplevel.cpp:1518
StackBrowser::goBack
HistoryItem * goBack()
Definition: stackbrowser.cpp:339
QByteArray
QCGTopLevel::setEventType2
bool setEventType2(EventType *)
Definition: qcgtoplevel.cpp:936
TraceItemView::setEventType2
void setEventType2(EventType *t)
Definition: traceitemview.h:114
QMainWindow::menuBar
QMenuBar * menuBar() const
QDockWidget
ProfileContext::File
Definition: context.h:48
ProfileContext::typeName
static QString typeName(Type)
Definition: context.cpp:62
QCGTopLevel::togglePartDock
void togglePartDock()
Definition: qcgtoplevel.cpp:645
QStatusBar::showMessage
void showMessage(const QString &message, int timeout)
QMessageBox::about
void about(QWidget *parent, const QString &title, const QString &text)
TraceData::search
ProfileCostArray * search(ProfileContext::Type, QString, EventType *ct=0, ProfileCostArray *parent=0)
Search for item with given name and highest subcost of given cost type.
Definition: tracedata.cpp:3522
QObject::sender
QObject * sender() const
ConfigDialog::currentPage
QString currentPage()
Definition: configdialog.cpp:142
QAction::setChecked
void setChecked(bool)
stackbrowser.h
QWhatsThis::createAction
QAction * createAction(QObject *parent)
CostItem::type
ProfileContext::Type type() const
Definition: costitem.h:45
QComboBox::setMinimumContentsLength
void setMinimumContentsLength(int characters)
QAction::data
QVariant data() const
StackSelection::setFunction
void setFunction(TraceFunction *)
Definition: stackselection.cpp:92
TraceData::command
QString command() const
Definition: tracedata.h:1448
QMainWindow::statusBar
QStatusBar * statusBar() const
QCGTopLevel::setGroupType
bool setGroupType(ProfileContext::Type)
Definition: qcgtoplevel.cpp:985
TraceItemView::configChanged
Definition: traceitemview.h:88
QCGTopLevel::createDocks
void createDocks()
Definition: qcgtoplevel.cpp:260
StackBrowser
Definition: stackbrowser.h:85
QCGTopLevel::groupTypeSelected
void groupTypeSelected(int)
Definition: qcgtoplevel.cpp:954
QCGTopLevel::closeEvent
void closeEvent(QCloseEvent *)
Definition: qcgtoplevel.cpp:1661
ProfileCostArray::prettySubCost
QString prettySubCost(EventType *)
Returns a cost attribute converted to a string (with space after every 3 digits)
Definition: costitem.cpp:601
TraceItemView::setEventType
void setEventType(EventType *t)
Definition: traceitemview.h:113
TraceFunction
A traced function.
Definition: tracedata.h:1122
TraceCostItem
Definition: tracedata.h:980
QMenu::addAction
void addAction(QAction *action)
QDBusConnection::registerObject
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
QByteArray::isEmpty
bool isEmpty() const
QCGTopLevel::configure
void configure(QString page=QString::null)
Definition: qcgtoplevel.cpp:630
QCGTopLevel::toggleStackDock
void toggleStackDock()
Definition: qcgtoplevel.cpp:653
HighestCostList::clear
void clear(int maxSize)
Definition: subcost.cpp:75
QWidget::isVisible
bool isVisible() const
QToolBar::addWidget
QAction * addWidget(QWidget *widget)
QCGTopLevel::partsUnhideAllSlotDelayed
void partsUnhideAllSlotDelayed()
Definition: qcgtoplevel.cpp:1770
ConfigGroup::setValue
virtual void setValue(const QString &key, const QVariant &value, const QVariant &defaultValue=QVariant())
Definition: config.cpp:57
FunctionSelection::selectTopFunction
bool selectTopFunction()
Definition: functionselection.cpp:846
QWidget::setAttribute
void setAttribute(Qt::WidgetAttribute attribute, bool on)
QDialog::exec
int exec()
functionselection.h
QAction::setMenu
void setMenu(QMenu *menu)
GraphExporter
GraphExporter.
Definition: callgraphview.h:298
QDBusConnection
CostItem
Base class for cost items.
Definition: costitem.h:37
FunctionSelection::setGroup
void setGroup(TraceCostItem *)
Definition: functionselection.cpp:548
config.h
QCGTopLevel::activePartsChangedSlot
void activePartsChangedSlot(const TracePartList &list)
Definition: qcgtoplevel.cpp:1721
QCGTopLevel::createActions
void createActions()
Definition: qcgtoplevel.cpp:320
QDBusConnection::sessionBus
QDBusConnection sessionBus()
GlobalConfig::config
static GlobalConfig * config()
Definition: globalconfig.cpp:145
TraceItemView::updateView
void updateView(bool force=false)
Definition: traceitemview.cpp:189
QWidget::icon
const QPixmap * icon() const
ProfileContext::Instr
Definition: context.h:38
TraceItemView::Back
Definition: traceitemview.h:90
EventTypeSet::addKnownDerivedTypes
int addKnownDerivedTypes()
Adds all known derived event types that can be parsed.
Definition: eventtype.cpp:536
EventTypeSet::type
EventType * type(int)
Definition: eventtype.cpp:475
TraceData::eventTypes
EventTypeSet * eventTypes()
Definition: tracedata.h:1407
QCGTopLevel::eventType2Selected
void eventType2Selected(const QString &)
Definition: qcgtoplevel.cpp:908
TraceData::activePartRange
QString activePartRange()
Definition: tracedata.cpp:3280
FunctionSelection::group
TraceCostItem * group()
Definition: functionselection.h:53
QCGTopLevel::layoutSave
void layoutSave()
Definition: qcgtoplevel.cpp:1565
Stack::caller
TraceFunction * caller(TraceFunction *, bool extend)
Definition: stackbrowser.cpp:134
QProgressBar::setValue
void setValue(int value)
StackBrowser::goForward
HistoryItem * goForward()
Definition: stackbrowser.cpp:347
QCGTopLevel::newWindow
void newWindow()
Definition: qcgtoplevel.cpp:748
stackselection.h
configdialog.h
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
EventType
A cost type, e.g.
Definition: eventtype.h:43
ProfileContext::Class
Definition: context.h:47
TraceData::activateParts
bool activateParts(const TracePartList &)
returns true if something changed.
Definition: tracedata.cpp:3213
StackSelection::setData
void setData(TraceData *)
Definition: stackselection.cpp:79
PartSelection::hiddenPartsChangedSlot
void hiddenPartsChangedSlot(const TracePartList &list)
Definition: partselection.cpp:478
QAction::setToolTip
void setToolTip(const QString &tip)
StackSelection::browserBack
void browserBack()
Definition: stackselection.cpp:177
QWidget::setWindowIcon
void setWindowIcon(const QIcon &icon)
QCGTopLevel::setTraceItemDelayed
void setTraceItemDelayed()
Definition: qcgtoplevel.cpp:1188
EventTypeSet::typeForLong
EventType * typeForLong(const QString &)
Definition: eventtype.cpp:500
QWidget::geometry
const QRect & geometry() const
ConfigStorage::group
static ConfigGroup * group(const QString &group, const QString &optSuffix=QString())
Definition: config.cpp:80
QSplitter::orientation
orientation
QCGTopLevel::partsUnhideAllSlot
void partsUnhideAllSlot()
Definition: qcgtoplevel.cpp:1776
QStatusBar::addWidget
void addWidget(QWidget *widget, int stretch)
QCGTopLevel::add
void add()
Definition: qcgtoplevel.cpp:804
QCGTopLevel
Definition: qcgtoplevel.h:51
PartSelection::restoreOptions
void restoreOptions(const QString &prefix, const QString &postfix)
Definition: partselection.cpp:483
QCGTopLevel::forwardAboutToShow
void forwardAboutToShow()
Definition: qcgtoplevel.cpp:1789
QCGTopLevel::toggleCycles
void toggleCycles()
Definition: qcgtoplevel.cpp:723
QCloseEvent
TraceData::parts
TracePartList parts() const
Definition: tracedata.h:1397
QMenu::clear
void clear()
QComboBox::findText
int findText(const QString &text, QFlags< Qt::MatchFlag > flags) const
QCGTopLevel::loadFinished
virtual void loadFinished(const QString &msg)
Definition: qcgtoplevel.cpp:2014
QObject::name
const char * name() const
QCGTopLevel::setAbsoluteCost
void setAbsoluteCost()
Definition: qcgtoplevel.cpp:675
QTime::elapsed
int elapsed() const
tracedata.h
ProfileCostArray
An array of basic cost metrics for a trace item.
Definition: costitem.h:144
QCGTopLevel::backTriggered
void backTriggered(QAction *)
Definition: qcgtoplevel.cpp:1912
QCGTopLevel::setEventTypeDelayed
void setEventTypeDelayed()
Definition: qcgtoplevel.cpp:1096
QList::count
int count(const T &value) const
GlobalConfig::setShowCycles
static void setShowCycles(bool)
Definition: globalconfig.cpp:364
MultiView::restoreOptions
void restoreOptions(const QString &prefix, const QString &postfix)
Definition: multiview.cpp:224
QCGTopLevel::setGroup
bool setGroup(TraceCostItem *)
Definition: qcgtoplevel.cpp:1029
QList::append
void append(const T &value)
QAction::setShortcuts
void setShortcuts(const QList< QKeySequence > &shortcuts)
QCGTopLevel::load
void load()
Definition: qcgtoplevel.cpp:755
MultiView
Definition: multiview.h:36
StackSelection::refresh
void refresh()
Definition: stackselection.cpp:209
QCGTopLevel::toggleSplitted
void toggleSplitted()
Definition: qcgtoplevel.cpp:1684
QVariant::toInt
int toInt(bool *ok) const
QCGTopLevel::goUp
void goUp()
Definition: qcgtoplevel.cpp:1407
QStatusBar::removeWidget
void removeWidget(QWidget *widget)
MultiView::setData
void setData(TraceData *)
Definition: multiview.cpp:49
QWidget::restoreGeometry
bool restoreGeometry(const QByteArray &geometry)
TraceData::updateFunctionCycles
void updateFunctionCycles()
Definition: tracedata.cpp:3675
HighestCostList
A class to calculate the ProfileCostArray items with highest cost.
Definition: subcost.h:79
QCGTopLevel::configChanged
void configChanged()
Definition: qcgtoplevel.cpp:1707
StackBrowser::canGoBack
bool canGoBack()
Definition: stackbrowser.cpp:377
StackSelection
Definition: stackselection.h:38
QCGTopLevel::exportGraph
void exportGraph()
Definition: qcgtoplevel.cpp:860
QCGTopLevel::goForward
void goForward()
Definition: qcgtoplevel.cpp:1402
TraceData::load
int load(QStringList files)
Loads profile data files.
Definition: tracedata.cpp:3130
StackSelection::browserForward
void browserForward()
Definition: stackselection.cpp:185
QCGTopLevel::toggleExpanded
void toggleExpanded()
Definition: qcgtoplevel.cpp:711
QList::isEmpty
bool isEmpty() const
ConfigDialog
Definition: configdialog.h:40
QObject::setObjectName
void setObjectName(const QString &name)
QCGTopLevel::addEventTypeMenu
void addEventTypeMenu(QMenu *, bool)
Definition: qcgtoplevel.cpp:1293
CostItem::fullName
QString fullName() const
Returns type name + dynamic name.
Definition: costitem.cpp:76
QString::isEmpty
bool isEmpty() const
QList::removeAll
int removeAll(const T &value)
GlobalConfig::showCycles
static bool showCycles()
Definition: globalconfig.cpp:338
QCGTopLevel::upAboutToShow
void upAboutToShow()
Definition: qcgtoplevel.cpp:1863
QCGTopLevel::eventTypeSelected
void eventTypeSelected(const QString &)
Definition: qcgtoplevel.cpp:900
QCGTopLevel::goBack
void goBack()
Definition: qcgtoplevel.cpp:1397
QCGTopLevel::setGroupTypeDelayed
void setGroupTypeDelayed()
Definition: qcgtoplevel.cpp:1112
HistoryItem::stack
Stack * stack()
Definition: stackbrowser.h:70
TraceItemView::None
Definition: traceitemview.h:90
GlobalGUIConfig::readOptions
void readOptions()
Definition: globalguiconfig.cpp:125
TraceCostItem::name
virtual QString name() const
Returns dynamic name info (without type)
Definition: tracedata.h:986
TraceItemView::Up
Definition: traceitemview.h:90
TraceFunction::prettyName
QString prettyName() const
Similar to name, but prettyfied = more descriptive to humans.
Definition: tracedata.cpp:1889
QCGTopLevel::loadError
virtual void loadError(int line, const QString &msg)
Definition: qcgtoplevel.cpp:2027
QTime::restart
int restart()
StackSelection::setEventType
void setEventType(EventType *)
Definition: stackselection.cpp:235
QMainWindow::setCentralWidget
void setCentralWidget(QWidget *widget)
QCGTopLevel::functionVisibilityChanged
void functionVisibilityChanged(bool)
Definition: qcgtoplevel.cpp:741
QList::first
T & first()
QLabel::setText
void setText(const QString &)
TraceItemView::activate
bool activate(CostItem *i)
Definition: traceitemview.cpp:111
QMenu::addSeparator
QAction * addSeparator()
EventTypeSet::derivedCount
int derivedCount()
Definition: eventtype.h:134
QString
QList< TracePart * >
QWidget::hide
void hide()
QMap::end
iterator end()
QCGTopLevel::updateLayoutActions
void updateLayoutActions()
Definition: qcgtoplevel.cpp:1605
FunctionSelection
Definition: functionselection.h:46
globalguiconfig.h
QCGTopLevel::loadWarning
virtual void loadWarning(int line, const QString &msg)
Definition: qcgtoplevel.cpp:2033
GlobalConfig::shortenSymbol
static QString shortenSymbol(const QString &)
Definition: globalconfig.cpp:395
ConfigGroup
A group of configuration settings.
Definition: config.h:35
TraceItemView::notifyChange
void notifyChange(int changeType)
Definition: traceitemview.h:120
Logger::_filename
QString _filename
Definition: logger.h:45
QCGTopLevel::setFunction
bool setFunction(TraceFunction *)
Definition: qcgtoplevel.cpp:1050
QCGTopLevel::addGoMenu
void addGoMenu(QMenu *)
Definition: qcgtoplevel.cpp:1384
QMap::begin
iterator begin()
QStringList
QAction::setWhatsThis
void setWhatsThis(const QString &what)
HistoryItem::next
HistoryItem * next()
Definition: stackbrowser.h:73
GlobalGUIConfig::config
static GlobalGUIConfig * config()
Definition: globalguiconfig.cpp:88
QAction::setData
void setData(const QVariant &userData)
TraceItemView::Forward
Definition: traceitemview.h:90
QCGTopLevel::showStatus
void showStatus(const QString &msg, int progress)
Definition: qcgtoplevel.cpp:1958
QMenu
QCGTopLevel::loadDelayed
void loadDelayed(QString file, bool addToRecentFiles=true)
Definition: qcgtoplevel.cpp:835
QCGTopLevel::setEventType2Delayed
void setEventType2Delayed()
Definition: qcgtoplevel.cpp:1101
QStyle::standardIcon
QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const
PartSelection::saveOptions
void saveOptions(const QString &prefix, const QString &postfix)
Definition: partselection.cpp:525
FunctionSelection::setData
void setData(TraceData *)
Definition: functionselection.cpp:232
QAction::setShortcut
void setShortcut(const QKeySequence &shortcut)
QList::contains
bool contains(const T &value) const
QCGTopLevel::upTriggered
void upTriggered(QAction *)
Definition: qcgtoplevel.cpp:1929
QMainWindow::saveState
QByteArray saveState(int version) const
QAction::setCheckable
void setCheckable(bool)
HighestCostList::addCost
void addCost(ProfileCostArray *, SubCost)
Definition: subcost.cpp:83
QWidget::setMaximumSize
void setMaximumSize(const QSize &)
QDockWidget::setWidget
void setWidget(QWidget *widget)
QCGTopLevel::setEventType
bool setEventType(EventType *)
Definition: qcgtoplevel.cpp:916
EventTypeSet::realType
EventType * realType(int)
Definition: eventtype.cpp:462
QCGTopLevel::setRelativeCost
void setRelativeCost()
Definition: qcgtoplevel.cpp:680
QStatusBar::addPermanentWidget
void addPermanentWidget(QWidget *widget, int stretch)
HistoryItem::last
HistoryItem * last()
Definition: stackbrowser.h:72
TracePart
A Trace Part: All data read from a trace file, containing all costs that happened in a specified time...
Definition: tracedata.h:655
QWidget::setWhatsThis
void setWhatsThis(const QString &)
QAction::setStatusTip
void setStatusTip(const QString &statusTip)
GraphExporter::writeDot
void writeDot(QIODevice *=0)
Definition: callgraphview.cpp:661
QMenuBar::addMenu
QAction * addMenu(QMenu *menu)
GlobalConfig::setHideTemplates
static void setHideTemplates(bool)
Definition: globalconfig.cpp:372
GlobalConfig::showExpanded
static bool showExpanded()
Definition: globalconfig.cpp:333
QVariant::toStringList
QStringList toStringList() const
QWidget::saveGeometry
QByteArray saveGeometry() const
QCGTopLevel::createMenu
void createMenu()
Definition: qcgtoplevel.cpp:536
QApplication::style
QStyle * style()
QCGTopLevel::backAboutToShow
void backAboutToShow()
Definition: qcgtoplevel.cpp:1826
QLatin1String
QKeySequence
TraceData::shortTraceName
QString shortTraceName() const
Definition: tracedata.cpp:3093
TraceItemView::Direction
Direction
Definition: traceitemview.h:90
qcgtoplevel.h
ProfileContext::Type
Type
Definition: context.h:36
QCGTopLevel::data
TraceData * data()
Definition: qcgtoplevel.h:60
MultiView::restoreLayout
void restoreLayout(const QString &prefix, const QString &postfix)
Definition: multiview.cpp:169
GlobalConfig::hideTemplates
static bool hideTemplates()
Definition: globalconfig.cpp:343
QMenu::addMenu
QAction * addMenu(QMenu *menu)
QWidget::setWindowTitle
void setWindowTitle(const QString &)
QAction
QMainWindow::restoreState
bool restoreState(const QByteArray &state, int version)
QToolBar
TraceData::resetSourceDirs
void resetSourceDirs()
Definition: tracedata.cpp:3498
QCGTopLevel::setPercentage
void setPercentage(bool)
Definition: qcgtoplevel.cpp:685
QComboBox::setCurrentIndex
void setCurrentIndex(int index)
QCGTopLevel::layoutRestore
void layoutRestore()
Definition: qcgtoplevel.cpp:1586
QList::removeLast
void removeLast()
QToolBar::addSeparator
QAction * addSeparator()
QCGTopLevel::setDirectionDelayed
void setDirectionDelayed()
Definition: qcgtoplevel.cpp:1140
QString::length
int length() const
QMainWindow::addDockWidget
void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget)
QCGTopLevel::recentFilesTriggered
void recentFilesTriggered(QAction *)
Definition: qcgtoplevel.cpp:254
EventType::longName
const QString & longName()
Definition: eventtype.h:66
QVariant::toBool
bool toBool() const
EventTypeSet
A class for managing a set of event types.
Definition: eventtype.h:117
QTime::start
void start()
QCGTopLevel::toggleFunctionDock
void toggleFunctionDock()
Definition: qcgtoplevel.cpp:661
QList::prepend
void prepend(const T &value)
QCGTopLevel::groupType
ProfileContext::Type groupType()
Definition: qcgtoplevel.h:70
QCGTopLevel::partsHideSelectedSlotDelayed
void partsHideSelectedSlotDelayed()
Definition: qcgtoplevel.cpp:1739
QComboBox::addItems
void addItems(const QStringList &texts)
QWidget::show
void show()
MultiView::setChildCount
void setChildCount(int)
Definition: multiview.cpp:57
GlobalConfig::saveOptions
virtual void saveOptions()
Definition: globalconfig.cpp:154
HistoryItem
Definition: stackbrowser.h:64
TraceData::functionMap
TraceFunctionMap & functionMap()
Definition: tracedata.h:1441
QMap< QString, TraceFunction >::Iterator
typedef Iterator
QWidget::setToolTip
void setToolTip(const QString &)
QCGTopLevel::sidebarMenuAboutToShow
void sidebarMenuAboutToShow()
Definition: qcgtoplevel.cpp:209
ProfileContext::Object
Definition: context.h:49
QCGTopLevel::loadFilesDelayed
void loadFilesDelayed()
Definition: qcgtoplevel.cpp:851
TraceData
This class holds profiling data of multiple tracefiles generated with cachegrind on one command...
Definition: tracedata.h:1363
QCGTopLevel::layoutPrevious
void layoutPrevious()
Definition: qcgtoplevel.cpp:1550
StackSelection::setGroupType
void setGroupType(ProfileContext::Type)
Definition: stackselection.cpp:257
multiview.h
StackBrowser::current
HistoryItem * current()
Definition: stackbrowser.h:94
CostItem::prettyName
virtual QString prettyName() const
Similar to name, but prettyfied = more descriptive to humans.
Definition: costitem.cpp:65
QCGTopLevel::toggleSplitDirection
void toggleSplitDirection()
Definition: qcgtoplevel.cpp:1698
EventTypeSet::derivedType
EventType * derivedType(int)
Definition: eventtype.cpp:468
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QAction::menu
QMenu * menu() const
MultiView::childCount
int childCount()
Definition: multiview.h:50
QCGTopLevel::setData
void setData(TraceData *)
A TraceData object cannot be viewed many times in different toplevel windows.
Definition: qcgtoplevel.cpp:1223
QLabel
callgraphview.h
GlobalConfig::setShowExpanded
static void setShowExpanded(bool)
Definition: globalconfig.cpp:356
QCGTopLevel::loadStart
virtual void loadStart(const QString &filename)
Definition: qcgtoplevel.cpp:2008
QToolBar::addAction
void addAction(QAction *action)
QString::arg
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QVariant::toString
QString toString() const
QCGTopLevel::setGroupDelayed
void setGroupDelayed()
Definition: qcgtoplevel.cpp:1129
MultiView::saveOptions
void saveOptions(const QString &prefix, const QString &postfix)
Definition: multiview.cpp:231
QCGTopLevel::forwardTriggered
void forwardTriggered(QAction *)
Definition: qcgtoplevel.cpp:1895
QCGTopLevel::togglePercentage
void togglePercentage()
Definition: qcgtoplevel.cpp:669
StackBrowser::canGoForward
bool canGoForward()
Definition: stackbrowser.cpp:382
GlobalConfig::maxSymbolCount
static int maxSymbolCount()
Definition: globalconfig.cpp:407
QAction::setEnabled
void setEnabled(bool)
TraceData::traceName
QString traceName() const
Definition: tracedata.h:1401
partselection.h
QWidget::height
height
QFile::encodeName
QByteArray encodeName(const QString &fileName)
QString::toAscii
QByteArray toAscii() const
QCGTopLevel::partsHideSelectedSlot
void partsHideSelectedSlot()
Definition: qcgtoplevel.cpp:1746
QIcon
EventType::name
const QString & name()
Definition: eventtype.h:65
QFileDialog::getOpenFileNames
QStringList getOpenFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
ProfileContext::Function
Definition: context.h:46
PartSelection::setData
void setData(TraceData *)
Definition: partselection.cpp:130
QCGTopLevel::layoutNext
void layoutNext()
Definition: qcgtoplevel.cpp:1535
ProfileContext::InvalidType
Definition: context.h:37
QWidget::caption
QString caption() const
ConfigGroup::value
virtual QVariant value(const QString &key, const QVariant &defaultValue) const
Definition: config.cpp:60
QTimer::singleShot
singleShot
QCGTopLevel::showMessage
void showMessage(const QString &, int msec)
Definition: qcgtoplevel.cpp:1952
TraceData::invalidateDynamicCost
void invalidateDynamicCost()
Definition: tracedata.cpp:3306
QComboBox
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:39:50 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
  • 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