~ubuntu-branches/ubuntu/vivid/kdesdk/vivid

« back to all changes in this revision

Viewing changes to kspy/classinfoview.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-06-06 11:49:54 UTC
  • mfrom: (0.4.21)
  • Revision ID: package-import@ubuntu.com-20120606114954-rdls73fzlpzxglbx
Tags: 4:4.8.80-0ubuntu1
* New uptream beta release
* Update dont_export_private_classes.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
                          classinfoview.cpp  -  description
3
 
                             -------------------
4
 
    begin                : Tue Jan 11 2005
5
 
    copyright            : (C) 2005 by Richard Dale
6
 
    email                : Richard_Dale@tipitina.demon.co.uk
7
 
 ***************************************************************************/
8
 
 
9
 
/***************************************************************************
10
 
 *                                                                         *
11
 
 *   This program is free software; you can redistribute it and/or modify  *
12
 
 *   it under the terms of the GNU General Public License as published by  *
13
 
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 
 *   (at your option) any later version.                                   *
15
 
 *                                                                         *
16
 
 ***************************************************************************/
17
 
 
18
 
#include <QObject>
19
 
#include <QMetaObject>
20
 
#include <QMetaClassInfo>
21
 
#include <QTreeWidgetItem>
22
 
 
23
 
#include <klocale.h>
24
 
 
25
 
#include "classinfoview.h"
26
 
 
27
 
ClassInfoView::ClassInfoView(QWidget *parent ) : QTreeWidget(parent)
28
 
{
29
 
  setObjectName( "class info view" );
30
 
  QStringList headerLabels;
31
 
  headerLabels << i18n( "Name" ) << i18n( "Value" );
32
 
  setHeaderLabels( headerLabels );
33
 
}
34
 
 
35
 
ClassInfoView::~ClassInfoView()
36
 
{
37
 
}
38
 
 
39
 
void ClassInfoView::buildList( QObject *o )
40
 
{
41
 
  const QMetaObject *mo = o->metaObject();
42
 
  const int count = mo->classInfoCount();
43
 
 
44
 
  for(int i = 0; i < count; ++i)
45
 
  {
46
 
    QMetaClassInfo m = mo->classInfo( i );
47
 
    new QTreeWidgetItem( this, QStringList() << m.name() << m.value() );
48
 
  }
49
 
}
50
 
 
51
 
void ClassInfoView::setTarget( QObject *o )
52
 
{
53
 
  clear();
54
 
  buildList( o );
55
 
}
56
 
 
57
 
#include "classinfoview.moc"