aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtGui/glue
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-01-26 22:17:04 -0200
committerHugo Lima <hugo.lima@openbossa.org>2010-01-27 16:57:15 -0200
commitd35fd7fa2c689af2467b98cb45e0fa42efbd59b1 (patch)
tree329341a360f1aaf9b18517134ae2e64c93879682 /PySide/QtGui/glue
parent478a440f26eefdd04afdc69daa93e89b1bdcdfdf (diff)
Initial QtGui bindings.
Diffstat (limited to 'PySide/QtGui/glue')
-rw-r--r--PySide/QtGui/glue/qapplication_init.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
new file mode 100644
index 000000000..e45c4375f
--- /dev/null
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -0,0 +1,20 @@
+int SbkQApplication_Init(PyObject* self, PyObject* args, PyObject*)
+{
+ int numArgs = PyTuple_GET_SIZE(args);
+ if (numArgs != 1) {
+ PyErr_BadArgument();
+ return -1;
+ }
+
+ char** argv;
+ int argc;
+ if (!PySequence_to_argc_argv(PyTuple_GET_ITEM(args, 0), &argc, &argv)) {
+ PyErr_BadArgument();
+ return -1;
+ }
+
+ SbkBaseWrapper_setCptr(self, new QApplication(argc, argv));
+ SbkBaseWrapper_setValidCppObject(self, 1);
+ Shiboken::BindingManager::instance().registerWrapper(reinterpret_cast<SbkBaseWrapper*>(self));
+ return 1;
+}