summaryrefslogtreecommitdiffstats
path: root/kspy/classinfoview.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /kspy/classinfoview.cpp
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kspy/classinfoview.cpp')
-rw-r--r--kspy/classinfoview.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/kspy/classinfoview.cpp b/kspy/classinfoview.cpp
new file mode 100644
index 00000000..1b976cfa
--- /dev/null
+++ b/kspy/classinfoview.cpp
@@ -0,0 +1,58 @@
+/***************************************************************************
+ classinfoview.cpp - description
+ -------------------
+ begin : Tue Jan 11 2005
+ copyright : (C) 2005 by Richard Dale
+ email : Richard_Dale@tipitina.demon.co.uk
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <qobjectdict.h>
+#include <qobjectlist.h>
+#include <qmetaobject.h>
+#include <qstrlist.h>
+#include <qvariant.h>
+
+#include <klocale.h>
+
+#include "classinfoview.h"
+
+ClassInfoView::ClassInfoView(QWidget *parent, const char *name ) : KListView(parent,name)
+{
+ addColumn( i18n( "Name" ) );
+ addColumn( i18n( "Value" ) );
+
+ setRootIsDecorated( true );
+ setAllColumnsShowFocus( true );
+ setFullWidth( true );
+}
+
+ClassInfoView::~ClassInfoView()
+{
+}
+
+void ClassInfoView::buildList( QObject *o )
+{
+ QMetaObject *mo = o->metaObject();
+
+ for (int index = 0; index < mo->numClassInfo(true); index++) {
+ const QClassInfo * classInfo = mo->classInfo(index, true);
+ new KListViewItem( this, classInfo->name, classInfo->value );
+ }
+}
+
+void ClassInfoView::setTarget( QObject *o )
+{
+ clear();
+ buildList( o );
+}
+
+#include "classinfoview.moc"