[PyQt] [pyqt]how to reimplement qvalidator.validate() in api v2?

2013-07-29 Thread Han Jiang
The code works fine in api v1, if i uncomment the top sip calls, then it
means i'll be using v2, then of course i'll see errors like

TypeError: invalid result type from Validator.validate()

i know i need to change the return value of .validate() , but if i change
it to what pyqt doc says in v2 ,
http://pyqt.sourceforge.net/Docs/PyQt4/qvalidator.html#validate-2 ,it gives
me segmentation fault ( on pyqt 4.6.1, centos 6.3 x64). why?

v2 code works fine on pyqt 4.8 and 4.10 though ( tested on a fedora 19
linux and a windows 7 machine.) is this a bug or what am i missing ?

thanks !

http://pastebin.com/dDeZ52gZ



#!/usr/bin/env python2

# api v2
import sip
sip.setapi('QString', 2)
sip.setapi('QVariant', 2)

from PyQt4.QtGui import *
from PyQt4.QtCore import *
import re,os,sys

class MyQComboBox(QComboBox):
def __init__(self, parent=None, listing=None):
super(MyQComboBox, self).__init__(parent)

if listing != None:
self.listSetup(listing)

def listSetup(self, listing):
self.setEditable(True)
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] No matrix in QGraphicsView

2013-07-29 Thread Vincent Vande Vyvre

Le 29/07/2013 14:07, Phil Thompson a écrit :

On Mon, 29 Jul 2013 13:22:15 +0200, Vincent Vande Vyvre
 wrote:

Hi,

Python 3.2.3 (default, Apr 10 2013, 06:11:55)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
  >>> from PyQt5.QtWidgets import QGraphicsView as gv
  >>> m = gv.matrix()
Traceback (most recent call last):
File "", line 1, in 
AttributeError: type object 'QGraphicsView' has no attribute 'matrix'


PyQt-5.0 on Ubuntu 12.04

http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html#qmatrix

Phil


Ok, ... I was into the c++ documentation.

Thanks

--
Vincent V.V.
Oqapy  . Qarte 
 . PaQager 

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

[PyQt] PyQt5 segfault when closing a QMainWindow

2013-07-29 Thread Roger Leigh
Hi,

I've just started experimenting with Python 3.3/Qt 5.1/PyQt 5.0 on
Debian (unstable, amd64).

With the following trivial program, I can reproducibly observe a
segfault when the window is closed:

--
#!/usr/bin/python3

from PyQt5.QtWidgets import (QApplication, QMainWindow)

if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
w = QMainWindow()
w.show()
sys.exit(app.exec())
--

==> segfault when the window close button is pressed (i.e. from the
window manager, kdm in this case)
This occurs about 1 time in 10 on my system.  From the backtrace,
it looks like it's thread-related, or at least occuring in a
thread, but I'm afraid I've not been able to get more details
other than what's below.  I'll be happy to investigate in more
detail if you could give me some hints on what to look at.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffef9b4700 (LWP 7751)]
0x71948b79 in QXcbEventReader::run (this=0xc92930) at 
qxcbconnection.cpp:983
983 qxcbconnection.cpp: No such file or directory.
(gdb) bt
#0  0x71948b79 in QXcbEventReader::run (this=0xc92930) at 
qxcbconnection.cpp:983
#1  0x74f0d6b0 in QThreadPrivate::start (arg=0xc92930) at 
thread/qthread_unix.cpp:339
#2  0x77bc6e0e in start_thread (arg=0x7fffef9b4700) at 
pthread_create.c:311
#3  0x76dc493d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffef9b4700 (LWP 8090)]
0x71948b79 in ?? ()
(gdb) bt
#0  0x71948b79 in ?? ()
#1  0x00c92b40 in ?? ()
#2  0x7fffef9b3eb0 in ?? ()
#3  0x00c92df0 in ?? ()
#4  0x74f0d6b0 in QThreadPrivate::start (arg=0xc92b40) at 
thread/qthread_unix.cpp:339
#5  0x77bc6e0e in start_thread (arg=0x7fffef9b4700) at 
pthread_create.c:311
#6  0x76dc493d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffef9b4700 (LWP 8119)]
0x71948b79 in QXcbEventReader::run (this=0xc92af0) at 
qxcbconnection.cpp:983
983 qxcbconnection.cpp: No such file or directory.
(gdb) bt
#0  0x71948b79 in QXcbEventReader::run (this=0xc92af0) at 
qxcbconnection.cpp:983
#1  0x74f0d6b0 in QThreadPrivate::start (arg=0xc92af0) at 
thread/qthread_unix.cpp:339
#2  0x77bc6e0e in start_thread (arg=0x7fffef9b4700) at 
pthread_create.c:311
#3  0x76dc493d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:113

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffef9b4700 (LWP 8132)]
0x71948b79 in ?? ()
(gdb) bt
#0  0x71948b79 in ?? ()
#1  0x00c92b90 in ?? ()
#2  0x7fffef9b3eb0 in ?? ()
#3  0x00c92e40 in ?? ()
#4  0x74f0d6b0 in QThreadPrivate::start (arg=0xc92b90) at 
thread/qthread_unix.cpp:339
#5  0x77bc6e0e in start_thread (arg=0x7fffef9b4700) at 
pthread_create.c:311
#6  0x76dc493d in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:113

I've tried to reproduce this with plain C++ and Qt using the following
program identical to the python version.  However, I've not as yet
been able to observe a segfault.

--
#include 
#include 
#include 

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMainWindow w;
w.show();
return a.exec();
}
--


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?   http://gutenprint.sourceforge.net/
   `-GPG Public Key: 0x25BFB848   Please GPG sign your mail.


signature.asc
Description: Digital signature
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Using SIP wrappers for extension modules in python IDEs

2013-07-29 Thread Kenneth Miller
I thought that it would be good for me to alert the good folks at pyqt, but 
better that I should post my question somewhere so that if it gets revised or 
something I can make sure that all see the changes. Please see my SIP related 
question:

http://stackoverflow.com/questions/17936075/how-to-make-functions-in-python-extension-module-visible-to-emacs


Thanks so much in advance!___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt