[PyQt] problems with PyQt book custom view examples [Win7]

2009-12-08 Thread Romi Agar
Hi!

I seem to be experiencing some problems with custom view examples in PyQt
book.
I'm running Win 7 x64, Python 2.6.4rc2, PyQt 4.6.2.
The problem is with chapter 14 and 16 custom view applications. When run,
they show empty tables (no visible data) with different background color
shades on some rows. The Chapter 16 waterquality example has an empty table
with 17508 rows.
Does someone maybe know a solution to this problem?

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

[PyQt] TextEdit background color

2009-12-08 Thread Nadav Chernin
Hi, i'm new for PyQt

I use TextEdit widget, and i want that it's background color will black (for
example)

I tried to use TextEdit.setTextBackgroundColor but only background of text
painted by black color.

How can i color all TextEdit area by any color?

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

Re: [PyQt] TextEdit background color

2009-12-08 Thread Nick Gaens

Take a look at style sheets.

On 8-dec-2009, at 09:44, Nadav Chernin nadavcher...@gmail.com wrote:


Hi, i'm new for PyQt

I use TextEdit widget, and i want that it's background color will  
black (for example)


I tried to use TextEdit.setTextBackgroundColor but only background  
of text painted by black color.


How can i color all TextEdit area by any color?

Thanks, Nadav
___
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] Latest snapshot does not compile

2009-12-08 Thread Sebastian Linke

Running `make` stops with an error:

make[1]: Entering directory
`/home/seblin/PyQt-x11-gpl-4.7-snapshot-20091207/QtWebKit'
g++ -c -pipe -fPIC -fno-optimize-sibling-calls -Wall -W -D_REENTRANT
-DNDEBUG -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_DEBUG
-DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I.
-I/usr/include/python2.6 -I/usr/mkspecs/linux-g++
-I/usr/include/qt4/QtWebKit -I/usr/include/qt4/QtGui
-I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtCore -I/usr/include/qt4
-I/usr/X11R6/include -o sipQtWebKitQWebElement.o sipQtWebKitQWebElement.cpp
sipQtWebKitQWebElement.cpp: In function 'PyObject*
meth_QWebElement_attributeNames(PyObject*, PyObject*)':
sipQtWebKitQWebElement.cpp:661: error: 'class QWebElement' has no member
named 'attributeNames'
make[1]: *** [sipQtWebKitQWebElement.o] Error 1
make[1]: Leaving directory
`/home/seblin/PyQt-x11-gpl-4.7-snapshot-20091207/QtWebKit'
make: *** [all] Error 2

I called `configure.py` without additional arguments before.
-- 
View this message in context: 
http://old.nabble.com/Latest-snapshot-does-not-compile-tp26690730p26690730.html
Sent from the PyQt mailing list archive at Nabble.com.

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


Re: [PyQt] Freezes and crashes with signal autoconnection

2009-12-08 Thread Phil Thompson
On Mon, 7 Dec 2009 16:24:19 -0800 (PST), Christian Roche
christian.roche...@gmail.com wrote:
 However now I have another problem. Following Phill latest advice, I read
 the following part of the documentation:
 
 
 In the current version QVariant.userType() will correctly return
 QMetaType.QObjectStar (or QMetaType.QWidgetStar) but an extra reference
 to
 the Python object is not kept. To avoid a potential crash you should
 ensure that you keep a separate reference to the Python object, either
 explicitly or implicitly by giving it a parent.
 
 Unfortunaltely these sentences are totally unclear to me. When is
 QVariant.userType() used? Who does or does not keep a reference to the
 Python object, and when? In which situation would a crash potentially
 occur?

When a value is passed between threads Qt wraps it in a QVariant and uses
the event system to send it to the correct thread.

PyQt can convert any Python object to a QVariant. If possible it uses the
standard QVariant types to do so. This means that if the code using the
value is C++ then it has a chance of working. The original Python object
gets discarded, ie. it's reference count is left unchanged. This is fine
because the standard QVariant types (with a couple of exceptions) are value
types (as opposed to pointer types) so they can be safely copied by Qt and
exist independently of the original Python object.

Other Python objects do not correspond to the standard QVariant types, so
PyQt has an internal C++ class that can wrap a Python object and can itself
be wrapped in a QVariant. As a QVariant can be copied around inside Qt the
internal PyQt class manages the reference count of the Python object it is
wrapping so that it stays alive for as long as it is needed, and garbage
collected when it is not.

All the above happens automatically.

The problem is that the QObjectStar and QWidgetStar types are pointer types
and not value types. If the value being pointed to is owned by Python then
it's important that the reference count is maintained, otherwise the
QObject/QWidget will be destroyed when the Python object is garbage
collected and the QVariant will be left with a dangling pointer and will
cause a crash. Ideally these types would be wrapped by the same internal
PyQt class which would manage the reference count. The problem is that any
C++ code that is expecting a QObjectStar/QWidgetStar wouldn't know how to
get it out of the wrapper. The main use case is making Python objects
available as JavaScript objects in QtScript.

Therefore, in these specific cases, if it necessary for your code to ensure
that there is an explicit reference kept to any QObject or QWidget you are
passing between threads.

 Worse, eventhough I don't understand the why, I tried to implement the
 how, i.e., naively added the following lines to my code, hoping to have
 given my poor lonesome QObject some parent by doing so, and not any
 ordinary
 parent, the parent of all parents, the very QApplication itself:
 
 
 class ImageLink(QObject):
 
 def __init__(self, base, url, href):
 QObject.__init__(self)
 app = QApplication.instance()
 self.moveToThread(app.thread())
 self.setParent(app)
 blah blah
 
 Alas, poor Yorich, all this no no avail. Still it crashes faster than the
 lightning, and grieves my sore heart and my tired soul.

I've already suggested that you should simplify your ImageLink class so
that it does not derive from QObject.

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


Re: [PyQt] problems with PyQt book custom view examples [Win7]

2009-12-08 Thread Romi Agar
Everything else seems to be working apart from the little bug with saving
application settings to Windows registry. It does remember the application
size and position, but recently used files do not get loaded when the
program is relaunched. I checked, that recently used program data gets
written to the registry (at least some kind of byte array) on application
termination, but somewhere in the application loading process it gets lost
or is not recognised.


2009/12/8 Mark Summerfield m...@qtrac.eu

 On 2009-12-08, Romi Agar wrote:
  Hi!
 
  I seem to be experiencing some problems with custom view examples in
  PyQt book. I'm running Win 7 x64, Python 2.6.4rc2, PyQt 4.6.2. The
  problem is with chapter 14 and 16 custom view applications. When run,
  they show empty tables (no visible data) with different background
  color shades on some rows. The Chapter 16 waterquality example has an
  empty table with 17508 rows. Does someone maybe know a solution to
  this problem?

 I just tried all the examples in those chapters with:
 - Python 2.6.2, Qt 4.5.3, PyQt 4.5.1, Linux 32-bit
 - Python 2.6.4, Qt 4.5.3, PyQt 4.6.2, Windows XP 32-bit
 and they ran fine. (I ran them from the console from their own
 directories.)

 I don't have Windows 7, so can't test on your platform.

 If the problem is with Qt, it might take a while before it is fixed
 since Windows 7 is a Tier 2 platform for Qt 4.6 (should be Tier 1 for
 Qt 4.7), so bugs in Qt for Windows 7 may not get high priority yet.
 http://doc.trolltech.com/4.6/supported-platforms.html

 I haven't heard of other people having problems like this with Windows 7
 though---at least not yet. And it is hard to know what the problem really
 is, let alone suggest a solution. Do the other examples work okay?

 --
 Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
Advanced Qt Programming - ISBN 0321635906

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

Re: [PyQt] problems with PyQt book custom view examples [Win7]

2009-12-08 Thread Mark Summerfield
On 2009-12-08, Romi Agar wrote:
 Everything else seems to be working apart from the little bug with
 saving application settings to Windows registry. It does remember
 the application size and position, but recently used files do not get
 loaded when the program is relaunched. I checked, that recently used
 program data gets written to the registry (at least some kind of byte
 array) on application termination, but somewhere in the application
 loading process it gets lost or is not recognised.

In which particular example(s) does that occur?

 2009/12/8 Mark Summerfield m...@qtrac.eu
 
  On 2009-12-08, Romi Agar wrote:
   Hi!
  
   I seem to be experiencing some problems with custom view examples in
   PyQt book. I'm running Win 7 x64, Python 2.6.4rc2, PyQt 4.6.2. The
   problem is with chapter 14 and 16 custom view applications. When run,
   they show empty tables (no visible data) with different background
   color shades on some rows. The Chapter 16 waterquality example has an
   empty table with 17508 rows. Does someone maybe know a solution to
   this problem?
 
  I just tried all the examples in those chapters with:
  - Python 2.6.2, Qt 4.5.3, PyQt 4.5.1, Linux 32-bit
  - Python 2.6.4, Qt 4.5.3, PyQt 4.6.2, Windows XP 32-bit
  and they ran fine. (I ran them from the console from their own
  directories.)
 
  I don't have Windows 7, so can't test on your platform.
 
  If the problem is with Qt, it might take a while before it is fixed
  since Windows 7 is a Tier 2 platform for Qt 4.6 (should be Tier 1 for
  Qt 4.7), so bugs in Qt for Windows 7 may not get high priority yet.
  http://doc.trolltech.com/4.6/supported-platforms.html
 
  I haven't heard of other people having problems like this with Windows 7
  though---at least not yet. And it is hard to know what the problem 
really
  is, let alone suggest a solution. Do the other examples work okay?
 
  --
  Mark Summerfield, Qtrac Ltd, www.qtrac.eu
 C++, Python, Qt, PyQt - training and consultancy
 Advanced Qt Programming - ISBN 0321635906
 


-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
Advanced Qt Programming - ISBN 0321635906
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] problems with PyQt book custom view examples [Win7]

2009-12-08 Thread Romi Agar
For example chapter 6: imagechanger_ans.pyw. It remebers the window size and
log window position, but not the last accessed images.
I think that this has something to do with using QStrings.
I just tested the chapter 16 carhirelog.pyw example. By default it does not
show the content of License, Customer and Notes columns. But what do they
have in common? In CarHireLog class, they are all stored as QStrings.
Removing the conversion to QString from the initializer and voilaa - it
works. Maybe the recent files problem comes also from QString usage or
QStringList conversion - haven't tested yet.


2009/12/8 Mark Summerfield l...@qtrac.plus.com

 On 2009-12-08, Romi Agar wrote:
  Everything else seems to be working apart from the little bug with
  saving application settings to Windows registry. It does remember
  the application size and position, but recently used files do not get
  loaded when the program is relaunched. I checked, that recently used
  program data gets written to the registry (at least some kind of byte
  array) on application termination, but somewhere in the application
  loading process it gets lost or is not recognised.

 In which particular example(s) does that occur?

  2009/12/8 Mark Summerfield m...@qtrac.eu
 
   On 2009-12-08, Romi Agar wrote:
Hi!
   
I seem to be experiencing some problems with custom view examples in
PyQt book. I'm running Win 7 x64, Python 2.6.4rc2, PyQt 4.6.2. The
problem is with chapter 14 and 16 custom view applications. When run,
they show empty tables (no visible data) with different background
color shades on some rows. The Chapter 16 waterquality example has an
empty table with 17508 rows. Does someone maybe know a solution to
this problem?
  
   I just tried all the examples in those chapters with:
   - Python 2.6.2, Qt 4.5.3, PyQt 4.5.1, Linux 32-bit
   - Python 2.6.4, Qt 4.5.3, PyQt 4.6.2, Windows XP 32-bit
   and they ran fine. (I ran them from the console from their own
   directories.)
  
   I don't have Windows 7, so can't test on your platform.
  
   If the problem is with Qt, it might take a while before it is fixed
   since Windows 7 is a Tier 2 platform for Qt 4.6 (should be Tier 1 for
   Qt 4.7), so bugs in Qt for Windows 7 may not get high priority yet.
   http://doc.trolltech.com/4.6/supported-platforms.html
  
   I haven't heard of other people having problems like this with Windows
 7
   though---at least not yet. And it is hard to know what the problem
 really
   is, let alone suggest a solution. Do the other examples work okay?
  
   --
   Mark Summerfield, Qtrac Ltd, www.qtrac.eu
  C++, Python, Qt, PyQt - training and consultancy
  Advanced Qt Programming - ISBN 0321635906
 


 --
 Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
Advanced Qt Programming - ISBN 0321635906

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

Re: [PyQt] problems with PyQt book custom view examples [Win7]

2009-12-08 Thread Mark Summerfield
On 2009-12-08, Romi Agar wrote:
 For example chapter 6: imagechanger_ans.pyw. It remebers the window size
  and log window position, but not the last accessed images.
 I think that this has something to do with using QStrings.
 I just tested the chapter 16 carhirelog.pyw example. By default it does 
not
 show the content of License, Customer and Notes columns. But what do they
 have in common? In CarHireLog class, they are all stored as QStrings.
 Removing the conversion to QString from the initializer and voilaa - it
 works. Maybe the recent files problem comes also from QString usage or
 QStringList conversion - haven't tested yet.

Ah, okay, it sounds like you're on the right track. Maybe your PyQt is
using API 2 rather than API 1---all the examples only work for API 1
(which was the only API that existed when the book was written). But API
2 is not supposed to be the default for Python 2 and you say you're
using Python 2.6...

 
 
 2009/12/8 Mark Summerfield l...@qtrac.plus.com
 
  On 2009-12-08, Romi Agar wrote:
   Everything else seems to be working apart from the little bug with
   saving application settings to Windows registry. It does remember
   the application size and position, but recently used files do not get
   loaded when the program is relaunched. I checked, that recently used
   program data gets written to the registry (at least some kind of byte
   array) on application termination, but somewhere in the application
   loading process it gets lost or is not recognised.
 
  In which particular example(s) does that occur?
 
   2009/12/8 Mark Summerfield m...@qtrac.eu
  
On 2009-12-08, Romi Agar wrote:
 Hi!

 I seem to be experiencing some problems with custom view examples
 in PyQt book. I'm running Win 7 x64, Python 2.6.4rc2, PyQt 4.6.2.
 The problem is with chapter 14 and 16 custom view applications.
 When run, they show empty tables (no visible data) with different
 background color shades on some rows. The Chapter 16 waterquality
 example has an empty table with 17508 rows. Does someone maybe 
know
 a solution to this problem?
   
I just tried all the examples in those chapters with:
- Python 2.6.2, Qt 4.5.3, PyQt 4.5.1, Linux 32-bit
- Python 2.6.4, Qt 4.5.3, PyQt 4.6.2, Windows XP 32-bit
and they ran fine. (I ran them from the console from their own
directories.)
   
I don't have Windows 7, so can't test on your platform.
   
If the problem is with Qt, it might take a while before it is fixed
since Windows 7 is a Tier 2 platform for Qt 4.6 (should be Tier 1
for Qt 4.7), so bugs in Qt for Windows 7 may not get high priority
yet. http://doc.trolltech.com/4.6/supported-platforms.html
   
I haven't heard of other people having problems like this with
Windows
 
  7
 
though---at least not yet. And it is hard to know what the problem
 
  really
 
is, let alone suggest a solution. Do the other examples work okay?
   
--
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
   C++, Python, Qt, PyQt - training and consultancy
   Advanced Qt Programming - ISBN 0321635906
 
  --
  Mark Summerfield, Qtrac Ltd, www.qtrac.eu
 C++, Python, Qt, PyQt - training and consultancy
 Advanced Qt Programming - ISBN 0321635906
 


-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
C++, Python, Qt, PyQt - training and consultancy
Programming in Python 3 (Second Edition) - ISBN 0321680561
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] problems with PyQt book custom view examples [Win7]

2009-12-08 Thread Phil Thompson
On Tue, 8 Dec 2009 11:48:17 +, Mark Summerfield l...@qtrac.plus.com
wrote:
 On 2009-12-08, Romi Agar wrote:
 For example chapter 6: imagechanger_ans.pyw. It remebers the window size
  and log window position, but not the last accessed images.
 I think that this has something to do with using QStrings.
 I just tested the chapter 16 carhirelog.pyw example. By default it does 
 not
 show the content of License, Customer and Notes columns. But what do
they
 have in common? In CarHireLog class, they are all stored as QStrings.
 Removing the conversion to QString from the initializer and voilaa - it
 works. Maybe the recent files problem comes also from QString usage or
 QStringList conversion - haven't tested yet.
 
 Ah, okay, it sounds like you're on the right track. Maybe your PyQt is
 using API 2 rather than API 1---all the examples only work for API 1
 (which was the only API that existed when the book was written). But API
 2 is not supposed to be the default for Python 2 and you say you're
 using Python 2.6...

...make sure PyQt is built with SIP v4.9.3.

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


[PyQt] PyQt Licensing Issue

2009-12-08 Thread Prashant Saxena
Hi,

I am planning to release the beta version(Testing) of an application written 
using python+PyQt.
I won't be including the source code with the installation. Do I have to 
purchase the PyQt commercial license now itself or I can purchase before 
releasing the commercial version. It'll surely take 2-3 months before I reach 
to final version and releasing
the commercial version is purely based on the users opinion and success.

Prashant



  The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. 
http://in.yahoo.com/

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


Re: [PyQt] problems with PyQt book custom view examples [Win7]

2009-12-08 Thread Romi Agar
Aha, it's actually built with SIP v4.9.2.

If I specifically use API#2 QStrings and make the according fixes in the
code, it works fine.
Updating to SIP v4.9.3 also fixes all the bugs I mentioned. Thanks for the
tip Phil.

2009/12/8 Phil Thompson p...@riverbankcomputing.com

 On Tue, 8 Dec 2009 11:48:17 +, Mark Summerfield l...@qtrac.plus.com
 wrote:
  On 2009-12-08, Romi Agar wrote:
  For example chapter 6: imagechanger_ans.pyw. It remebers the window size
   and log window position, but not the last accessed images.
  I think that this has something to do with using QStrings.
  I just tested the chapter 16 carhirelog.pyw example. By default it does
  not
  show the content of License, Customer and Notes columns. But what do
 they
  have in common? In CarHireLog class, they are all stored as QStrings.
  Removing the conversion to QString from the initializer and voilaa - it
  works. Maybe the recent files problem comes also from QString usage or
  QStringList conversion - haven't tested yet.
 
  Ah, okay, it sounds like you're on the right track. Maybe your PyQt is
  using API 2 rather than API 1---all the examples only work for API 1
  (which was the only API that existed when the book was written). But API
  2 is not supposed to be the default for Python 2 and you say you're
  using Python 2.6...

 ...make sure PyQt is built with SIP v4.9.3.

 Phil

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

Re: [PyQt] PyQt Licensing Issue

2009-12-08 Thread Phil Thompson
On Tue, 8 Dec 2009 17:46:20 +0530 (IST), Prashant Saxena
animator...@yahoo.com wrote:
 Hi,
 
 I am planning to release the beta version(Testing) of an application
 written using python+PyQt.
 I won't be including the source code with the installation. Do I have to
 purchase the PyQt commercial license now itself or I can purchase before
 releasing the commercial version. It'll surely take 2-3 months before I
 reach to final version and releasing
 the commercial version is purely based on the users opinion and success.

You need commercial licenses before you distribute your application to your
users for the first time - not when you release the final version.

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


[PyQt] Icon sidepane in Windows Vista/7

2009-12-08 Thread Lukas Hetzenecker
Hello,

i have a QListWidget that displays a button bar, like in KDEs Kontact.
I attached my current implementation. This works fine with Linux/Oxygen theme 
(as you can see in this screenshot: http://imagebin.ca/img/Od0zEZ.jpg ) and 
Windows XP, but looks ugly in Windows Vista and Windows 7 (as you can see 
here: http://imagebin.ca/img/umwpMN1.jpg ).

Is it possible to extend the region of the background of a selected item in 
windows vista?

I even tried it with a QStyledItemDelegate and QStyleOptionViewItemV4 
(decorationSize attribute), but this didn't help.

Does anybody know what I should try else?

Thanks for your help,
Lukas
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created: Tue Dec  8 13:44:09 2009
#  by: PyQt4 UI code generator 4.6.2
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui

class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(MainWindow)
MainWindow.resize(544, 511)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(centralwidget)
self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
self.horizontalLayout.setObjectName(horizontalLayout)
self.listWidget = QtGui.QListWidget(self.centralwidget)
self.listWidget.setMaximumSize(QtCore.QSize(65, 16777215))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(224, 223, 223))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(38, 136, 240))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Highlight, brush)
brush = QtGui.QBrush(QtGui.QColor(224, 223, 223))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(38, 136, 240))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Highlight, brush)
brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
brush = QtGui.QBrush(QtGui.QColor(0, 0, 128))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Highlight, brush)
self.listWidget.setPalette(palette)
self.listWidget.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.listWidget.setEditTriggers(QtGui.QAbstractItemView.CurrentChanged)
self.listWidget.setDragDropMode(QtGui.QAbstractItemView.NoDragDrop)
self.listWidget.setIconSize(QtCore.QSize(32, 32))
self.listWidget.setTextElideMode(QtCore.Qt.ElideNone)
self.listWidget.setMovement(QtGui.QListView.Static)
self.listWidget.setFlow(QtGui.QListView.TopToBottom)
self.listWidget.setProperty(isWrapping, True)
self.listWidget.setResizeMode(QtGui.QListView.Fixed)
self.listWidget.setLayoutMode(QtGui.QListView.SinglePass)
self.listWidget.setGridSize(QtCore.QSize(65, 55))
self.listWidget.setViewMode(QtGui.QListView.IconMode)
self.listWidget.setUniformItemSizes(True)
self.listWidget.setWordWrap(False)
self.listWidget.setObjectName(listWidget)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(../../../../../../../usr/share/icons/oxygen/48x48/apps/kwalletmanager.png), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item = QtGui.QListWidgetItem(self.listWidget)
item.setIcon(icon)
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap(../../../../../../../usr/share/icons/oxygen/48x48/actions/mail-flag.png), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item = QtGui.QListWidgetItem(self.listWidget)
item.setIcon(icon1)
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap(../../../../../../../usr/share/icons/oxygen/48x48/apps/preferences-contact-list.png), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item = QtGui.QListWidgetItem(self.listWidget)
item.setIcon(icon2)
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap(../../../../../../../usr/share/icons/oxygen/48x48/devices/phone.png), QtGui.QIcon.Normal, QtGui.QIcon.Off)
item = QtGui.QListWidgetItem(self.listWidget)
item.setIcon(icon3)
self.horizontalLayout.addWidget(self.listWidget)
self.stackedWidget = QtGui.QStackedWidget(self.centralwidget)
self.stackedWidget.setObjectName(stackedWidget)
self.page = QtGui.QWidget()
self.page.setObjectName(page)
self.verticalLayout = QtGui.QVBoxLayout(self.page)
self.verticalLayout.setObjectName(verticalLayout)
self.label = 

Re: [PyQt] PyQt Licensing Issue

2009-12-08 Thread Giovanni Bajo
On Tue, 08 Dec 2009 12:25:15 +, Phil Thompson
p...@riverbankcomputing.com wrote:
 On Tue, 8 Dec 2009 17:46:20 +0530 (IST), Prashant Saxena
 animator...@yahoo.com wrote:
 Hi,
 
 I am planning to release the beta version(Testing) of an application
 written using python+PyQt.
 I won't be including the source code with the installation. Do I have
to
 purchase the PyQt commercial license now itself or I can purchase
before
 releasing the commercial version. It'll surely take 2-3 months before I
 reach to final version and releasing
 the commercial version is purely based on the users opinion and
success.
 
 You need commercial licenses before you distribute your application to
your
 users for the first time - not when you release the final version.

As for Qt, the commercial license explicitly forbids relicensing of
existing GPL/LGPL code (even if you own the copyright). So basically Nokia
requires that you buy a commercial license at the beginning of development,
not at release time.
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyQt Licensing Issue

2009-12-08 Thread Darren Dale
On Tue, Dec 8, 2009 at 8:14 AM, Giovanni Bajo ra...@develer.com wrote:
 On Tue, 08 Dec 2009 12:25:15 +, Phil Thompson
 p...@riverbankcomputing.com wrote:
 On Tue, 8 Dec 2009 17:46:20 +0530 (IST), Prashant Saxena
 animator...@yahoo.com wrote:
 Hi,

 I am planning to release the beta version(Testing) of an application
 written using python+PyQt.
 I won't be including the source code with the installation. Do I have
 to
 purchase the PyQt commercial license now itself or I can purchase
 before
 releasing the commercial version. It'll surely take 2-3 months before I
 reach to final version and releasing
 the commercial version is purely based on the users opinion and
 success.

 You need commercial licenses before you distribute your application to
 your
 users for the first time - not when you release the final version.

 As for Qt, the commercial license explicitly forbids relicensing of
 existing GPL/LGPL code (even if you own the copyright). So basically Nokia
 requires that you buy a commercial license at the beginning of development,
 not at release time.

Right, see http://qt.nokia.com/products/licensing :

You must purchase a Qt Commercial Developer License from us or from
one of our authorized resellers before you start developing commercial
software. The Qt Commercial Developer License does not allow the
incorporation of code developed with the Qt GNU LGPL v. 2.1 or GNU GPL
v. 3.0 license versions into a commercial product.

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


Re: [PyQt] PyQt Licensing Issue

2009-12-08 Thread Hans-Peter Jansen
On Tuesday 08 December 2009, 13:25:15 Phil Thompson wrote:
 On Tue, 8 Dec 2009 17:46:20 +0530 (IST), Prashant Saxena

 animator...@yahoo.com wrote:
  Hi,
 
  I am planning to release the beta version(Testing) of an application
  written using python+PyQt.
  I won't be including the source code with the installation. Do I have
  to purchase the PyQt commercial license now itself or I can purchase
  before releasing the commercial version. It'll surely take 2-3 months
  before I reach to final version and releasing
  the commercial version is purely based on the users opinion and
  success.

 You need commercial licenses before you distribute your application to
 your users for the first time - not when you release the final version.

If I understand the PyQt licensing correctly, he should have bought the 
license before start developing, shouldn't he?

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


Re: [PyQt] PyQt Licensing Issue

2009-12-08 Thread Phil Thompson
On Tue, 8 Dec 2009 14:29:07 +0100, Hans-Peter Jansen h...@urpla.net
wrote:
 On Tuesday 08 December 2009, 13:25:15 Phil Thompson wrote:
 On Tue, 8 Dec 2009 17:46:20 +0530 (IST), Prashant Saxena

 animator...@yahoo.com wrote:
  Hi,
 
  I am planning to release the beta version(Testing) of an application
  written using python+PyQt.
  I won't be including the source code with the installation. Do I have
  to purchase the PyQt commercial license now itself or I can purchase
  before releasing the commercial version. It'll surely take 2-3 months
  before I reach to final version and releasing
  the commercial version is purely based on the users opinion and
  success.

 You need commercial licenses before you distribute your application to
 your users for the first time - not when you release the final version.
 
 If I understand the PyQt licensing correctly, he should have bought the 
 license before start developing, shouldn't he?

No. That used to be the case but with the release of the LGPL Qt I relaxed
that condition.

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


[PyQt] How to update an QAbstactTableModel

2009-12-08 Thread Simon Hibbs
 I've written a stock portfolio tracker in pyqt4. The main window which
 is a QAbstractTableModel has an Update button. When I click it, the
 program gets new stock prices and updates the data in the table.

 My problem is that the data displayed in the table doesn't update until
 the window loses and regains focus

If you're loading the data into the database directly using SQL, then QT
won't be aware of the change. You could tryusing
QSqlRelationalTableModel.setData() to push the data into the model. It's
described here:

http://doc.trolltech.com/4.5/qtsql.html#inserting-updating-and-deleting-records

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

[PyQt] sip-4.10-snapshot-20091204 and va_copy

2009-12-08 Thread Aron Bierbaum
While trying to compile that latest PyQt snapshot with MSVC 9.0 I get
the following error. After a quick Google search it seems that VC++
might not  implement va_copy. With that said though have no idea why
it is succeeding at building and failing at link time. Does anyone
have any suggestions on how to work around this build issue? For now I
have replaced the uses of va_copy with (*(va) = *(va_orig)); I don't
know if this will work and is probably not the correct solution, but I
will try it for now.

Thanks,
Aron

link /NOLOGO /DLL /MANIFEST /MANIFESTFILE:sip.pyd.manifest
/SUBSYSTEM:CONSOLE /INCREMENTAL:N
O /OUT:sip.pyd @C:\DOCUME~1\ARONB~1.PRI\LOCALS~1\Temp\nm16F.tmp
   Creating library sip.lib and object sip.exp
siplib.obj : error LNK2019: unresolved external symbol _va_copy
referenced in function _parseKwdArgs

sip.pyd : fatal error LNK1120: 1 unresolved externals
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Flexible __init__ and method chaining.

2009-12-08 Thread ukpyr666
 Direct translation of C++ API results in huge initialization code 
where it can be done with 1 line.
 To decrease initialization code it will be useful if __init__ of PyQt4 
classes can take additional parameters from **kwargs and auto call 
setXXX methods to set them.

 Also setXXX can return self for method chaining.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Freezes and crashes with signal autoconnection

2009-12-08 Thread Christian Roche

Hi Phil,

thanks for the detailed explanation, although I have to admit I have a bit
of a hard time following through.. Anyway...


Phil Thompson-5 wrote:
 
 I've already suggested that you should simplify your ImageLink class so
 that it does not derive from QObject.
 

Okay but there must be something else here, I did just what you suggested 
http://old.nabble.com/file/p26701730/main.py here  (I had to replace
ImageLink arguments in signal definition with 'PyQt_PyObject', not sure why
exactly)

Still I get the same crash, after a few get_param iterations though, which
makes me believe it's not a pure GC'ed object issue :


