Sateesh Kumar | 1 May 09:40 2011
Picon

Re: make failure on mac os x


On Thu, Apr 28, 2011 at 3:42 AM, David Cortesi <davecortesi <at> gmail.com> wrote:
I'm trying to install on Mac OS X 10.6.7 with the default python 2.6.
I installed SIP, its make and make-install seemed to run correctly.
I installed Qt 4.7.2 and ran its demos.
I downloaded PyQt-mac-gpl-4.8.3 and ran its make, which did a whole
bunch of compiles with no obvious errors. It got right to the end and
failed as shown below.
 
[...]

g++ -headerpad_max_install_names -single_module -dynamiclib -o
 
[...]
 
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [libpythonplugin.dylib] Error 1
make: *** [all] Error 2

I faced the same error while installing PyQt on Mac. Following the steps mentioned here :
helped me to do a successful install of PyQt Mac.
The post mentions that different options need to be passed for "--arch" swith while
running configure.py for SIP and PyQt.
 
HTH,
sateesh
<div>
<br><div class="gmail_quote">On Thu, Apr 28, 2011 at 3:42 AM, David Cortesi <span dir="ltr">&lt;<a href="mailto:davecortesi <at> gmail.com">davecortesi <at> gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote">I'm trying to install on Mac OS X 10.6.7 with the default python 2.6.<br>I installed SIP, its make and make-install seemed to run correctly.<br>
I installed Qt 4.7.2 and ran its demos.<br>I downloaded PyQt-mac-gpl-4.8.3 and ran its make, which did a whole<br>bunch of compiles with no obvious errors. It got right to the end and<br>failed as shown below.<br>
</blockquote>

<div>&nbsp;</div>
<blockquote class="gmail_quote">[...]<br><br>g++ -headerpad_max_install_names -single_module -dynamiclib -o</blockquote>
<div>&nbsp;</div>
<div>[...]</div>
<div>&nbsp;</div>
<blockquote class="gmail_quote">ld: symbol(s) not found<br>collect2: ld returned 1 exit status<br>make[1]: *** [libpythonplugin.dylib] Error 1<br>
make: *** [all] Error 2</blockquote>
<div>
<br>I faced the same error while installing PyQt on Mac. Following the steps mentioned here :</div>
<div><a href="https://bugs.launchpad.net/bzr-mac-installers/+bug/529987/comments/9">https://bugs.launchpad.net/bzr-mac-installers/+bug/529987/comments/9</a></div>
<div>helped me to do a successful install of PyQt Mac. </div>
<div>The post mentions&nbsp;that different options need to be passed for "--arch" swith while </div>
<div>running configure.py for SIP and PyQt.</div>
<div>&nbsp;</div>
<div>HTH,</div>
<div>sateesh</div>
</div>
</div>
detlev | 1 May 11:58 2011
Picon

ANN: New eric 5.2 snapshot released

Hi,

I'd like to inform all of you about the immediate availability of a new eric 
5.2 snapshot. It fixes a few bugs and adds these new features.

- added menu entry for the icon editor to the tray starter
- added capability to filter out unwanted items in the file browsers
  (s. config dialog, interface page)
- changed syntax check to report error position within the line
- added functionality to the VCS status dialogs to make them more
  general commit dialogs
- extended the Mercurial log browser to indicate closed branches
- changed the configuration dialog to remember the last show page name
- added configuration options for visible whitespace (as of QScintilla 2.5)
- added capability to configure the alpha channel for some colors
  (as of QScintilla 2.5)
- added support for new lexer properties (as of QScintilla 2.5)
- added support for access keys and drag & drop to the web browser
- added support for search schemes ("s:" or "search:") and "about:home" to
  the web browser
- added capability to the tasks viewer to ignore files based on a wildcard
  during a project tasks scan
- added an action to push a new named branch to the Mercurial plug-in
- added an interface to VirusTotal to the web browser
- changed algorithm to determine the debugger backend type to be used by
  analysing a first line starting with '#!'
- added support for the Matlab and Octave lexers for QScintilla >= 2.5.1
- enhanced the autocompletion of templates to observe the language of the
  current file
- added support for "hg rollback" to the Mercurial interface

It is available via 
http://sourceforge.net/projects/eric-ide/files/eric5/unstable/5.2-20110501

Regards
Detlev
--

-- 
Detlev Offenbach
detlev <at> die-offenbachs.de
detlev | 1 May 13:07 2011
Picon

ANN: New eric 4.5 snapshot released

Hi,

I'd like to inform all of you about the immediate availability of a new eric 
4.5 snapshot. It fixes a few bugs and adds these new features.

- added support for additional configurable file filters
- added display of suppressed client termination messages
- made the toolbars of the initial layout more minimalistic
- merged "Save to Project" into "Save" and "Save As...".
- added a diff context menu entry to the subversion status dialogs
- added functionality to restore missing files and directories to
  the subversion status dialogs
- added functionality to the subversion status dialogs to make them
  more generalized commit dialogs
- added the capability to filter on status to the subversion status dialogs
- changed syntax check to report error position within the line
- added capability to filter out unwanted items in the file browsers
  (s. config dialog, interface page)
- added configuration options for visible whitespace (as of QScintilla 2.5)
- added support for new lexer properties (as of QScintilla 2.5)
- enhanced error reporting in case the debugger backend cannot be started
- added support for the Matlab and Octave lexers for QScintilla >= 2.5.1
- enhanced the autocompletion of templates to observe the language of the
  current file

It is available via 
http://sourceforge.net/projects/eric-ide/files/eric4/unstable/4.5-20110501

Regards
Detlev
--

-- 
Detlev Offenbach
detlev <at> die-offenbachs.de
Gerard Brunick | 1 May 19:02 2011
Picon

QStyledItemDelegate.paint ignores styles?

If I override the paint method of QStyledItemDelegate and call the 
base case, then the base case seems to ignore styles.  I thought that 
the whole point of QStyledItemDelegate was that it handled styles 
correctly? PyQt4.QtCore.QT_VERSION_STR is '4.6.2' and 
PyQt4.QtCore.PYQT_VERSION_STR is '4.7.2'.  I'm also on Ubuntu 10.04.2 LTS.

A minimal example illustrating the problem follows.  If
override_paint == 0, then I see the styles, but if I set it to 1 or 2, 
the effects of the styles disappear.

######################################################################
# change this
override_paint = 0 # 0 or 1 or 2

import sys
from PyQt4 import QtCore, QtGui

class TestDelegate(QtGui.QStyledItemDelegate):
     if override_paint == 1:
         def paint(self, painter, option, index):
             QtGui.QStyledItemDelegate.paint(self, painter, option, index)

     if override_paint == 2:
         def paint(self, painter, option, index):
             super(TestDelegate, self ).paint(painter, option, index)

app = QtGui.QApplication(sys.argv)

# Make tableview
tableView = QtGui.QTableView()
tableView.setStyleSheet("""QTableView::item { padding: 10px;
                                               background-color: blue;
                                              }""")

# Make delegate
delegate = TestDelegate(tableView)
tableView.setItemDelegate(delegate)

# Make the model
model = QtGui.QStandardItemModel(4, 2)
for row in range(4):
     for column in range(2):
         index = model.index(row, column, QtCore.QModelIndex())
         model.setData(index, "\n".join(["(%i, %i)" % (row, column)]))
tableView.setModel(model)

tableView.show()
sys.exit(app.exec_())
#############################################################################

Is this a bug or am I missing something?  Thanks for any info.
Gerard
David Cortesi | 1 May 22:32 2011
Picon

Re: make failure on mac os x

On Sun, May 1, 2011 at 12:40 AM, Sateesh Kumar <sateeshpyper <at> gmail.com> wrote:

> I faced the same error while installing PyQt on Mac. Following the steps
> mentioned here :
> https://bugs.launchpad.net/bzr-mac-installers/+bug/529987/comments/9
> helped me to do a successful install of PyQt Mac.

This does eliminate the error trying to link the plugin. The --arch
arguments force universal binaries with support for both 32- and
64-bit apps, which is fine, however I do note during the configure of
PyQt the following appears:

> QtDesigner module disabled with universal binaries.

I wasn't planning to use QtDesigner anyway, so no big.

Dave Cortesi

BTW: running the full PyQt make with an epic number of g++ compiles on
a macbook pro? Runs the CPU temps up to full-fan and makes it quite
uncomfortable to have on one's lap!
Jack Cosgrove | 2 May 03:16 2011
Picon

Connect PyQt signal to C++ slot

I will describe the general task I am performing beforehand as there may
be better way to do it than I am currently trying.

I am making a Python editor and console using Qt. This includes a
QScintilla editor and a QTextEdit for terminal output. I want to "pipe"
stdout and stderr from the Python interpreter to the terminal as the
Python program is executed by the interpreter.

I currently run the program using the Py_Initialize(),
PyRun_SimpleString(), Py_Finalize() paradigm. I am able to print stdout
and stderr to the console after the Python program has finished by
assigning a Python class to sys.stdout and sys.stderr which has a string
member that is later extracted using PyObject_GetAttrString after the
Python program finishes. This is done using PyRun_SimpleString() and a
bit of hard-coded Python in the C++ class invoking the Python
interpreter.

However I want output from the program to be appended to the terminal as
it is printed to stdout and stderr, not at the end of the program. My
idea for this was to make the Python class assigned to sys.stdout and
sys.stderr inherit from QObject, and emit a signal whenever output
occurs. I can emit this signal when output occurs with a QString
containing the message as an argument, but I don't know how to connect
the PyQt signal to a C++ slot from within the C++ class that is invoking
the Python interpreter.

Is this even possible? And if so, what functions (I suspect in sip.h)
should I use? It looks like I would use sipConvertFromNewType to wrap
the class with the slot with a PyObject, and then sipConnectRx to
connect the signal to the slot that appends to the terminal.

Thank you.

Phil Thompson | 2 May 09:58 2011

Re: Connect PyQt signal to C++ slot

On Sun, 01 May 2011 20:16:53 -0500, Jack Cosgrove <jackcosgrove <at> gmail.com>
wrote:
> I will describe the general task I am performing beforehand as there may
> be better way to do it than I am currently trying.
> 
> I am making a Python editor and console using Qt. This includes a
> QScintilla editor and a QTextEdit for terminal output. I want to "pipe"
> stdout and stderr from the Python interpreter to the terminal as the
> Python program is executed by the interpreter.
> 
> I currently run the program using the Py_Initialize(),
> PyRun_SimpleString(), Py_Finalize() paradigm. I am able to print stdout
> and stderr to the console after the Python program has finished by
> assigning a Python class to sys.stdout and sys.stderr which has a string
> member that is later extracted using PyObject_GetAttrString after the
> Python program finishes. This is done using PyRun_SimpleString() and a
> bit of hard-coded Python in the C++ class invoking the Python
> interpreter.
> 
> However I want output from the program to be appended to the terminal as
> it is printed to stdout and stderr, not at the end of the program. My
> idea for this was to make the Python class assigned to sys.stdout and
> sys.stderr inherit from QObject, and emit a signal whenever output
> occurs. I can emit this signal when output occurs with a QString
> containing the message as an argument, but I don't know how to connect
> the PyQt signal to a C++ slot from within the C++ class that is invoking
> the Python interpreter.
> 
> Is this even possible? And if so, what functions (I suspect in sip.h)
> should I use? It looks like I would use sipConvertFromNewType to wrap
> the class with the slot with a PyObject, and then sipConnectRx to
> connect the signal to the slot that appends to the terminal.

Do it like you would call any Python method from C++. Get hold of the
signal's connect method using appropriate PyObject_GetAttr calls and call
one of the PyObject_Call functions.

Phil
Johanna | 2 May 11:53 2011
Picon

nmake fatal error while compiling SIP - voidptr.c: error C2039

Hello,

I am trying to compile SIP since a few days in order to install PyQt.
I can't find lead on the web so I thought I'd better ask for help here.

I unzipped the latest sip archive (4.12.1)and run the configure command.
Then when I tried to run nmake it gives me the following error :

.\voidptr.c(513) : error C2039: 'obj' : is not a member of 'bufferinfo'
D:\ProgramFiles\Python26\include\object.h(164) : see declaration of 'bufferinfo'
Generating Code...
NMAKE : fatal error U1077: '"D:\ProgramFiles\Microsoft Visual Studio 9.0\VC\bin\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\ProgramFiles\Microsoft Visual Studio 9.0\VC\bin\nmake.exe"' : return code '0x2'
Stop.

The declaration of bufferinfo in object.h is the following :

typedef struct bufferinfo {
    void *buf;        
        Py_ssize_t len;
        Py_ssize_t itemsize;  /* This is Py_ssize_t so it can be
                                 pointed to by strides in simple case.*/
        int readonly;
        int ndim;
        char *format;
        Py_ssize_t *shape;
        Py_ssize_t *strides;
        Py_ssize_t *suboffsets;
        void *internal;
} Py_buffer;

And the code at line 513 of voidptr.c is :

PyErr_Format(PyExc_TypeError, "'%s' must have an item size of 1",
                Py_TYPE(value_view.obj)->tp_name);

I am on windows XP 64bits, with Python 2.6 and visual studio 2008 (I run the commands from visual studio
command prompt).

Thank you for you consideration.

Johanna

<div><p>Hello,<br><br>I am trying to compile SIP since a few days in order to install PyQt.<br>I can't find lead on the web so I thought I'd better ask for help here.<br><br>I unzipped the latest sip archive (4.12.1)and run the configure command. <br>
Then when I tried to run nmake it gives me the following error : <br><br>.\voidptr.c(513) : error C2039: 'obj' : is not a member of 'bufferinfo'<br>D:\ProgramFiles\Python26\include\object.h(164) : see declaration of 'bufferinfo'<br>
Generating Code...<br>NMAKE : fatal error U1077: '"D:\ProgramFiles\Microsoft Visual Studio 9.0\VC\bin\cl.EXE"' : return code '0x2'<br>Stop.<br>NMAKE : fatal error U1077: '"D:\ProgramFiles\Microsoft Visual Studio 9.0\VC\bin\nmake.exe"' : return code '0x2'<br>
Stop.<br><br>The declaration of bufferinfo in object.h is the following : <br><br>typedef struct bufferinfo {<br>&nbsp;&nbsp;&nbsp; void *buf;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Py_ssize_t len;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Py_ssize_t itemsize;&nbsp; /* This is Py_ssize_t so it can be <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pointed to by strides in simple case.*/<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int readonly;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int ndim;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char *format;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Py_ssize_t *shape;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Py_ssize_t *strides;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Py_ssize_t *suboffsets;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void *internal;<br>} Py_buffer;<br><br>And the code at line 513 of voidptr.c is :<br><br>PyErr_Format(PyExc_TypeError, "'%s' must have an item size of 1",<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Py_TYPE(value_view.obj)-&gt;tp_name);<br><br>I am on windows XP 64bits, with Python 2.6 and visual studio 2008 (I run the commands from visual studio <br>command prompt).<br><br>Thank you for you consideration.<br><br>Johanna<br></p></div>
Brad Ralph | 2 May 12:39 2011
Picon

How do I subclass QTextEdit without warnings on close?

Hello,

I am trying to subclass QTextEdit to implement a foucsOutEvent.  I must be 
doing something wrong however because when I replace the standard QTextEdit 
with my subclass I get the following error mesages when I close the program.  
(once for each instance of my subclass). I don't when a reqular QTextEdit is 
used.

Application asked to unregister timer 0x6000001 which is not registered in 
this thread. Fix application.
Application asked to unregister timer 0x3d000002 which is not registered in 
this thread. Fix application.

I running on Fedora 14 and my versions numbers are:
Python: 2.7
Qt: 4.7.2
PyQt: 4.8.3
sip: 4.12.1

Can anyone tell me what I'm doing wrong?

Below is a simple program to demonstrate my error:

########################################

#!/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt4 import QtCore, QtGui

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    _fromUtf8 = lambda s: s

class MyQTextEdit(QtGui.QTextEdit):
    textEdited = QtCore.pyqtSignal('QString')

    def __init__(self, *args):
        QtGui.QTextEdit.__init__(self, *args)

    def  focusOutEvent(self, e):
        val = self.toHtml()
        self.textEdited.emit(val)

class frmTest(QtGui.QMainWindow):
    def __init__(self, app, *args):
        QtGui.QMainWindow.__init__(self, *args)
        self.app = app
        self.mainWidget = QtGui.QFrame()
        self.setCentralWidget(self.mainWidget)
        self.fmeLayout = QtGui.QVBoxLayout(self.mainWidget)
        self.teDesc1 = MyQTextEdit(self.mainWidget)
        self.teDesc1.setObjectName(_fromUtf8("teDesc1"))
        self.fmeLayout.addWidget(self.teDesc1)
        self.teDesc2 = MyQTextEdit(self.mainWidget)
        self.teDesc2.setObjectName(_fromUtf8("teDesc1"))
        self.fmeLayout.addWidget(self.teDesc2)

if "__main__"==__name__:
    qapp = QtGui.QApplication(sys.argv)
    view = frmTest(qapp)
    view.show()
    qapp.exec_()

#####################################

Regards,
Brad Ralph
Phil Thompson | 2 May 12:48 2011

Re: nmake fatal error while compiling SIP - voidptr.c: error C2039

On Mon, 2 May 2011 11:53:14 +0200, Johanna <johanna.royer <at> gmail.com>
wrote:
> Hello,
> 
> I am trying to compile SIP since a few days in order to install PyQt.
> I can't find lead on the web so I thought I'd better ask for help here.
> 
> I unzipped the latest sip archive (4.12.1)and run the configure command.
> Then when I tried to run nmake it gives me the following error :
> 
> .\voidptr.c(513) : error C2039: 'obj' : is not a member of 'bufferinfo'
> D:\ProgramFiles\Python26\include\object.h(164) : see declaration of
> 'bufferinfo'
> Generating Code...
> NMAKE : fatal error U1077: '"D:\ProgramFiles\Microsoft Visual Studio
> 9.0\VC\bin\cl.EXE"' : return code '0x2'
> Stop.
> NMAKE : fatal error U1077: '"D:\ProgramFiles\Microsoft Visual Studio
> 9.0\VC\bin\nmake.exe"' : return code '0x2'
> Stop.
> 
> The declaration of bufferinfo in object.h is the following :
> 
> typedef struct bufferinfo {
>     void *buf;
>         Py_ssize_t len;
>         Py_ssize_t itemsize;  /* This is Py_ssize_t so it can be
>                                  pointed to by strides in simple case.*/
>         int readonly;
>         int ndim;
>         char *format;
>         Py_ssize_t *shape;
>         Py_ssize_t *strides;
>         Py_ssize_t *suboffsets;
>         void *internal;
> } Py_buffer;

That's not the declaration from Python v2.6.

> And the code at line 513 of voidptr.c is :
> 
> PyErr_Format(PyExc_TypeError, "'%s' must have an item size of 1",
>                 Py_TYPE(value_view.obj)->tp_name);
> 
> I am on windows XP 64bits, with Python 2.6 and visual studio 2008 (I run
> the
> commands from visual studio
> command prompt).
> 
> Thank you for you consideration.
> 
> Johanna

Maybe you are using a 2.6 beta?

Phil

Gmane