Re: [PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

2009-05-04 Thread Darren Dale
On Mon, Apr 20, 2009 at 2:54 PM, Phil Thompson
p...@riverbankcomputing.comwrote:

 On Mon, 20 Apr 2009 08:22:54 +0200, Simon Edwards si...@simonzone.com
 wrote:
  Phil Thompson wrote:
  On Sun, 19 Apr 2009 21:39:29 +0200, Simon Edwards si...@simonzone.com
  wrote:
  Phil Thompson wrote:
  sipForceConvertTo_*() (and related functions) are internal and should
  not
  be used by handwritten code. If it isn't documented then you can't use
  it.
  Thanks that helps a lot.
 
  Another question. 4.8 gives errors on PyKDE related it trying to use a
  copy constructor or operator=() on some classes which don't have one or

  have one which is private. It looks like SIP wants to use the copy
  constructor to copy a returned value from a method and then fails. Has
  anything changed? Have you got any tips about what I should be trying.
 
  If a copy ctor is private then SIP should be told about it - see
  qobject.sip.
 
  The copy ctor is included and private like many others. This might be a
  namespace related issue. Here is what I've got. It worked in SIP  4.8.
 
  class KEditListBox : QGroupBox
  {
  public:
   class CustomEditor
   {
   public:
   CustomEditor ();
   CustomEditor (QWidget* repWidget, KLineEdit* edit);
   CustomEditor (KComboBox* combo);
 
   private:
   CustomEditor (const KEditListBox::CustomEditor);
   };
  // ...
  };
 
 
  class KUrlRequester : KHBox
  {
  // ...
  public:
   explicit KUrlRequester (QWidget* parent /TransferThis/ = 0);
   explicit KUrlRequester (const KUrl url, QWidget* parent
  /TransferThis/ = 0);
   KUrlRequester (QWidget* editWidget, QWidget* parent /TransferThis/);
 
   const KEditListBox::CustomEditor  customEditor ();
  //  ^ This here fails.
  }
 
 
  /home/sbe/devel/kdesvninstall/include/keditlistbox.h: In function
  ‘PyObject* meth_KUrlRequester_customEditor(PyObject*, PyObject*)’:
  /home/sbe/devel/kdesvninstall/include/keditlistbox.h:77: error:
  ‘KEditListBox::CustomEditor::CustomEditor(const
  KEditListBox::CustomEditor)’ is private
  sipkiopart5.cpp:22797: error: within this context

 Try tonight's SIP snapshot. It's a problem with the new implicit copying of
 const reference results.


This morning I checkout out pykde revision 959021 and tried to build it
against kde-4.2.2 and the most recent SIP/PyQt4 snapshots. qhostinfo.h can
not be found during make, but the file is present on my system in both
/usr/include/qt4/QtNetwork/ and /usr/include/qt4/Qt/. Is it possible to
build pykde with the riverbank snapshots and kde-4.2.2? Could anyone please
advise?

Thanks,
Darren

$ make
make[1]: Entering directory `/usr/local/src/pykde4/kdecore'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/src/pykde4/kdecore'
make[1]: Entering directory `/usr/local/src/pykde4/solid'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/src/pykde4/solid'
make[1]: Entering directory `/usr/local/src/pykde4/kdeui'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/src/pykde4/kdeui'
make[1]: Entering directory `/usr/local/src/pykde4/kio'
g++ -c -Wno-deprecated-declarations -pipe -fPIC -O2 -march=k8 -mtune=k8
-pipe -Wall -W -D_REENTRANT -DNDEBUG -DQT_NO_DEBUG -DQT_CORE_LIB
-DQT_GUI_LIB -I. -I/usr/local/src/pykde4/extra/kde422 -I/usr/include
-I/usr/include/qt4 -I/usr/include/QtCore -I/usr/include/qt4/QtCore
-I/usr/include/QtGui -I/usr/include/qt4/QtGui -I/usr/include/QtXml
-I/usr/include/qt4/QtXml -I/usr/include/QtSvg -I/usr/include/qt4/QtSvg
-I/usr/include/solid -I/usr/include/qt4/solid -I/usr/include/kio
-I/usr/include/qt4/kio -I/usr/include/kfile -I/usr/include/qt4/kfile
-I/usr/include/kssl -I/usr/include/qt4/kssl -I/usr/include/python2.6
-I/usr/share/qt4/mkspecs/default -I/usr/X11R6/include -o sipkiopart0.o
sipkiopart0.cpp
In file included from
sipkiopart0.cpp:7:
sipAPIkio.h:6417:1: warning:
sipType_QList_27000600QPair_0100QString_0100QString redefined
sipAPIkio.h:5668:1: warning: this is the location of the previous
definition
sipAPIkio.h:6683:1: warning:
sipType_QList_27000600QPair_0100QString_0100QString redefined
sipAPIkio.h:6417:1: warning: this is the location of the previous
definition
sipAPIkio.h:6689:1: warning:
sipType_QList_27000600QPair_0100QByteArray_0100QByteArray
redefined

sipAPIkio.h:6415:1: warning: this is the location of the previous
definition
sipAPIkio.h:10427:1: warning:
sipType_QList_27000600QPair_0100QString_0100QString redefined
sipAPIkio.h:6683:1: warning: this is the location of the previous
definition
/usr/share/sip/PyQt4/QtNetwork/qhostinfo.sip:42:23: error: qhostinfo.h: No
such file or
directory

make[1]: *** [sipkiopart0.o] Error
1
make[1]: Leaving directory
`/usr/local/src/pykde4/kio'
make: *** [all] Error 2
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

2009-04-20 Thread Simon Edwards

Phil Thompson wrote:

On Sun, 19 Apr 2009 21:39:29 +0200, Simon Edwards si...@simonzone.com
wrote:

Phil Thompson wrote:

sipForceConvertTo_*() (and related functions) are internal and should

not

be used by handwritten code. If it isn't documented then you can't use
it.

Thanks that helps a lot.

Another question. 4.8 gives errors on PyKDE related it trying to use a 
copy constructor or operator=() on some classes which don't have one or 
have one which is private. It looks like SIP wants to use the copy 
constructor to copy a returned value from a method and then fails. Has 
anything changed? Have you got any tips about what I should be trying.


If a copy ctor is private then SIP should be told about it - see
qobject.sip.


The copy ctor is included and private like many others. This might be a 
namespace related issue. Here is what I've got. It worked in SIP  4.8.


class KEditListBox : QGroupBox
{
public:
class CustomEditor
{
public:
CustomEditor ();
CustomEditor (QWidget* repWidget, KLineEdit* edit);
CustomEditor (KComboBox* combo);

private:
CustomEditor (const KEditListBox::CustomEditor);
};
// ...
};


class KUrlRequester : KHBox
{
// ...
public:
explicit KUrlRequester (QWidget* parent /TransferThis/ = 0);
explicit KUrlRequester (const KUrl url, QWidget* parent 
/TransferThis/ = 0);

KUrlRequester (QWidget* editWidget, QWidget* parent /TransferThis/);

const KEditListBox::CustomEditor  customEditor ();
//  ^ This here fails.
}


/home/sbe/devel/kdesvninstall/include/keditlistbox.h: In function 
‘PyObject* meth_KUrlRequester_customEditor(PyObject*, PyObject*)’:
/home/sbe/devel/kdesvninstall/include/keditlistbox.h:77: error: 
‘KEditListBox::CustomEditor::CustomEditor(const 
KEditListBox::CustomEditor)’ is private

sipkiopart5.cpp:22797: error: within this context

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

2009-04-20 Thread Phil Thompson
On Mon, 20 Apr 2009 08:22:54 +0200, Simon Edwards si...@simonzone.com
wrote:
 Phil Thompson wrote:
 On Sun, 19 Apr 2009 21:39:29 +0200, Simon Edwards si...@simonzone.com
 wrote:
 Phil Thompson wrote:
 sipForceConvertTo_*() (and related functions) are internal and should
 not
 be used by handwritten code. If it isn't documented then you can't use
 it.
 Thanks that helps a lot.

 Another question. 4.8 gives errors on PyKDE related it trying to use a 
 copy constructor or operator=() on some classes which don't have one or

 have one which is private. It looks like SIP wants to use the copy 
 constructor to copy a returned value from a method and then fails. Has 
 anything changed? Have you got any tips about what I should be trying.
 
 If a copy ctor is private then SIP should be told about it - see
 qobject.sip.
 
 The copy ctor is included and private like many others. This might be a 
 namespace related issue. Here is what I've got. It worked in SIP  4.8.
 
 class KEditListBox : QGroupBox
 {
 public:
  class CustomEditor
  {
  public:
  CustomEditor ();
  CustomEditor (QWidget* repWidget, KLineEdit* edit);
  CustomEditor (KComboBox* combo);
 
  private:
  CustomEditor (const KEditListBox::CustomEditor);
  };
 // ...
 };
 
 
 class KUrlRequester : KHBox
 {
 // ...
 public:
  explicit KUrlRequester (QWidget* parent /TransferThis/ = 0);
  explicit KUrlRequester (const KUrl url, QWidget* parent 
 /TransferThis/ = 0);
  KUrlRequester (QWidget* editWidget, QWidget* parent /TransferThis/);
 
  const KEditListBox::CustomEditor  customEditor ();
 //  ^ This here fails.
 }
 
 
 /home/sbe/devel/kdesvninstall/include/keditlistbox.h: In function 
 ‘PyObject* meth_KUrlRequester_customEditor(PyObject*, PyObject*)’:
 /home/sbe/devel/kdesvninstall/include/keditlistbox.h:77: error: 
 ‘KEditListBox::CustomEditor::CustomEditor(const 
 KEditListBox::CustomEditor)’ is private
 sipkiopart5.cpp:22797: error: within this context

Try tonight's SIP snapshot. It's a problem with the new implicit copying of
const reference results.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

2009-04-19 Thread Simon Edwards

Hello Phil,

I'm working on getting PyKDE4 trunk working on SIP 4.8 and PyQt 4.5 and 
hit what looks like a fairly straight forward regression bug.


The compile error is:

/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip: 
In function ‘int convertTo_KSharedPtr_0200DNSSD_RemoteService(PyObject*, 
void**, int*, PyObject*)’:
/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip:247: 
error: ‘sipForceConvertTo_DNSSD’ was not declared in this scope 

/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip:247: 
error: expected ‘,’ or ‘;’ before ‘::’ token 



The offending C++ code is:

DNSSD::RemoteService *cpp = (DNSSD::RemoteService 
*)sipForceConvertTo_DNSSD::RemoteService (sipPy, iserr);


which was expanded from the mapped type:

---
template TYPE
%MappedType KSharedPtrTYPE
{
// ... etc etc ...

%ConvertToTypeCode
// Convert a Python instance to a Ptr on the heap.

if (sipIsErr == NULL)
return PyInstance_Check(sipPy);

int iserr = 0;
TYPE *cpp = (TYPE *)sipForceConvertTo_TYPE (sipPy, iserr);
// ... etc etc ...
---

elsewhere in the sip files I've got this which sets it all in motion:

typedef KSharedPtrDNSSD::RemoteService Ptr;

cheers,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

2009-04-19 Thread Phil Thompson
On Sun, 19 Apr 2009 10:25:11 +0200, Simon Edwards si...@simonzone.com
wrote:
 Hello Phil,
 
 I'm working on getting PyKDE4 trunk working on SIP 4.8 and PyQt 4.5 and 
 hit what looks like a fairly straight forward regression bug.
 
 The compile error is:
 

/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip:
 
 In function ‘int
convertTo_KSharedPtr_0200DNSSD_RemoteService(PyObject*, 
 void**, int*, PyObject*)’:

/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip:247:
 
 error: ‘sipForceConvertTo_DNSSD’ was not declared in this scope 
 

/home/sbe/devel/svn/kde/trunk/KDE/kdebindings/python/pykde4/sip/kdecore/typedefs.sip:247:
 
 error: expected ‘,’ or ‘;’ before ‘::’ token 
 
 
 The offending C++ code is:
 
  DNSSD::RemoteService *cpp = (DNSSD::RemoteService 
 *)sipForceConvertTo_DNSSD::RemoteService (sipPy, iserr);
 
 which was expanded from the mapped type:
 
 ---
 template TYPE
 %MappedType KSharedPtrTYPE
 {
 // ... etc etc ...
 
 %ConvertToTypeCode
  // Convert a Python instance to a Ptr on the heap.
 
  if (sipIsErr == NULL)
  return PyInstance_Check(sipPy);
 
  int iserr = 0;
  TYPE *cpp = (TYPE *)sipForceConvertTo_TYPE (sipPy, iserr);
 // ... etc etc ...
 ---
 
 elsewhere in the sip files I've got this which sets it all in motion:
 
  typedef KSharedPtrDNSSD::RemoteService Ptr;

sipForceConvertTo_*() (and related functions) are internal and should not
be used by handwritten code. If it isn't documented then you can't use it.

For SIP prior to v4.8 you should use sipForceConvertToInstance(). For v4.8
then sipForceConvertToType() is preferred (though the former will be
supported for all SIP v4.x versions). The advantage of the latter is that
it will automatically handle (for example) QString when it is implemented
as a wrapped class or a mapped type.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

2009-04-19 Thread Simon Edwards

Hi,

Phil Thompson wrote:

sipForceConvertTo_*() (and related functions) are internal and should not
be used by handwritten code. If it isn't documented then you can't use it.


Thanks that helps a lot.

Another question. 4.8 gives errors on PyKDE related it trying to use a 
copy constructor or operator=() on some classes which don't have one or 
have one which is private. It looks like SIP wants to use the copy 
constructor to copy a returned value from a method and then fails. Has 
anything changed? Have you got any tips about what I should be trying.


thanks,

--
Simon Edwards | KDE-NL, Guidance tools, Guarddog Firewall
si...@simonzone.com   | http://www.simonzone.com/software/
Nijmegen, The Netherlands | ZooTV? You made the right choice.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Regression in SIP sip-4.8-snapshot-20090409 wrt MappedTypes

2009-04-19 Thread Phil Thompson
On Sun, 19 Apr 2009 21:39:29 +0200, Simon Edwards si...@simonzone.com
wrote:
 Hi,
 
 Phil Thompson wrote:
 sipForceConvertTo_*() (and related functions) are internal and should
not
 be used by handwritten code. If it isn't documented then you can't use
 it.
 
 Thanks that helps a lot.
 
 Another question. 4.8 gives errors on PyKDE related it trying to use a 
 copy constructor or operator=() on some classes which don't have one or 
 have one which is private. It looks like SIP wants to use the copy 
 constructor to copy a returned value from a method and then fails. Has 
 anything changed? Have you got any tips about what I should be trying.

If a copy ctor is private then SIP should be told about it - see
qobject.sip.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt