[PyQt] Next Releases

2009-05-26 Thread Phil Thompson
I plan to release new versions of SIP, PyQt3, PyQt4 and QScintilla at the
end of the week based on the current snapshots.

If there is something you think is missing or broken then now would be a
good time to remind me.

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


[PyQt] Crash in TableView cell edit

2009-05-26 Thread Alexandr N Zamaraev

[code=python]
from PyQt4 import QtCore, QtGui

class EditorFactory(QtGui.QItemEditorFactory):
  pass

def createTv():
  tv = QtGui.QTableView()
  model = QtGui.QStandardItemModel(4, 2, tv)
  tv.setModel(model)

  delegate = QtGui.QStyledItemDelegate(tv)
  delegate.setItemEditorFactory(EditorFactory())
  tv.setItemDelegate(delegate)

  for row in range(4):
for column in range(2):
  index = model.index(row, column, QtCore.QModelIndex())
  model.setData(index, QtCore.QVariant((row+1) * (column+1)))
  return tv

if __name__ == '__main__':
  import sys
  app = QtGui.QApplication(sys.argv)
  tableView = createTv()
  tableView.show()
  sys.exit(app.exec_())
[/code]
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Do not avto convert python date to QVariant

2009-05-26 Thread Alexandr N Zamaraev

[code]
from PyQt4 import QtCore
import datetime

def show(d, QtType):
  print 'pytype:', d
  v = QtCore.QVariant(d)
  print 'from variant:', str(QtCore.QVariant(d).toString())
  print 'from qttype:', str(QtCore.QVariant(QtType(d)).toString())

show(datetime.date.today(), QtCore.QDate)
print
show(datetime.datetime.today(), QtCore.QDateTime)
print
show(datetime.datetime.today().time(), QtCore.QTime)
[/code]
In PyQt 4.4.4 all converts.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Next Releases

2009-05-26 Thread projetmbc

Hello,
I would like to know if the patch of Eric Software which allows to use 
pygments with QScintilla will be with this new release.


Best regards.
Christophe



Phil Thompson a écrit :

I plan to release new versions of SIP, PyQt3, PyQt4 and QScintilla at the
end of the week based on the current snapshots.

If there is something you think is missing or broken then now would be a
good time to remind me.

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



  



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


[PyQt] Re: Crash in TableView cell edit

2009-05-26 Thread Alberto Berti

You have to keep your editor factory alive outside the scope of the
createTv() method

from PyQt4 import QtCore, QtGui

class EditorFactory(QtGui.QItemEditorFactory):
pass

def createTv():
  tv = QtGui.QTableView()
  model = QtGui.QStandardItemModel(4, 2, tv)
  tv.setModel(model)

  delegate = QtGui.QStyledItemDelegate(tv)
  edfactory = EditorFactory()
  delegate.setItemEditorFactory(edfactory)
  tv.setItemDelegate(delegate)

  for row in range(4):
for column in range(2):
  index = model.index(row, column, QtCore.QModelIndex())
  model.setData(index, QtCore.QVariant((row+1) * (column+1)))
  return edfactory, tv

if __name__ == '__main__':
  import sys
  app = QtGui.QApplication(sys.argv)
  edfactory, tableView = createTv()
  tableView.show()
  sys.exit(app.exec_())

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


Re: [PyQt] Crash in TableView cell edit

2009-05-26 Thread Phil Thompson
On Tue, 26 May 2009 16:33:51 +0700, Alexandr N Zamaraev to...@promsoft.ru
wrote:
 [code=python]
 from PyQt4 import QtCore, QtGui
 
 class EditorFactory(QtGui.QItemEditorFactory):
pass
 
 def createTv():
tv = QtGui.QTableView()
model = QtGui.QStandardItemModel(4, 2, tv)
tv.setModel(model)
 
delegate = QtGui.QStyledItemDelegate(tv)
delegate.setItemEditorFactory(EditorFactory())
tv.setItemDelegate(delegate)
 
for row in range(4):
  for column in range(2):
index = model.index(row, column, QtCore.QModelIndex())
model.setData(index, QtCore.QVariant((row+1) * (column+1)))
return tv
 
 if __name__ == '__main__':
import sys
app = QtGui.QApplication(sys.argv)
tableView = createTv()
tableView.show()
sys.exit(app.exec_())
 [/code]

You aren't keeping references to your delegate or editor factory.

I'll change it so the reference is kept automatically.

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


Re: [PyQt] Next Releases

2009-05-26 Thread Phil Thompson
On Tue, 26 May 2009 11:48:52 +0200, projetmbc projet...@club-internet.fr
wrote:
 Hello,
 I would like to know if the patch of Eric Software which allows to use 
 pygments with QScintilla will be with this new release.

Yes.

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


Re: [PyQt] Next Releases

2009-05-26 Thread projetmbc
That's very cool. I hope that there will be a simple example showing how 
to use it.


Christophe.


Phil Thompson a écrit :

On Tue, 26 May 2009 11:48:52 +0200, projetmbc projet...@club-internet.fr
wrote:
  

Hello,
I would like to know if the patch of Eric Software which allows to use 
pygments with QScintilla will be with this new release.



Yes.

Phil


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


Re: [PyQt] Do not avto convert python date to QVariant

2009-05-26 Thread Phil Thompson
On Tue, 26 May 2009 16:49:10 +0700, Alexandr N Zamaraev to...@promsoft.ru
wrote:
 [code]
 from PyQt4 import QtCore
 import datetime
 
 def show(d, QtType):
print 'pytype:', d
v = QtCore.QVariant(d)
print 'from variant:', str(QtCore.QVariant(d).toString())
print 'from qttype:', str(QtCore.QVariant(QtType(d)).toString())
 
 show(datetime.date.today(), QtCore.QDate)
 print
 show(datetime.datetime.today(), QtCore.QDateTime)
 print
 show(datetime.datetime.today().time(), QtCore.QTime)
 [/code]
 In PyQt 4.4.4 all converts.

This is a deliberate change. It is documented - but I'll expand the
documentation to mention the datetime types explicitly. Use toPyObject() to
get the Python datetime instances back.

If you want the old behaviour then convert the Python types to their Qt
equivalents before converting to QVariant - and that will work Ok with
earlier versions as well.

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


[PyQt] Storing a QFlags in a QSettings

2009-05-26 Thread Jerome Vuarand
Hi,

I'm currently trying to modify an existing PyQt app so that it stores
the windowState of its main window when it exits. The information is
retrieved with the QWidget::windowState method, and restored with the
QWidget::setWindowState method. The state itself it an object of type
WindowStates, which is a QFlags.

When trying to save it with QSettings::setValue, I get the following
errors. When I try:

settings.setValue(windowstate, self.windowState())

I get:

TypeError: argument 2 of QSettings.setValue() has an invalid type

When I try:

settings.setValue(windowstate, QtCore.QVariant(self.windowState()))

I get:

QVariant::save: unable to save type 262.

Finally I realized there is a __int__ method in the WindowStates
object, which I guess is mapped to the C++ operator int method.
However, while I can save that value, I cannot rebuild the
WindowStates object from an int. There is no constructor taking an int
as parameter in QFlags.

So what is the correct way to save and restore a windowState ?

Note that I'm a noob at both Qt and Python.

Jérôme.

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


Re: [PyQt] Storing a QFlags in a QSettings

2009-05-26 Thread Phil Thompson
On Tue, 26 May 2009 15:29:11 +0200, Jerome Vuarand
jerome.vuar...@gmail.com wrote:
 Hi,
 
 I'm currently trying to modify an existing PyQt app so that it stores
 the windowState of its main window when it exits. The information is
 retrieved with the QWidget::windowState method, and restored with the
 QWidget::setWindowState method. The state itself it an object of type
 WindowStates, which is a QFlags.
 
 When trying to save it with QSettings::setValue, I get the following
 errors. When I try:
 
 settings.setValue(windowstate, self.windowState())
 
 I get:
 
 TypeError: argument 2 of QSettings.setValue() has an invalid type
 
 When I try:
 
 settings.setValue(windowstate, QtCore.QVariant(self.windowState()))
 
 I get:
 
 QVariant::save: unable to save type 262.
 
 Finally I realized there is a __int__ method in the WindowStates
 object, which I guess is mapped to the C++ operator int method.
 However, while I can save that value, I cannot rebuild the
 WindowStates object from an int. There is no constructor taking an int
 as parameter in QFlags.
 
 So what is the correct way to save and restore a windowState ?
 
 Note that I'm a noob at both Qt and Python.

Good question - I'll add a QFlags(int) ctor.

In the meantime I think you will need to convert each bit to the
corresponding enum and or with an initially empty QFlags().

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


[PyQt] QTableView - insert e.g. another view in a cell?? Is that possible??

2009-05-26 Thread Danny Schneider
Hi folks,

it's my first mail here, because I'm on searching the internet the last 2days 
for that problem...

Is there any possibility to put another widget or another view into a cell of a 
QTableView?

My data sets for showing in the GUI should assigned to 2 columns, where the 
first column is a kind of identifier and in the second column should appear the 
detailed data.
This data must be editable separately, thats the point why i want to use a 
second view in the QTableView cells. 

I thought to a QListView. The both things alone are no problem, but I don't 
know how to put the second view into the QTableView...

Can anyone can give me an advice or any hints how to solve that problem???

Thanx so far...

Kind regards

Danny 

Neu: WEB.DE FreeDSL Komplettanschluss mit DSL 6.000 Flatrate und
Telefonanschluss für 17,95 Euro/mtl.!* http://produkte.web.de/go/02/



smime.p7s
Description: S/MIME Cryptographic Signature
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Next Releases

2009-05-26 Thread Detlev Offenbach
Hi,

the simple example is eric. ;-)

Detlev

On Dienstag, 26. Mai 2009, projetmbc wrote:
 That's very cool. I hope that there will be a simple example showing how
 to use it.

 Christophe.

 Phil Thompson a écrit :
  On Tue, 26 May 2009 11:48:52 +0200, projetmbc
  projet...@club-internet.fr
 
  wrote:
  Hello,
  I would like to know if the patch of Eric Software which allows to use
  pygments with QScintilla will be with this new release.
 
  Yes.
 
  Phil

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



-- 
Detlev Offenbach
det...@die-offenbachs.de

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


Re: [PyQt] Next Releases

2009-05-26 Thread Detlev Offenbach
On Dienstag, 26. Mai 2009, Phil Thompson wrote:
 I plan to release new versions of SIP, PyQt3, PyQt4 and QScintilla at the
 end of the week based on the current snapshots.

 If there is something you think is missing or broken then now would be a
 good time to remind me.

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

Is there a way to test, if Qt and/or PyQt were built with SSL support. Overe 
here I get strange errors on a Win system. My QSsl... imports work fine (i.e. 
no ImportError is raised). However, executing this code 

from PyQt4.QtNetwork import QSslConfiguration.
sslCfg = QSslConfiguration.defaultConfiguration()
caList = sslCfg.caCertificates()
print len(caList)

prints '0' to the console, while it prints '81' on my Linux box. This makes me 
assume, that Qt on win is not compiled with SSL support by default (I used 
the standard win installer for Qt 4.5.1 from Nokia).

If there is no programmatic way to do this, would it be possible to add a 
method to QSslConfiguration (e.g. isAvailable()) that tells, if SSL support 
is available. I think this could be done with some handwritten code using 
something like this.

QSslConfiguration::isAvailable() {
#ifndef QT_NO_OPENSSL
  return true;
#else
  return false;
#endif

Regards,
Detlev
-- 
Detlev Offenbach
det...@die-offenbachs.de
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Next Releases

2009-05-26 Thread Phil Thompson
On Tue, 26 May 2009 18:39:20 +0200, Detlev Offenbach
det...@die-offenbachs.de wrote:
 On Dienstag, 26. Mai 2009, Phil Thompson wrote:
 I plan to release new versions of SIP, PyQt3, PyQt4 and QScintilla at
the
 end of the week based on the current snapshots.

 If there is something you think is missing or broken then now would be a
 good time to remind me.

 Phil
 ___
 PyQt mailing listPyQt@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt
 
 Is there a way to test, if Qt and/or PyQt were built with SSL support.
 Overe 
 here I get strange errors on a Win system. My QSsl... imports work fine
 (i.e. 
 no ImportError is raised). However, executing this code 
 
   from PyQt4.QtNetwork import QSslConfiguration.
 sslCfg = QSslConfiguration.defaultConfiguration()
 caList = sslCfg.caCertificates()
   print len(caList)
 
 prints '0' to the console, while it prints '81' on my Linux box. This
makes
 me 
 assume, that Qt on win is not compiled with SSL support by default (I
used 
 the standard win installer for Qt 4.5.1 from Nokia).
 
 If there is no programmatic way to do this, would it be possible to add a

 method to QSslConfiguration (e.g. isAvailable()) that tells, if SSL
support
 
 is available. I think this could be done with some handwritten code using

 something like this.
 
 QSslConfiguration::isAvailable() {
 #ifndef QT_NO_OPENSSL
   return true;
 #else
   return false;
 #endif

The imports would fail if there was no SSL support. It just looks like the
certificate database is empty.

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


Re: [PyQt] Next Releases

2009-05-26 Thread Detlev Offenbach
On Dienstag, 26. Mai 2009, Phil Thompson wrote:
 On Tue, 26 May 2009 18:39:20 +0200, Detlev Offenbach

 det...@die-offenbachs.de wrote:
  On Dienstag, 26. Mai 2009, Phil Thompson wrote:
  I plan to release new versions of SIP, PyQt3, PyQt4 and QScintilla at

 the

  end of the week based on the current snapshots.
 
  If there is something you think is missing or broken then now would be a
  good time to remind me.
 
  Phil
  ___
  PyQt mailing listPyQt@riverbankcomputing.com
  http://www.riverbankcomputing.com/mailman/listinfo/pyqt
 
  Is there a way to test, if Qt and/or PyQt were built with SSL support.
  Overe
  here I get strange errors on a Win system. My QSsl... imports work fine
  (i.e.
  no ImportError is raised). However, executing this code
 
  from PyQt4.QtNetwork import QSslConfiguration.
  sslCfg = QSslConfiguration.defaultConfiguration()
  caList = sslCfg.caCertificates()
  print len(caList)
 
  prints '0' to the console, while it prints '81' on my Linux box. This

 makes

  me
  assume, that Qt on win is not compiled with SSL support by default (I

 used

  the standard win installer for Qt 4.5.1 from Nokia).
 
  If there is no programmatic way to do this, would it be possible to add a
 
  method to QSslConfiguration (e.g. isAvailable()) that tells, if SSL

 support

  is available. I think this could be done with some handwritten code using
 
  something like this.
 
  QSslConfiguration::isAvailable() {
  #ifndef QT_NO_OPENSSL
return true;
  #else
return false;
  #endif

 The imports would fail if there was no SSL support. It just looks like the
 certificate database is empty.

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

I thought so as well. However, trying to connect to a site via https results 
in a bunch of error messages from Qt printed in the console.


QSslSocket: cannot call unresolved function SSLv3_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function ERR_error_string
QSslSocket: cannot call unresolved function SSLv3_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function ERR_error_string
QSslSocket: cannot call unresolved function SSLv3_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function ERR_error_string
QSslSocket: cannot call unresolved function SSLv3_client_method
QSslSocket: cannot call unresolved function SSL_CTX_new
QSslSocket: cannot call unresolved function SSL_library_init
QSslSocket: cannot call unresolved function ERR_get_error
QSslSocket: cannot call unresolved function ERR_error_string

and the result is an error page being displayed in QWebView telling me, that 
the URL could not be loaded (Reason: HTTP request failed).

All this made me believe, that SSL support is not there.

Regards,
Detlev
-- 
Detlev Offenbach
det...@die-offenbachs.de
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Next Releases

2009-05-26 Thread Phil Thompson
On Tue, 26 May 2009 19:02:21 +0200, Detlev Offenbach
det...@die-offenbachs.de wrote:
 On Dienstag, 26. Mai 2009, Phil Thompson wrote:
 On Tue, 26 May 2009 18:39:20 +0200, Detlev Offenbach

 det...@die-offenbachs.de wrote:
  On Dienstag, 26. Mai 2009, Phil Thompson wrote:
  I plan to release new versions of SIP, PyQt3, PyQt4 and QScintilla at

 the

  end of the week based on the current snapshots.
 
  If there is something you think is missing or broken then now would
be
  a
  good time to remind me.
 
  Phil
  ___
  PyQt mailing listPyQt@riverbankcomputing.com
  http://www.riverbankcomputing.com/mailman/listinfo/pyqt
 
  Is there a way to test, if Qt and/or PyQt were built with SSL support.
  Overe
  here I get strange errors on a Win system. My QSsl... imports work
fine
  (i.e.
  no ImportError is raised). However, executing this code
 
 from PyQt4.QtNetwork import QSslConfiguration.
  sslCfg = QSslConfiguration.defaultConfiguration()
  caList = sslCfg.caCertificates()
 print len(caList)
 
  prints '0' to the console, while it prints '81' on my Linux box. This

 makes

  me
  assume, that Qt on win is not compiled with SSL support by default (I

 used

  the standard win installer for Qt 4.5.1 from Nokia).
 
  If there is no programmatic way to do this, would it be possible to
add
  a
 
  method to QSslConfiguration (e.g. isAvailable()) that tells, if SSL

 support

  is available. I think this could be done with some handwritten code
  using
 
  something like this.
 
  QSslConfiguration::isAvailable() {
  #ifndef QT_NO_OPENSSL
return true;
  #else
return false;
  #endif

 The imports would fail if there was no SSL support. It just looks like
 the
 certificate database is empty.

 Phil
 ___
 PyQt mailing listPyQt@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt
 
 I thought so as well. However, trying to connect to a site via https
 results 
 in a bunch of error messages from Qt printed in the console.
 
 
 QSslSocket: cannot call unresolved function SSLv3_client_method
 QSslSocket: cannot call unresolved function SSL_CTX_new
 QSslSocket: cannot call unresolved function SSL_library_init
 QSslSocket: cannot call unresolved function ERR_get_error
 QSslSocket: cannot call unresolved function ERR_error_string
 QSslSocket: cannot call unresolved function SSLv3_client_method
 QSslSocket: cannot call unresolved function SSL_CTX_new
 QSslSocket: cannot call unresolved function SSL_library_init
 QSslSocket: cannot call unresolved function ERR_get_error
 QSslSocket: cannot call unresolved function ERR_error_string
 QSslSocket: cannot call unresolved function SSLv3_client_method
 QSslSocket: cannot call unresolved function SSL_CTX_new
 QSslSocket: cannot call unresolved function SSL_library_init
 QSslSocket: cannot call unresolved function ERR_get_error
 QSslSocket: cannot call unresolved function ERR_error_string
 QSslSocket: cannot call unresolved function SSLv3_client_method
 QSslSocket: cannot call unresolved function SSL_CTX_new
 QSslSocket: cannot call unresolved function SSL_library_init
 QSslSocket: cannot call unresolved function ERR_get_error
 QSslSocket: cannot call unresolved function ERR_error_string
 
 and the result is an error page being displayed in QWebView telling me,
 that 
 the URL could not be loaded (Reason: HTTP request failed).
 
 All this made me believe, that SSL support is not there.

That would imply that a DLL was missing, or not on the PATH. I don't know
how the Qt installer is built. My builds use static libraries.

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


[PyQt] SIP: missing PyType_Ready

2009-05-26 Thread Kevin Watters
I was using an extension that traverses the GC heap, and it crashed when it
got to the sipVariableDescr_Type object, because it never gets initialized
via PyType_Ready.

The fix is easy; just an extra PyType_Ready for sipVariableDescr_Type in the
PyMODINIT_FUNC in siplib.c

Thanks!

- Kevin

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


Re: [PyQt] SIP: missing PyType_Ready

2009-05-26 Thread Phil Thompson
On Tue, 26 May 2009 17:21:28 + (UTC), Kevin Watters
kevin.watt...@gmail.com wrote:
 I was using an extension that traverses the GC heap, and it crashed when
it
 got to the sipVariableDescr_Type object, because it never gets
initialized
 via PyType_Ready.
 
 The fix is easy; just an extra PyType_Ready for sipVariableDescr_Type in
 the
 PyMODINIT_FUNC in siplib.c

Whoops - thanks.

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


Re: [PyQt] Next Releases

2009-05-26 Thread Gerard Vermeulen
On Tue, 26 May 2009 09:21:38 +0100
Phil Thompson p...@riverbankcomputing.com wrote:

 I plan to release new versions of SIP, PyQt3, PyQt4 and QScintilla at
 the end of the week based on the current snapshots.
 
 If there is something you think is missing or broken then now would
 be a good time to remind me.
 
 Phil
 ___
 PyQt mailing listPyQt@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Hi,

At least one of the PyQwt examples fails with the latest snapshots (25
mai) but works perfectly well with sip-4.7.9 and PyQt4-4.4.4.

I think the bug is due to the fact that (some?) virtual copy of
abstract base classes are not working.
 
Attached is the example SpectrogramDemo.py where SpectrogramData is
derived from a class defined in qwt_raster_data.sip.

Running ./SpectrogramDemo.py (PyQwt built against the snapshots) gives a
segmentation error just before the print statements preceding by the
'# FIXME'
comment.

Also included are typescript.fails (sip trace output with PyQwt compiled
against the latest snapshots) and typescript.works (sip trace output
with PyQwt compiled against the latest releases).

Gerard

PS: I know I should have tried to reduce the bug report to a much
smaller example, but I am very busy.
#!/usr/bin/env python

# The Python version of Qwt-5.0.0/examples/spectrogram

import sys
from PyQt4 import Qt
import PyQt4.Qwt5 as Qwt


class SpectrogramData(Qwt.QwtRasterData):

def __init__(self):
Qwt.QwtRasterData.__init__(self, Qt.QRectF(-1.5, -1.5, 3.0, 3.0))

# __init__()

def copy(self):
return self

# copy()

def range(self):
return Qwt.QwtDoubleInterval(0.0, 10.0);

# range()

def value(self, x, y):
c = 0.842;
v1 = x * x + (y-c) * (y+c);
v2 = x * (y+c) + x * (y+c);
return 1.0 / (v1 * v1 + v2 * v2);

# value()

# class SpectrogramData()


class Plot(Qwt.QwtPlot):

def __init__(self, parent = None):
Qwt.QwtPlot.__init__(self, parent)
self.__spectrogram = Qwt.QwtPlotSpectrogram()

colorMap = Qwt.QwtLinearColorMap(Qt.Qt.darkCyan, Qt.Qt.red)
colorMap.addColorStop(0.1, Qt.Qt.cyan)
colorMap.addColorStop(0.6, Qt.Qt.green)
colorMap.addColorStop(0.95, Qt.Qt.yellow)

self.__spectrogram.setColorMap(colorMap)

self.__spectrogram.setData(SpectrogramData())
self.__spectrogram.attach(self)

self.__spectrogram.setContourLevels(
[0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5])

rightAxis = self.axisWidget(Qwt.QwtPlot.yRight)
rightAxis.setTitle(Intensity)
rightAxis.setColorBarEnabled(True)
# FIXME
print self.__spectrogram.data()
print self.__spectrogram.data().range()
sys.exit(1)
rightAxis.setColorMap(self.__spectrogram.data().range(),
  self.__spectrogram.colorMap())

self.setAxisScale(Qwt.QwtPlot.yRight, 
  self.__spectrogram.data().range().minValue(),
  self.__spectrogram.data().range().maxValue())
self.enableAxis(Qwt.QwtPlot.yRight)

self.plotLayout().setAlignCanvasToScales(True)
self.replot()

# LeftButton for the zooming
# MidButton for the panning
# RightButton: zoom out by 1
# Ctrl+RighButton: zoom out to full size

zoomer = Qwt.QwtPlotZoomer(self.canvas())
zoomer.setMousePattern(Qwt.QwtEventPattern.MouseSelect2,
   Qt.Qt.RightButton, Qt.Qt.ControlModifier)
zoomer.setMousePattern(Qwt.QwtEventPattern.MouseSelect3,
   Qt.Qt.RightButton)
zoomer.setRubberBandPen(Qt.Qt.darkBlue)
zoomer.setTrackerPen(Qt.Qt.darkBlue)

panner = Qwt.QwtPlotPanner(self.canvas())
panner.setAxisEnabled(Qwt.QwtPlot.yRight, False)
panner.setMouseButton(Qt.Qt.MidButton)

# Avoid jumping when labels with more/less digits
# appear/disappear when scrolling vertically

fm = Qt.QFontMetrics(self.axisWidget(Qwt.QwtPlot.yLeft).font())
self.axisScaleDraw(
Qwt.QwtPlot.yLeft).setMinimumExtent(fm.width(100.00))

# __init__()

def showContour(self, on):
self.__spectrogram.setDisplayMode(
Qwt.QwtPlotSpectrogram.ContourMode, on)
self.replot()

# showContour()

def showSpectrogram(self, on):
self.__spectrogram.setDisplayMode(Qwt.QwtPlotSpectrogram.ImageMode, on)
if on:
pen = Qt.QPen()
else:
pen = Qt.QPen(Qt.Qt.NoPen)
self.__spectrogram.setDefaultContourPen(pen)
self.replot();

# showSpectrogram()

# class Plot()


class MainWindow(Qt.QMainWindow):

def __init__(self, parent=None):
Qt.QMainWindow.__init__(self, parent)
plot = Plot()

self.setCentralWidget(plot)

toolBar = 

Re: [PyQt] Next Releases

2009-05-26 Thread Kovid Goyal
pyuic4 doesn't have support for the QWizardPage class, as demonstrated by the
attached .ui file.

Kovid.

On Tue, May 26, 2009 at 09:21:38AM +0100, Phil Thompson wrote:
 I plan to release new versions of SIP, PyQt3, PyQt4 and QScintilla at the
 end of the week based on the current snapshots.
 
 If there is something you think is missing or broken then now would be a
 good time to remind me.
 
 Phil
 ___
 PyQt mailing listPyQt@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt
 
 !DSPAM:3,4a1ba74813131347477031!
 
 

-- 
_

Dr. Kovid Goyal 
http://www.kovidgoyal.net
http://calibre.kovidgoyal.net
_
?xml version=1.0 encoding=UTF-8?
ui version=4.0
 classWizardPage/class
 widget class=QWizardPage name=WizardPage
  property name=geometry
   rect
x0/x
y0/y
width400/width
height300/height
   /rect
  /property
  property name=windowTitle
   stringWelcome to calibre/string
  /property
  property name=windowIcon
   iconset resource=../images.qrc
normaloff:/images/wizard.svg/normaloff:/images/wizard.svg/iconset
  /property
  property name=title
   stringWelcome to calibre/string
  /property
  property name=subTitle
   stringThe one stop solution to all your e-book needs./string
  /property
  layout class=QGridLayout name=gridLayout
   item row=0 column=0 colspan=2
widget class=QLabel name=label
 property name=text
  stringChoose your e-book reader. This will set the conversion options 
to produce e-books optimized for your device./string
 /property
 property name=wordWrap
  booltrue/bool
 /property
/widget
   /item
   item row=1 column=0
widget class=QGroupBox name=groupBox
 property name=title
  stringamp;Manufacturers/string
 /property
 layout class=QVBoxLayout name=verticalLayout
  item
   widget class=QListView name=manufacturer_view/
  /item
 /layout
/widget
   /item
   item row=1 column=1
widget class=QGroupBox name=groupBox_2
 property name=title
  stringamp;Devices/string
 /property
 layout class=QVBoxLayout name=verticalLayout_2
  item
   widget class=QListView name=device_view/
  /item
 /layout
/widget
   /item
  /layout
 /widget
 resources
  include location=../images.qrc/
 /resources
 connections/
/ui


pgphr5VVr1fcX.pgp
Description: PGP signature
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Next Releases

2009-05-26 Thread projetmbc
For your point of view but none for mine. Indeed I'd like examples which 
are very small.


Why don't you give this kind of example ?

Best regards.
Christophe



Detlev Offenbach a écrit :

Hi,

the simple example is eric. ;-)

Detlev

On Dienstag, 26. Mai 2009, projetmbc wrote:
  

That's very cool. I hope that there will be a simple example showing how
to use it.

Christophe.

Phil Thompson a écrit :


On Tue, 26 May 2009 11:48:52 +0200, projetmbc
projet...@club-internet.fr

wrote:
  

Hello,
I would like to know if the patch of Eric Software which allows to use
pygments with QScintilla will be with this new release.


Yes.

Phil
  

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





  



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


Re: [PyQt] Next Releases

2009-05-26 Thread Phil Thompson
On Tue, 26 May 2009 13:19:46 -0700, Kovid Goyal ko...@kovidgoyal.net
wrote:
 pyuic4 doesn't have support for the QWizardPage class, as demonstrated by
 the
 attached .ui file.

Fixed in tonight's snapshot - thanks.

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


[PyQt] some bugs in opengl examples

2009-05-26 Thread Francis Cho
Hello,

I found some bugs in opengl examples.

1. Wrong conversion of the original C++ code.

It is in grabber.py.
I changed as following to get the correct behavior.

FROM
 def resizeGL(self, height, width):
TO
 def resizeGL(self, width, height):

Before changing the code like the above, the opengl widget portion of the
window couldn't be shrinked or enlarged correctly.
From the original C++ code, we can see that the modified is correct.

2. OpenGL related error message from grabber.py, hellogl.py and textures.py
on mac osx.

I got the following OpenGL related error message from the above three files
on mac osx only.

Traceback (most recent call last):
  File grabber.py, line 131, in resizeGL
glViewport((width - side) / 2, (height - side) / 2, side, side)
  File /Library/Python/2.5/site-packages/OpenGL/error.py, line 194, in
glCheckError
baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
err = 1281,
description = 'invalid value',
baseOperation = glViewport,
cArguments = (0, 0, -1, -1)
)

I inserted a line to see the value of width and height in resizeGL and I
could notice that the resizeGL was called twice.

francis-macbook-pro:opengl ycc$ python grabber.py 2/dev/null
-1 0
179 164

As you can see from above, the first line contains strange values.
So, I entered the following two lines right after def resizeGL... as a
workarround.

if height  0 or width  0:
return

This was not happened with some old snapshots.
I forgot the specific name of the snapshots.


Thanks,

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