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>
This commit is contained in:
parent
f5f9c23c5f
commit
a7e4ddb8ca
3 changed files with 27 additions and 1 deletions
|
|
@ -777,6 +777,12 @@ static void _addSignalToWrapper(SbkObjectType* wrapperType, const char* signalNa
|
||||||
PyDict_SetItemString(typeDict, signalName, reinterpret_cast<PyObject*>(signal));
|
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)
|
void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject)
|
||||||
{
|
{
|
||||||
typedef QHash<QByteArray, QList<QByteArray> > SignalSigMap;
|
typedef QHash<QByteArray, QList<QByteArray> > SignalSigMap;
|
||||||
|
|
@ -801,7 +807,8 @@ void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject)
|
||||||
self->initialized = 0;
|
self->initialized = 0;
|
||||||
self->homonymousMethod = 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 j = it.value().begin();
|
||||||
SignalSigMap::mapped_type::const_iterator endJ = it.value().end();
|
SignalSigMap::mapped_type::const_iterator endJ = it.value().end();
|
||||||
for (; j != endJ; ++j)
|
for (; j != endJ; ++j)
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ PYSIDE_TEST(bug_921.py)
|
||||||
PYSIDE_TEST(bug_941.py)
|
PYSIDE_TEST(bug_941.py)
|
||||||
PYSIDE_TEST(bug_964.py)
|
PYSIDE_TEST(bug_964.py)
|
||||||
PYSIDE_TEST(bug_972.py)
|
PYSIDE_TEST(bug_972.py)
|
||||||
|
PYSIDE_TEST(bug_988.py)
|
||||||
PYSIDE_TEST(bug_991.py)
|
PYSIDE_TEST(bug_991.py)
|
||||||
PYSIDE_TEST(customproxywidget_test.py)
|
PYSIDE_TEST(customproxywidget_test.py)
|
||||||
PYSIDE_TEST(deepcopy_test.py)
|
PYSIDE_TEST(deepcopy_test.py)
|
||||||
|
|
|
||||||
18
tests/QtGui/bug_988.py
Normal file
18
tests/QtGui/bug_988.py
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import unittest
|
||||||
|
from PySide.QtGui import *
|
||||||
|
|
||||||
|
class TestBug988 (unittest.TestCase):
|
||||||
|
|
||||||
|
def callback(self, arg):
|
||||||
|
self.arg = arg
|
||||||
|
|
||||||
|
def testIt(self):
|
||||||
|
self.arg = None
|
||||||
|
app = QApplication([])
|
||||||
|
obj = QTabWidget()
|
||||||
|
obj.currentChanged.connect(self.callback)
|
||||||
|
obj.currentChanged.emit(5)
|
||||||
|
self.assertEqual(self.arg, 5)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue