Added a PySide derived test library.
The test library is intended to provide specific test cases in a way that problems could be isolated easier than using the ones provided by the Qt library. Cases commons to all Python bindings must go into the Shiboken test libraries, the one added here is intended to test Qt specifics (e.g. signals). A Python unit test was added for the case when a method and a signal have the same name.
This commit is contained in:
parent
42516e6f86
commit
4b3b56acd7
9 changed files with 1694 additions and 5 deletions
28
tests/pysidetest/testobject.h
Normal file
28
tests/pysidetest/testobject.h
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#ifndef TESTOBJECT_H
|
||||
#define TESTOBJECT_H
|
||||
|
||||
#include <QObject>
|
||||
#include "pysidemacros.h"
|
||||
|
||||
class PYSIDE_API TestObject : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
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 emitIdValueSignal();
|
||||
void emitStaticMethodDoubleSignal();
|
||||
|
||||
signals:
|
||||
void idValue(int newValue);
|
||||
void justASignal();
|
||||
void staticMethodDouble();
|
||||
|
||||
private:
|
||||
int m_idValue;
|
||||
};
|
||||
|
||||
#endif // TESTOBJECT_H
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue