summaryrefslogtreecommitdiffstats
path: root/kspy/kspy.h
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/kspy.h
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/kspy.h')
-rw-r--r--kspy/kspy.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/kspy/kspy.h b/kspy/kspy.h
new file mode 100644
index 00000000..e2878125
--- /dev/null
+++ b/kspy/kspy.h
@@ -0,0 +1,44 @@
+// -*- c++ -*-
+
+#ifndef KSPY_H
+#define KSPY_H
+
+#include <klibloader.h>
+
+/**
+ * Loader for the QObject debugging tool. The usage is simple, just call
+ * KSpy::invoke(), then use the spy window to examine the state of your
+ * QObjects.
+ *
+ * @author Richard Moore, rich@kde.org
+ * @version $Id$
+ */
+class KSpy
+{
+public:
+ /**
+ * Loads and invokes the KSpy utility.
+ */
+ static void invoke() {
+ KLibLoader *loader = KLibLoader::self();
+ KLibrary *lib = loader->library( "libkspy" );
+
+ if ( !lib ) {
+ qWarning( "Unable to load KSpy library\n" );
+ return;
+ }
+
+ lib->factory(); // Ensure the factory is loaded
+
+ // We don't need to do any more, KSpy is fired up by the loader hook
+ // in the shared library.
+ }
+
+private:
+ // Prevent instantiation.
+ KSpy() {}
+ ~KSpy() {}
+};
+
+#endif // KSPY_H
+