Moved list_signal_test to pysidetest library.
This isolate the test case, and avoid other problems with X during the
buildbot compilation.
Reviewer: Lauro Moura <lauro.neto@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
This commit is contained in:
parent
d3b630e168
commit
2734efb6b7
5 changed files with 27 additions and 36 deletions
|
|
@ -76,4 +76,5 @@ PYSIDE_TEST(homonymoussignalandmethod_test.py)
|
|||
PYSIDE_TEST(delegatecreateseditor_test.py)
|
||||
PYSIDE_TEST(modelview_test.py)
|
||||
PYSIDE_TEST(version_test.py)
|
||||
PYSIDE_TEST(list_signal_test.py)
|
||||
|
||||
|
|
|
|||
23
tests/pysidetest/list_signal_test.py
Normal file
23
tests/pysidetest/list_signal_test.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import unittest
|
||||
from testbinding import TestObject
|
||||
from PySide.QtCore import QObject
|
||||
|
||||
class ListConnectionTest(unittest.TestCase):
|
||||
|
||||
def childrenChanged(self, children):
|
||||
self._child = children[0]
|
||||
|
||||
def testConnection(self):
|
||||
o = TestObject(0)
|
||||
c = QObject()
|
||||
c.setObjectName("child")
|
||||
self._child = None
|
||||
o.childrenChanged.connect(self.childrenChanged)
|
||||
o.addChild(c)
|
||||
self.assertEquals(self._child.objectName(), "child")
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
|
@ -14,6 +14,7 @@ public:
|
|||
TestObject(int idValue, QObject* parent = 0) : QObject(parent), m_idValue(idValue) {}
|
||||
int idValue() const { return m_idValue; }
|
||||
static int staticMethodDouble(int value) { return value * 2; }
|
||||
void addChild(QObject* c) { m_children.append(c); emit childrenChanged(m_children); }
|
||||
|
||||
void emitIdValueSignal();
|
||||
void emitStaticMethodDoubleSignal();
|
||||
|
|
@ -22,9 +23,11 @@ signals:
|
|||
void idValue(int newValue);
|
||||
void justASignal();
|
||||
void staticMethodDouble();
|
||||
void childrenChanged(const QList<QObject*>);
|
||||
|
||||
private:
|
||||
int m_idValue;
|
||||
QList<QObject*> m_children;
|
||||
};
|
||||
|
||||
#endif // TESTOBJECT_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue