1
/***************************************************************************
2
classinfoview.cpp - description
4
begin : Tue Jan 11 2005
5
copyright : (C) 2005 by Richard Dale
6
email : Richard_Dale@tipitina.demon.co.uk
7
***************************************************************************/
9
/***************************************************************************
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. *
16
***************************************************************************/
19
#include <QMetaObject>
20
#include <QMetaClassInfo>
21
#include <QTreeWidgetItem>
25
#include "classinfoview.h"
27
ClassInfoView::ClassInfoView(QWidget *parent ) : QTreeWidget(parent)
29
setObjectName( "class info view" );
30
QStringList headerLabels;
31
headerLabels << i18n( "Name" ) << i18n( "Value" );
32
setHeaderLabels( headerLabels );
35
ClassInfoView::~ClassInfoView()
39
void ClassInfoView::buildList( QObject *o )
41
const QMetaObject *mo = o->metaObject();
42
const int count = mo->classInfoCount();
44
for(int i = 0; i < count; ++i)
46
QMetaClassInfo m = mo->classInfo( i );
47
new QTreeWidgetItem( this, QStringList() << m.name() << m.value() );
51
void ClassInfoView::setTarget( QObject *o )
57
#include "classinfoview.moc"