~ubuntu-branches/ubuntu/natty/pyside/natty

« back to all changes in this revision

Viewing changes to PySide/QtUiTools/glue/uitools_loadui.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Raboud
  • Date: 2011-02-18 18:01:00 UTC
  • mfrom: (1.2.3 upstream) (6.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20110218180100-vaczjij7g08fzfme
Tags: 1.0.0~rc1-1
* New 1.0.0~rc1 upstream release
  - Bump the B-D chain versions:
    + apiextractor to 0.10.0-2~
    + generatorrunner to 0.6.6
    + shiboken to 1.0.0~rc1
* Update patches to ~rc1.
* debian/watch: update to handle Release Candidates too.
* Bump XS-Python-Version to >= 2.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
            bool has_attr = PyObject_HasAttrString(pyParent, qPrintable(name));
19
19
            Shiboken::AutoDecRef pyChild(Shiboken::Converter<QObject*>::toPython(child));
20
20
            if (!has_attr)
21
 
                        PyObject_SetAttrString(pyParent, qPrintable(name), PyWeakref_NewProxy(pyChild, 0));
 
21
                PyObject_SetAttrString(pyParent, qPrintable(name), pyChild);
22
22
 
23
 
            Shiboken::setParent(pyParent, pyChild);
 
23
            Shiboken::Object::setParent(pyParent, pyChild);
24
24
            _populate_parent(pyChild, qobject_cast<QObject*>(child));
25
25
        }
26
26
    }
31
31
{
32
32
    QWidget *w = self->load(dev, parent);
33
33
    if (w) {
 
34
        QObject* _parent = parent;
 
35
        if (!_parent)
 
36
            _parent = w;
 
37
 
34
38
        if (parent && parent->layout())
35
39
            parent->layout()->deleteLater();
36
40
 
37
41
        PyObject* pyParent = Shiboken::Converter<QWidget*>::toPython(w);
38
 
        _populate_parent(pyParent, w);
 
42
        _populate_parent(pyParent, _parent);
39
43
 
40
44
        return pyParent;
41
45
    }
42
46
 
43
 
    PyErr_SetString(PyExc_RuntimeError, "Unable to open ui file");
 
47
    if (!PyErr_Occurred())
 
48
        PyErr_SetString(PyExc_RuntimeError, "Unable to open ui file");
44
49
    return 0;
45
50
}
46
51
 
66
71
            return Shiboken::Converter<QWidget*>::toPython(w);
67
72
        }
68
73
    }
69
 
    PyErr_SetString(PyExc_RuntimeError, "Unable to open ui file");
70
 
    return 0;   
 
74
    if (!PyErr_Occurred())
 
75
        PyErr_SetString(PyExc_RuntimeError, "Unable to open ui file");
 
76
    return 0;
71
77
}