summaryrefslogtreecommitdiffstats
path: root/libpyside
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-08-30 16:02:43 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2011-08-30 18:30:13 -0300
commit93d87b2fc77031a6fe7d9c770ada5930f180e006 (patch)
treefbc453ee3b02cfb8249e017cef50c67fdaa989b2 /libpyside
parent472f8b7a75ad7d71df47bdfa136f5d8ff1ba56f0 (diff)
downloadpyside-93d87b2fc77031a6fe7d9c770ada5930f180e006.tar.gz
pyside-93d87b2fc77031a6fe7d9c770ada5930f180e006.tar.xz
pyside-93d87b2fc77031a6fe7d9c770ada5930f180e006.zip
Fix bug 988 - "The type supplied with currentChanged signal in QTabWidget has changed in 1.0.6"
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'libpyside')
-rw-r--r--libpyside/pysidesignal.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libpyside/pysidesignal.cpp b/libpyside/pysidesignal.cpp
index 9b8cbc0..3308035 100644
--- a/libpyside/pysidesignal.cpp
+++ b/libpyside/pysidesignal.cpp
@@ -777,6 +777,12 @@ static void _addSignalToWrapper(SbkObjectType* wrapperType, const char* signalNa
PyDict_SetItemString(typeDict, signalName, reinterpret_cast<PyObject*>(signal));
}
+// This function is used by qStableSort to promote empty signatures
+static bool compareSignals(const QByteArray& sig1, const QByteArray& sig2)
+{
+ return sig1.isEmpty();
+}
+
void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject)
{
typedef QHash<QByteArray, QList<QByteArray> > SignalSigMap;
@@ -801,7 +807,8 @@ void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject)
self->initialized = 0;
self->homonymousMethod = 0;
- qSort(it.value().begin(), it.value().end());
+ // Empty signatures comes first! So they will be the default signal signature
+ qStableSort(it.value().begin(), it.value().end(), &compareSignals);
SignalSigMap::mapped_type::const_iterator j = it.value().begin();
SignalSigMap::mapped_type::const_iterator endJ = it.value().end();
for (; j != endJ; ++j)