Commit cac3d11a authored by Sebastian Sauer's avatar Sebastian Sauer
Browse files

Q3ValueList => QList


svn path=/trunk/koffice/; revision=601392
parent f2710b95
......@@ -70,7 +70,6 @@
#include <QChildEvent>
#include <Q3PtrList>
#include <QEvent>
#include <Q3ValueList>
#include <QResizeEvent>
#include <QDateTime>
#include <config.h>
......@@ -142,7 +141,7 @@ public:
QList<KoView*> m_views;
Q3PtrList<KoDocumentChild> m_children;
Q3PtrList<KoMainWindow> m_shells;
Q3ValueList<QDomDocument> m_viewBuildDocuments;
QList<QDomDocument> m_viewBuildDocuments;
KoViewWrapperWidget *m_wrapperWidget;
// KoDocumentIface * m_dcopObject;
......@@ -2652,9 +2651,9 @@ QString KoDocument::tagNameToDocumentType( const QString& localName )
return localName;
}
Q3ValueList<KoTextDocument *> KoDocument::allTextDocuments() const
QList<KoTextDocument *> KoDocument::allTextDocuments() const
{
return Q3ValueList<KoTextDocument *>();
return QList<KoTextDocument *>();
}
KoPageLayout KoDocument::pageLayout(int /*pageNumber*/) const
......
......@@ -30,7 +30,7 @@ class KoTextDocument;
#include <QPixmap>
#include <QByteArray>
#include <Q3PtrList>
#include <Q3ValueList>
#include <QList>
#include <kparts/part.h>
#include <kurl.h>
......@@ -873,7 +873,7 @@ public:
* This is used by some text-analyzer plugins.
* @since 1.5
*/
virtual Q3ValueList<KoTextDocument *> allTextDocuments() const;
virtual QList<KoTextDocument *> allTextDocuments() const;
/**
* Returns the unit used to display all measures/distances.
......
......@@ -26,7 +26,7 @@
#include <QPixmap>
#include <QAction>
#include <QMouseEvent>
#include <Q3ValueList>
#include <QList>
#include <QKeyEvent>
#include <QEvent>
......@@ -102,7 +102,7 @@ void KoGuides::paintGuides( QPainter &painter )
for ( int i = 0; i < GL_END; ++i )
{
Q3ValueList<KoGuideLine *>::iterator it = m_guideLines[i].begin();
QList<KoGuideLine *>::iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
if ( !( *it )->automatic || ( *it )->snapping ) // do not paint autoStyle guides when they are not snapping
......@@ -287,18 +287,18 @@ bool KoGuides::keyPressEvent( QKeyEvent *e )
return eventProcessed;
}
void KoGuides::setGuideLines( const Q3ValueList<double> &horizontalPos, const Q3ValueList<double> &verticalPos )
void KoGuides::setGuideLines( const QList<double> &horizontalPos, const QList<double> &verticalPos )
{
removeSelected();
Q3ValueList<KoGuideLine *>::iterator it = m_guideLines[GL].begin();
QList<KoGuideLine *>::iterator it = m_guideLines[GL].begin();
for ( ; it != m_guideLines[GL].end(); ++it )
{
delete ( *it );
}
m_guideLines[GL].clear();
Q3ValueList<double>::ConstIterator posIt = horizontalPos.begin();
QList<double>::ConstIterator posIt = horizontalPos.begin();
for ( ; posIt != horizontalPos.end(); ++posIt )
{
KoGuideLine *guideLine = new KoGuideLine( Qt::Horizontal, *posIt, false );
......@@ -313,16 +313,16 @@ void KoGuides::setGuideLines( const Q3ValueList<double> &horizontalPos, const Q3
paint();
}
void KoGuides::setAutoGuideLines( const Q3ValueList<double> &horizontalPos, const Q3ValueList<double> &verticalPos )
void KoGuides::setAutoGuideLines( const QList<double> &horizontalPos, const QList<double> &verticalPos )
{
Q3ValueList<KoGuideLine *>::iterator it = m_guideLines[GL_AUTOMATIC].begin();
QList<KoGuideLine *>::iterator it = m_guideLines[GL_AUTOMATIC].begin();
for ( ; it != m_guideLines[GL_AUTOMATIC].end(); ++it )
{
delete ( *it );
}
m_guideLines[GL_AUTOMATIC].clear();
Q3ValueList<double>::ConstIterator posIt = horizontalPos.begin();
QList<double>::ConstIterator posIt = horizontalPos.begin();
for ( ; posIt != horizontalPos.end(); ++posIt )
{
KoGuideLine *guideLine = new KoGuideLine( Qt::Horizontal, *posIt, true );
......@@ -337,12 +337,12 @@ void KoGuides::setAutoGuideLines( const Q3ValueList<double> &horizontalPos, cons
}
void KoGuides::getGuideLines( Q3ValueList<double> &horizontalPos, Q3ValueList<double> &verticalPos ) const
void KoGuides::getGuideLines( QList<double> &horizontalPos, QList<double> &verticalPos ) const
{
horizontalPos.clear();
verticalPos.clear();
Q3ValueList<KoGuideLine *>::const_iterator it = m_guideLines[GL].begin();
QList<KoGuideLine *>::const_iterator it = m_guideLines[GL].begin();
for ( ; it != m_guideLines[GL].end(); ++it )
{
if ( ( *it )->orientation == Qt::Horizontal )
......@@ -378,7 +378,7 @@ void KoGuides::snapToGuideLines( KoRect &rect, int snap, SnapStatus &snapStatus,
for ( int i = 0; i < GL_END; ++i )
{
Q3ValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
QList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
if ( ( *it )->orientation == Qt::Horizontal )
......@@ -442,7 +442,7 @@ void KoGuides::snapToGuideLines( KoPoint &pos, int snap, SnapStatus &snapStatus,
for ( int i = 0; i < GL_END; ++i )
{
Q3ValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
QList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
if ( ( *it )->orientation == Qt::Horizontal )
......@@ -485,7 +485,7 @@ void KoGuides::repaintSnapping( const KoRect &snappedRect )
bool needRepaint = false;
for ( int i = 0; i < GL_END; ++i )
{
Q3ValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
QList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
if ( ( *it )->orientation == Qt::Horizontal )
......@@ -539,7 +539,7 @@ void KoGuides::repaintSnapping( const KoPoint &snappedPoint, SnapStatus snapStat
bool needRepaint = false;
for ( int i = 0; i < GL_END; ++i )
{
Q3ValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
QList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
if ( ( *it )->orientation == Qt::Horizontal && ( snapStatus & SNAP_HORIZ ) )
......@@ -595,7 +595,7 @@ void KoGuides::repaintAfterSnapping()
for ( int i = 0; i < GL_END; ++i )
{
Q3ValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
QList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
if ( ( *it )->snapping )
......@@ -619,7 +619,7 @@ void KoGuides::diffNextGuide( KoRect &rect, KoPoint &diff )
{
for ( int i = 0; i < GL_END; ++i )
{
Q3ValueList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
QList<KoGuideLine *>::const_iterator it = m_guideLines[i].begin();
for ( ; it != m_guideLines[i].end(); ++it )
{
if ( ( *it )->orientation == Qt::Horizontal )
......@@ -794,7 +794,7 @@ bool KoGuides::unselectAll()
{
bool selected = m_guideLines[GL_SELECTED].empty() == false;
Q3ValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
QList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
for ( ; it != m_guideLines[GL_SELECTED].end(); ++it )
{
( *it )->selected = false;
......@@ -808,7 +808,7 @@ bool KoGuides::unselectAll()
void KoGuides::removeSelected()
{
Q3ValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
QList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
for ( ; it != m_guideLines[GL_SELECTED].end(); ++it )
{
delete ( *it );
......@@ -825,7 +825,7 @@ bool KoGuides::hasSelected()
KoGuides::KoGuideLine * KoGuides::find( KoPoint &p, double diff )
{
Q3ValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
QList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
for ( ; it != m_guideLines[GL_SELECTED].end(); ++it )
{
if ( ( *it )->orientation == Qt::Vertical && QABS( ( *it )->position - p.x() ) < diff )
......@@ -863,7 +863,7 @@ void KoGuides::moveSelectedBy( QPoint &p )
double right = qMax( pl.ptWidth, m_zoomHandler->unzoomItXOld( m_view->canvas()->width() + m_view->canvasXOffset() - 1 ) );
double bottom = qMax( pl.ptHeight, m_zoomHandler->unzoomItYOld( m_view->canvas()->height() + m_view->canvasYOffset() - 1 ) );
Q3ValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
QList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
for ( ; it != m_guideLines[GL_SELECTED].end(); ++it )
{
if ( ( *it )->orientation == Qt::Vertical )
......@@ -892,7 +892,7 @@ void KoGuides::moveSelectedBy( QPoint &p )
}
}
}
Q3ValueList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
QList<KoGuideLine *>::iterator it = m_guideLines[GL_SELECTED].begin();
for ( ; it != m_guideLines[GL_SELECTED].end(); ++it )
{
( *it )->snapping = false;
......
......@@ -26,7 +26,7 @@
#include <QObject>
//Added by qt3to4:
#include <QMouseEvent>
#include <Q3ValueList>
#include <QList>
#include <QKeyEvent>
#include <koffice_export.h>
......@@ -124,7 +124,7 @@ public:
* @param horizontalPos A list of the position of the horizontal guide lines.
* @param verticalPos A list of the position of the vertical guide lines.
*/
void setGuideLines( const Q3ValueList<double> &horizontalPos, const Q3ValueList<double> &verticalPos );
void setGuideLines( const QList<double> &horizontalPos, const QList<double> &verticalPos );
/**
* @brief Set the positions for snapping of auto guide lines
......@@ -134,7 +134,7 @@ public:
* @param horizontalPos A list of the position of the horizontal guide lines.
* @param verticalPos A list of the position of the vertical guide lines.
*/
void setAutoGuideLines( const Q3ValueList<double> &horizontalPos, const Q3ValueList<double> &verticalPos );
void setAutoGuideLines( const QList<double> &horizontalPos, const QList<double> &verticalPos );
/**
* @brief Get the position of the guide lines
......@@ -145,7 +145,7 @@ public:
* @param horizontalPos A list of the position of the horizontal guide lines.
* @param verticalPos A list of the position of the vertical guide lines.
*/
void getGuideLines( Q3ValueList<double> &horizontalPos, Q3ValueList<double> &verticalPos ) const;
void getGuideLines( QList<double> &horizontalPos, QList<double> &verticalPos ) const;
/**
* @brief Snap rect to guidelines
......@@ -409,7 +409,7 @@ private:
};
/// array of list of the different guide line types
Q3ValueList<KoGuideLine *> m_guideLines[GL_END];
QList<KoGuideLine *> m_guideLines[GL_END];
/// used to save the last mouse position
QPoint m_lastPoint;
......
#ifndef __CXX_INDIRECT_PYTHON_INTERFACE__HXX__
#define __CXX_INDIRECT_PYTHON_INTERFACE__HXX__
// Prevent warnings
#if defined(_XOPEN_SOURCE)
#undef _XOPEN_SOURCE
#endif
#include <Python.h>
namespace Py
......
......@@ -80,15 +80,18 @@ PythonExtension::PythonExtension(QObject* object)
behaviors().supportSequenceType();
behaviors().supportMappingType();
add_varargs_method("__name__", &PythonExtension::getObjectName, "Return the objectName.");
add_varargs_method("__class__", &PythonExtension::getClassName, "Return the className.");
//add_varargs_method("__classinfos__", &PythonExtension::getClassInfos, "Return a list of key,value-tuples of class informations.");
add_varargs_method("__signals__", &PythonExtension::getSignalNames, "Return list of signal names.");
add_varargs_method("__slots__", &PythonExtension::getSlotNames, "Return list of slot names.");
add_varargs_method("__properties__", &PythonExtension::getPropertyNames, "Return list of property names.");
add_varargs_method("className", &PythonExtension::getClassName, "Return the name of the QObject class.");
//add_varargs_method("classInfo", &PythonExtension::getClassInfo, "Return a list of key,value-tuples of class informations.");
add_varargs_method("signalNames", &PythonExtension::getSignalNames, "Return list of signal names the QObject provides.");
add_varargs_method("slotNames", &PythonExtension::getSlotNames, "Return list of slot names the QObject provides.");
add_varargs_method("propertyNames", &PythonExtension::getPropertyNames, "Return list of property names the QObject provides.");
//add_varargs_method("dynamicPropertyNames", &PythonExtension::getDynamicPropertyNames, "");
add_varargs_method("property", &PythonExtension::getProperty, "Return a property value.");
add_varargs_method("setProperty", &PythonExtension::setProperty, "Set a property value.");
//add_varargs_method("__toPointer__", &PythonExtension::toPointer, "Return the void* pointer of the QObject.");
//add_varargs_method("__fromPointer__", &PythonExtension::fromPointer, "Set the QObject* to the passed void* pointer.");
//add_varargs_method("__connect__", &PythonExtension::doConnect, "Connect signal with python function.");
add_varargs_method("connect", &PythonExtension::doConnect, "Connect signal, slots or python functions together.");
//add_varargs_method("emit", &PythonExtension::emitSignal, "Emit a signal the QObject provides.");
d->proxymethod = new Py::MethodDefExt<PythonExtension>(
"", // methodname, not needed cause we use the method only internaly.
......@@ -244,10 +247,12 @@ int PythonExtension::setattr(const char* n, const Py::Object& value)
return Py::PythonExtension<PythonExtension>::setattr(n, value);
}
/* objectName is a property anyway and therefore already accessible
Py::Object PythonExtension::getObjectName(const Py::Tuple&)
{
return PythonType<QString>::toPyObject( d->object->objectName() );
}
*/
Py::Object PythonExtension::getClassName(const Py::Tuple&)
{
......@@ -290,6 +295,29 @@ Py::Object PythonExtension::getPropertyNames(const Py::Tuple&)
return list;
}
Py::Object PythonExtension::getProperty(const Py::Tuple& args)
{
if( args.size() != 1 ) {
Py::TypeError("Expected the propertyname as argument.");
return Py::None();
}
return PythonType<QVariant>::toPyObject( d->object->property(
PythonType<QByteArray>::toVariant(args[0]).constData()
) );
}
Py::Object PythonExtension::setProperty(const Py::Tuple& args)
{
if( args.size() != 2 ) {
Py::TypeError("Expected the propertyname and the value as arguments.");
return Py::None();
}
return PythonType<bool>::toPyObject( d->object->setProperty(
PythonType<QByteArray>::toVariant(args[0]).constData(),
PythonType<QVariant>::toVariant(args[1])
) );
}
/*
Py::Object PythonExtension::toPointer(const Py::Tuple&)
{
......@@ -300,48 +328,104 @@ Py::Object PythonExtension::toPointer(const Py::Tuple&)
//return pyqtextension;
}
Py::Object PythonExtension::toPointer(fromPointer(const Py::Tuple&)
Py::Object PythonExtension::fromPointer(fromPointer(const Py::Tuple&)
{
QObject* object = dynamic_cast< QObject* >(PyLong_AsVoidPtr( args[0] ));
}
*/
#if 0
Py::Object PythonExtension::doConnect(const Py::Tuple& args)
{
if( args.size() < 2 ) {
Py::AttributeError("The connect-method expects at least 2 arguments.");
Py::TypeError("Expected at least 2 arguments.");
return PythonType<bool>::toPyObject(false);
}
QByteArray signalname = PythonType<QByteArray>::toVariant( args[0] );
krossdebug( QString("====================================> signalname=%1 typeName=%2").arg(signalname).arg(args[1].type().as_string().c_str()) );
if( args[1].isCallable() ) {
Py::Callable funcobject(args[1]);
QVariantList args = d->signalspy.takeFirst();
Py::Object result = d->callable.apply( PythonType<QVariantList,Py::Tuple>::toPyObject(args) );
uint idx; // next argument to check
QObject* sender; // the sender object
QByteArray sendersignal; // the sender signal
if( args[0].isString() ) { // connect(signal, ...)
sender = d->object;
sendersignal = PythonType<QByteArray>::toVariant( args[0] );
idx = 1;
}
else { // connect(sender, signal, ...)
Py::ExtensionObject<PythonExtension> extobj(args[0]);
PythonExtension* extension = extobj.extensionObject();
if(! extension) {
Py::TypeError( QString("First argument needs to be a signalname or a sender-object.").toLatin1().constData() );
return PythonType<bool>::toPyObject(false);
}
sender = extension->object();
if( ! args[1].isString() ) {
Py::TypeError( QString("Second argument needs to be a signalname.").toLatin1().constData() );
return PythonType<bool>::toPyObject(false);
}
sendersignal = PythonType<QByteArray>::toVariant( args[1] );
idx = 2;
if( args.size() <= idx ) {
Py::TypeError( QString("Expected at least %1 arguments.").arg(idx+1).toLatin1().constData() );
return PythonType<bool>::toPyObject(false);
}
}
//connect(d->object, "2" + signalname, , SIGNAL(handleEmitted));
//QSignalSpy spy(d->object, signalname);
/*
COMPARE(spy.count(), 1); // make sure the signal was emitted exactly one time
QVariantList arguments = spy.takeFirst(); // take the first signal
VERIFY(arguments.at(0).toBool() == true); // verify the first argument
*/
if( args[idx].isCallable() ) { // connect(..., pyfunction)
Py::Callable func(args[idx]);
//TODO
//TODO add adaptor
//Py::Object result = func.apply( PythonType<QVariantList,Py::Tuple>::toPyObject(args) );
krossdebug( QString("TOOOOOOOOOOO-DOOOOOOOOOOOO PythonExtension::doConnect sender=%1 signal=%2 pyfunction=%3").arg(sender->objectName()).arg(sendersignal.constData()).arg(func.as_string().c_str()).toLatin1().constData() );
}
else {
Py::AttributeError("The connect-method expects as second argument something that is callable (e.g. a function).");
return PythonType<bool>::toPyObject(false);
QObject* receiver; // the receiver object
QByteArray receiverslot; // the receiver slot
if( args[idx].isString() ) { // connect(..., slot)
receiver = d->object;
receiverslot = PythonType<QByteArray>::toVariant( args[idx] );
}
else { // connect(..., receiver, slot)
Py::ExtensionObject<PythonExtension> extobj(args[idx]);
PythonExtension* extension = extobj.extensionObject();
if(! extension) {
Py::TypeError( QString("Receiver argument needs to be a slotname or a receiver-object.").toLatin1().constData() );
return PythonType<bool>::toPyObject(false);
}
receiver = extension->object();
idx++;
if( args.size() < idx ) {
Py::TypeError( QString("Expected at least %1 arguments.").arg(idx+1).toLatin1().constData() );
return PythonType<bool>::toPyObject(false);
}
if( ! args[idx].isString() ) {
Py::TypeError( QString("Expected receiver slotname as argument %1.").arg(idx+1).toLatin1().constData() );
return PythonType<bool>::toPyObject(false);
}
receiverslot = PythonType<QByteArray>::toVariant( args[idx] );
}
if( args.size() > idx + 1 ) {
Py::TypeError( QString("To much arguments specified.").toLatin1().constData() );
return PythonType<bool>::toPyObject(false);
}
// Dirty hack to replace SIGNAL() and SLOT() macros. If the user doesn't
// defined them explicit, we assume it's wanted to connect from a signal to
// a slot. This seems to be the most flexible solution so far...
if( ! sendersignal.startsWith('1') && ! sendersignal.startsWith('2') )
sendersignal.prepend('2'); // prepending 2 means SIGNAL(...)
if( ! receiverslot.startsWith('1') && ! receiverslot.startsWith('2') )
receiverslot.prepend('1'); // prepending 1 means SLOT(...)
krossdebug( QString("PythonExtension::doConnect sender=%1 signal=%2 receiver=%3 slot=%4").arg(sender->objectName()).arg(sendersignal.constData()).arg(receiver->objectName()).arg(receiverslot.constData()).toLatin1().constData() );
if(! QObject::connect(sender, sendersignal, receiver, receiverslot) ) {
krosswarning( QString("PythonExtension::doConnect Failed to connect").toLatin1().constData() );
return PythonType<bool>::toPyObject(false);
}
}
return PythonType<bool>::toPyObject(true);
}
#endif
PyObject* PythonExtension::proxyhandler(PyObject *_self_and_name_tuple, PyObject *args)
{
......
......@@ -100,16 +100,18 @@ namespace Kross {
/// \internal d-pointer instance.
Private* const d;
/// Return the objectName.
Py::Object getObjectName(const Py::Tuple&);
/// Return the className.
/// Return the name of the QObject class.
Py::Object getClassName(const Py::Tuple&);
/// Return list of signal names.
/// Return list of signal names the QObject provides.
Py::Object getSignalNames(const Py::Tuple&);
/// Return list of slot names.
/// Return list of slot names the QObject provides.
Py::Object getSlotNames(const Py::Tuple&);
/// Return list of property names.
/// Return list of property names the QObject provides.
Py::Object getPropertyNames(const Py::Tuple&);
/// Return a property value.
Py::Object getProperty(const Py::Tuple&);
/// Set a property value.
Py::Object setProperty(const Py::Tuple&);
//Py::Object toPointer(const Py::Tuple&);
//Py::Object fromPointer(const Py::Tuple&);
......
......@@ -92,9 +92,10 @@ class TestKross(unittest.TestCase):
def testObject(self):
self.assert_( self.object1.name() == "TestObject1" and self.object2.name() == "TestObject2" )
#self.assert_( self.object1.func_testobject_testobject(self.object1).name() == self.object1.name() )
self.assert_( self.object1.objectName == "TestObject1" and self.object2.objectName == "TestObject2" )
self.assert_( self.object1.className() == "TestObject" and self.object2.className() == "TestObject" )
def testProperties(self):
def testPropertyMembers(self):
self.object1.boolProperty = True
self.assert_( self.object1.boolProperty == True )
self.object1.boolProperty = False
......@@ -115,13 +116,39 @@ class TestKross(unittest.TestCase):
self.object1.listProperty = [ True, [2464, -8295], -572.07516, "test", [] ]
self.assert_( self.object1.listProperty == [ True, [2464, -8295], -572.07516, "test", [] ] )
def testEnumerations(self):
def testPropertyMethods(self):
self.object1.setProperty("boolProperty", False)
self.assert_( self.object1.property("boolProperty") == False )
self.object1.setProperty("boolProperty", True)
self.assert_( self.object1.property("boolProperty") == True )
self.object1.setProperty("intProperty", -75825)
self.assert_( self.object1.property("intProperty") == -75825 )
self.object1.setProperty("doubleProperty", -9373.8721)
self.assert_( self.object1.property("doubleProperty") == -9373.8721 )
self.object1.setProperty("stringProperty", " AnOtHeR sTrInG ")
self.assert_( self.object1.property("stringProperty") == " AnOtHeR sTrInG " )
self.object1.setProperty("stringListProperty", ["s1","s2",""])
self.assert_( self.object1.property("stringListProperty") == ["s1","s2",""] )
self.object1.setProperty("listProperty", [[True,False],"abc",[846,-573.02],[]])
self.assert_( self.object1.property("listProperty") == [[True,False],"abc",[846,-573.02],[]] )
def testEnumerationMembers(self):
self.assert_( self.object1.TESTENUM1 == 1 )
self.assert_( self.object1.TESTENUM2 == 2 )
self.assert_( self.object1.TESTENUM3 == 4 )
self.assert_( self.object1.TESTENUM4 == 8 )
#self.assert_( self.object1.testEnum( self.object1.TESTENUM3 ) == 4 )
def testSignalsSlots(self):
ok = self.object1.connect("signalString(const QString&)", self.object2, "func_qstring_qstring(const QString&)")
print "============================> %s\n" % ok
#self.assert_( self.object1.TESTENUM1 == 1 )
#def testExpectedFailures(self):
# to less arguments
#self.assertRaises(ValueError, self.pluginobject1.uintfunc)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment