PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 207 - QVariant does not recognize C++ Qt types correctly
: QVariant does not recognize C++ Qt types correctly
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtCore
: HEAD
: All All
: P5 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-04-01 11:44 EEST by Lauro Moura
Modified: 2010-06-07 09:27 EEST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lauro Moura 2010-04-01 11:44:49 EEST
QVariant(QObject()).typeName() returns PyQt_PyObject instead of 'QObjectStar'
Comment 1 Hugo Parente Lima 2010-04-01 16:09:07 EEST
QObjectStar is the name of a QMetaType id, but not the name of an
QVariant::Type.

QVariant even have a constructor with a QObject parameter.

In C++ I can use: QVariant::fromValue(some_qobject_ptr), the typeName() will
return "QObject*" and the type() will return a integer out of the range of
QVariant::Type, which is the QMetaType::Id of QObject, weird... but is what
happens.

So, the better aproach is to store as a PyObject IMO.

Can I mark as invalid?
Comment 2 Hugo Parente Lima 2010-04-05 18:51:29 EEST
Forget what I said, It's valid!

The problem is:

QVariant.toPyObject returns None, but should return the correct object when its
type was registered onto QMetaType.
Comment 3 Lauro Moura 2010-04-19 17:43:37 EEST
Just an update:

Working for QObject, QWidget but fails with QAbstractKineticScroller
Comment 4 Hugo Parente Lima 2010-05-20 10:16:45 EEST
*** Bug 226 has been marked as a duplicate of this bug. ***
Comment 5 Hugo Parente Lima 2010-05-20 10:59:08 EEST
Fixed, waiting for code review to go to mainline.

http://qt.gitorious.org/pyside/pyside-shiboken/merge_requests/142
http://qt.gitorious.org/pyside/shiboken/merge_requests/118
Comment 6 Hugo Parente Lima 2010-05-20 11:42:20 EEST
Fixed in commits:

pyside-shiboken/34317b147f3c00b0ea81d79219183c1e96bc5533
shiboken/980a1a15f6cc34af58c121cbdbad2e40c878617a
Comment 7 renato filho 2010-06-07 09:27:23 EEST
released 0.3.2.