python main.py 
 get_param(http://abcdef.net/st/st.php?id=6630script=1url=http://g.ftv.com/4/17/377889p=60,
 url)
 get_param(http://g.ftv.com/4/17/377889, url)  
 
 [1]3510 segmentation fault (core dumped)  python main.py
 
gdb /usr/bin/python core.3510 
 Program terminated with signal 11, Segmentation fault.
 
 #0  0x00247ef9 in qpycore_PyObject_FromQString (qs...@0x9346a5c) at
 qpycore_qstring.cpp:49
 49  if ((obj = PyUnicode_FromUnicode(NULL, qstr.length())) ==
 NULL) 
 
 (gdb) bt  
 
 #0  0x00247ef9 in qpycore_PyObject_FromQString (qs...@0x9346a5c) at
 qpycore_qstring.cpp:49
 #1  0x001964b9 in slot_QString___str__ (sipSelf=0xb747450c) at
 sip/QtCore/qstring.sip:449 
 #2  0x03644edf in _PyObject_Str (v=0xb747450c) at Objects/object.c:415
 
 #3  0x03654c16 in PyString_Format (format=0xb77df320, args=0xb77e306c) at
 Objects/stringobject.c:4839 
 #4  0x03655e1f in string_mod (v=0x2b2a2928, w=0xb77e306c) at
 Objects/stringobject.c:4116  
 [blah blah blah]
 

Thanks,
Chris
-- 
View this message in context: 
http://old.nabble.com/Freezes-and-crashes-with-signal-autoconnection-tp25716493p26701730.html
Sent from the PyQt mailing list archive at Nabble.com.

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


Re: [PyQt] Flexible __init__ and method chaining.

2009-12-08 Thread Phil Thompson
On Tue, 08 Dec 2009 20:32:35 +0200, ukpyr666 ukpyr...@gmail.com wrote:
 Direct translation of C++ API results in huge initialization code 
 where it can be done with 1 line.
   To decrease initialization code it will be useful if __init__ of PyQt4 
 classes can take additional parameters from **kwargs and auto call 
 setXXX methods to set them.

That was added in PyQt v4.6.

   Also setXXX can return self for method chaining.

Use the QObject.pyqtConfigure() method added in PyQt v4.6.

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


Re: [PyQt] How to update an QAbstactTableModel

2009-12-08 Thread despen
Simon Hibbs simon.hi...@gmail.com writes:

 I've written a stock portfolio tracker in pyqt4. The main window which
 is a QAbstractTableModel has an Update button. When I click it, the
 program gets new stock prices and updates the data in the table.

 My problem is that the data displayed in the table doesn't update until
 the window loses and regains focus

 If you're loading the data into the database directly using SQL, then QT
 won't be aware of the change. You could tryusing
 QSqlRelationalTableModel.setData() to push the data into the model. It's
 described here:

Thanks for the reply.

I'm not using SQL.
I get updated prices for stocks from Yahoo.  That changes the stuff
being displayed.

The init method is like this:

class MyTableModel(QAbstractTableModel): 
def __init__(self, datain, headerdata, parent=None, *args): 
QAbstractTableModel.__init__(self, parent, *args) 
self.arraydata = datain
self.headerdata = headerdata

and the init method gets called like this;

tm = MyTableModel(self.tabledata, header, self) 

My problem is getting new data from tabledata into the display.
The init above works but later on from a shortcut I
tabledata and do:

tm.changeData(self.tabledata)

and changeData does:

def changeData(self, datain):
self.emit(SIGNAL(LayoutAboutToBeChanged()))
self.arraydata = datain
self.emit(SIGNAL(LayoutChanged()))

I also tried changing the word Layout to Data but neither
causes the table to update after the shortcut.

If I unfocus and focus the window it does update.
So I think I'm getting the data into the table, it's just not
repainting itself.

The data method for the table looks like this:

def data(self, index, role): 
if not index.isValid(): 
return QVariant() 
elif role == Qt.TextAlignmentRole: 
if (index.column() == 0):
return Qt.AlignLeft
return Qt.AlignRight
elif role == Qt.BackgroundColorRole:
symbol = self.arraydata[index.row()][0]
if symbol == $ :
return QVariant(QColor(0xEE, 0xFF, 0xEE))
shares = self.arraydata[index.row()][1]
if shares == '0' :
return QVariant(QColor('wheat'))
if symbol[0] == '^' :
return QVariant(QColor(0xEE, 0xEE, 0xF5))
if index.row() == len(self.arraydata) - 1 :
return QVariant(QColor('lightgray'))
return QVariant()
elif role == Qt.TextColorRole:
content = self.arraydata[index.row()][index.column()]
if content != 0 and str(content)[0] == '-' :
return QVariant(QColor('red'))
return QVariant() 
elif role != Qt.DisplayRole: 
return QVariant() 
return QVariant(self.arraydata[index.row()][index.column()]) 
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyQt Licensing Issue

2009-12-08 Thread james infield
Hello,

That might be slightly off topic what do you mean by ...I won't be
including the source code... ?

Is that your code or PyQt code ?
Is there a way to release without giving your code and/or PyQt code ?

bimbam

2009/12/8 Prashant Saxena animator...@yahoo.com

 Hi,

 I am planning to release the beta version(Testing) of an application
 written using python+PyQt.
 I won't be including the source code with the installation. Do I have to
 purchase the PyQt commercial license now itself or I can purchase before
 releasing the commercial version. It'll surely take 2-3 months before I
 reach to final version and releasing
 the commercial version is purely based on the users opinion and success.

 Prashant



  The INTERNET now has a personality. YOURS! See your Yahoo! Homepage.
 http://in.yahoo.com/

 ___
 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] PyQt Licensing Issue

2009-12-08 Thread Richard Esplin
If you don't want to give away your code, you should buy the commercial license.

Richard

On Wed 9 December 2009 00:12:45 james infield bimba...@gmail.com wrote:
 Hello,
 
 That might be slightly off topic what do you mean by ...I won't be
 including the source code... ?
 
 Is that your code or PyQt code ?
 Is there a way to release without giving your code and/or PyQt code ?
 
 bimbam
snip
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt