Re: [PyQt] PyQt for 64-bit Python on Windows

2009-02-17 Thread V. Armando Sole

Hello,

At 12:26 16/02/2009 -0800, Matt Newell wrote:

Qt and PyQt work fine with 64 bit windows but I've been unable to get a
working Qt so far with mingw-w64.  I've had success with visual studio 2005
and could provide installers.  I will need a few days though as I am busy
with other things atm.


I just wanted to add a comment. Considering python 2.6 is supplied compiled 
with VS2008, perhaps you should consider using VS2008 express edition 
instead of VS2005. It is also free and better packaged than the 2005 version.


If you are talking about a binary for python 2.5 then, please, forget about 
my comment.


Best regards,

Armando 



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


[PyQt] (no subject)

2009-02-17 Thread projetmbc
 Hello, 
 is it possible to define a ContextMenu for a TreeView ? 

Yes, just override QWidget.contextMenuEvent for the view. 

Doug. 


Thanks but then I have a problem.
How can I know that the mouse is over the TreeView ?

Christophe.


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


[PyQt] Re : ContextMenu in TreeView

2009-02-17 Thread projetmbc
 Hello, 
 is it possible to define a ContextMenu for a TreeView ? 

Yes, just override QWidget.contextMenuEvent for the view. 

Doug. 


Thanks but then I have a problem. 
How can I know that the mouse is over the TreeView ? 

Christophe. 


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


Re: [PyQt] PyQt for 64-bit Python on Windows

2009-02-17 Thread Matt Newell
On Tuesday 17 February 2009 00:23:45 V. Armando Sole wrote:
 Hello,

 At 12:26 16/02/2009 -0800, Matt Newell wrote:
 Qt and PyQt work fine with 64 bit windows but I've been unable to get a
 working Qt so far with mingw-w64.  I've had success with visual studio
  2005 and could provide installers.  I will need a few days though as I am
  busy with other things atm.

 I just wanted to add a comment. Considering python 2.6 is supplied compiled
 with VS2008, perhaps you should consider using VS2008 express edition
 instead of VS2005. It is also free and better packaged than the 2005
 version.

 If you are talking about a binary for python 2.5 then, please, forget about
 my comment.

 Best regards,

 Armando

So far I have compiled against python 2.5 with vs2005.   I do plan to compile 
against 2.6, so I will use vs2008 for that.  Ultimately I would like to have 
all versions built with mingw-w64 but there was a gcc bug causing a crash 
when instantiating QCoreApplication with the version I tried.  This bug may 
have been fixed in the meantime so I will hopefully have it working in the 
near future.

Phil, would you be willing to host the installers?

Matt



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


[PyQt] Quick question concerning protected member functions

2009-02-17 Thread Christophe Diericx
Hello all, 

I have posted a simple code example concerning my question here:
http://paste.pocoo.org/show/104256/.
It fails with a RuntimeError: no access to protected functions or
signals for objects not created from Python.

I understand that this is in the documentation
(http://riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#access-
to-protected-member-functions) and that this could probably solved in
this specific case by buiding a QLineEdit from Python and inserting it
into the QComboBox with setLineEdit().

But still, I was wondering:

* Does this happen with every C++ protected function /emitting of
signals or just in some cases?
* Is this scheduled to be possible in some future version of the
bindings or are there some intricate difficulties involved?

Thanks in advance.

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


Re: [PyQt] Quick question concerning protected member functions

2009-02-17 Thread Phil Thompson
On Tue, 17 Feb 2009 10:44:01 +0100, Christophe Diericx
christophe.dier...@natuurpunt.be wrote:
 Hello all, 
 
 I have posted a simple code example concerning my question here:
 http://paste.pocoo.org/show/104256/.
 It fails with a RuntimeError: no access to protected functions or
 signals for objects not created from Python.
 
 I understand that this is in the documentation
 (http://riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#access-
 to-protected-member-functions) and that this could probably solved in
 this specific case by buiding a QLineEdit from Python and inserting it
 into the QComboBox with setLineEdit().
 
 But still, I was wondering:
 
 * Does this happen with every C++ protected function /emitting of
 signals or just in some cases?

All cases.

 * Is this scheduled to be possible in some future version of the
 bindings or are there some intricate difficulties involved?

It's not possible without abusing C++. Those abuses may or may not be safe.

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


Re: [PyQt] (no subject)

2009-02-17 Thread Arnold Krille
On Tuesday 17 February 2009 10:18:13 projet...@club-internet.fr wrote:
 Thanks but then I have a problem.
 How can I know that the mouse is over the TreeView ?

Because the contextMenuEvent of the TreeView is only triggered when the mouse 
is over the treeview.
And you can always check whether the mouse-coordinates given in the event are 
inside your widget.

Arnold


signature.asc
Description: This is a digitally signed message part.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

RE: [PyQt] Quick question concerning protected member functions

2009-02-17 Thread Christophe Diericx
Ok, thanks a lot for this extremely fast and concise answer (and for
your great work on PyQT). 

For the moment i haven't had any real showstopper needs for these
protected member functions but it's nice to know why they behave the way
they do.

Cheers,

Christophe

-Oorspronkelijk bericht-
Van: Phil Thompson [mailto:p...@riverbankcomputing.com] 
Verzonden: dinsdag 17 februari 2009 10:50
Aan: Christophe Diericx
CC: pyqt@riverbankcomputing.com
Onderwerp: Re: [PyQt] Quick question concerning protected member
functions

On Tue, 17 Feb 2009 10:44:01 +0100, Christophe Diericx
christophe.dier...@natuurpunt.be wrote:
 Hello all,
 
 I have posted a simple code example concerning my question here:
 http://paste.pocoo.org/show/104256/.
 It fails with a RuntimeError: no access to protected functions or 
 signals for objects not created from Python.
 
 I understand that this is in the documentation
 (http://riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#acces
 s-
 to-protected-member-functions) and that this could probably solved in 
 this specific case by buiding a QLineEdit from Python and inserting it

 into the QComboBox with setLineEdit().
 
 But still, I was wondering:
 
 * Does this happen with every C++ protected function /emitting of 
 signals or just in some cases?

All cases.

 * Is this scheduled to be possible in some future version of the 
 bindings or are there some intricate difficulties involved?

It's not possible without abusing C++. Those abuses may or may not be
safe.

Phil

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


[PyQt] problem with main window opacity (signalslot)

2009-02-17 Thread Gabriele Visconti
Hello everybody,

I'm experimenting with PyQt, trying to learn it, and I'm a bit stuck with
Signals and Slots. I don't usually like just to repeat the examples you find
in tutorials and guides because I think it's more useful for learning to
experiment concepts by yourself. Tutorials usually teach you doing the most
basic things which, once learnt, nearly never apply to your personal
situation or usage.
What I want to do is to replicate the KDE effect, you know that when you
grab a window and drag it around the window temporary becomes transparent
(low alpha).
I found the relevant Qt class which is setWindowOpacity(), I tried to build
a signal-slot system which when the left mouse is pressed on the main widget
(i.e. for dragging it around) the widget will become transparent.
I can't obtain this effect. There's no traceback error it simply does
nothing. Of course I missed something important. Any suggestion or help to
solve my problem.
Thanks a lot.
Here below my code.

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *

class WizAndChipsCal(QWidget):

def __init__(self, parent = None):
QWidget.__init__(self)
self.setWindowTitle(Wiz and Chips Calendar)
self.setWindowIcon(QIcon(C:/Python26/PyQt/Icon/date.png))
self.setToolTip(Hello to this Wiz and Chips fancy
calendar!)
self.connect(self,
 SIGNAL(QMouseEvent()),
 self.Opacity)

self.title = (font color=red size=3b\
  + Wiz and Chips Pushable Calendar!\
  + /font/b)
self.Label = QLabel(self.title)
self.Label.setAlignment(Qt.AlignCenter | Qt.AlignJustify)

self.calendar = QCalendarWidget()
self.calendar.setGridVisible(1)
self.calendar.setMinimumHeight(180)
self.calendar.setMinimumWidth(110)

self.check1 = QCheckBox(check1)
self.check2 = QCheckBox(check2)
self.TextBox = QTextEdit(type something here)
self.TextBox.setMaximumHeight(50)

self.dateLabel = QLabel(Date:)
self.dateLabel.setMaximumWidth(80)
CurrDate = QDate.currentDate()
self.date = QDateEdit(CurrDate)
self.date.setMaximumWidth(80)

self.CloseButton = QPushButton(Quit)
self.CloseButton.setToolTip(font color=red size=2b +
Press here to Quit + /font/b)
self.CloseButton.setMaximumSize(50, 25)

self.infobox = QGroupBox(Info Box)
self.infobox.setCheckable(1)
self.infobox.setChecked(0)

dateLayout = QHBoxLayout()
dateLayout.addWidget(self.dateLabel)
dateLayout.addWidget(self.date)
dateLayout.addSpacing(170)

GBoxLayout = QVBoxLayout(self.infobox)
GBoxLayout.setSpacing(1)
GBoxLayout.addLayout(dateLayout)
GBoxLayout.addWidget(self.check1)
GBoxLayout.addWidget(self.check2)
GBoxLayout.addWidget(self.TextBox)

Layout = QGridLayout()
Layout.addWidget(self.Label, 0, 0)
Layout.addWidget(self.calendar, 1, 0)
Layout.addWidget(self.CloseButton, 4, 0)
Layout.addWidget(self.infobox, 3, 0)
self.setLayout(Layout)
self.connect(self.CloseButton,
 SIGNAL(pressed()),
 self.close)

def Opacity(self):
while QMouseEvent(Qt.LeftButton):
self.setWindowOpacity(0.5)
else:
pass
app = QApplication(sys.argv)
main_window = WizAndChipsCal()
main_window.show()
app.exec_()
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

RE: [PyQt] problem with main window opacity (signalslot)

2009-02-17 Thread Christophe Diericx
I'd do something like the following: forget about the signals, but just
reimplement the moveEvent for the widget.

Something like this:

def moveEvent(self, event):
if self.isVisible():
self.setWindowOpacity(0.5)
QTimer.singleShot(1000, functools.partial(self.setWindowOpacity,
1))

Complete code example: http://paste.pocoo.org/show/104298/

 


Van: pyqt-boun...@riverbankcomputing.com
[mailto:pyqt-boun...@riverbankcomputing.com] Namens Gabriele Visconti
Verzonden: dinsdag 17 februari 2009 15:48
Aan: pyqt@riverbankcomputing.com
Onderwerp: [PyQt] problem with main window opacity (signalslot)


Hello everybody,

I'm experimenting with PyQt, trying to learn it, and I'm a bit stuck
with Signals and Slots. I don't usually like just to repeat the examples
you find in tutorials and guides because I think it's more useful for
learning to experiment concepts by yourself. Tutorials usually teach you
doing the most basic things which, once learnt, nearly never apply to
your personal situation or usage.
What I want to do is to replicate the KDE effect, you know that when you
grab a window and drag it around the window temporary becomes
transparent (low alpha). 
I found the relevant Qt class which is setWindowOpacity(), I tried to
build a signal-slot system which when the left mouse is pressed on the
main widget (i.e. for dragging it around) the widget will become
transparent.
I can't obtain this effect. There's no traceback error it simply does
nothing. Of course I missed something important. Any suggestion or help
to solve my problem.
Thanks a lot.
Here below my code.

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


Re: [PyQt] problem with main window opacity (signalslot)

2009-02-17 Thread David Boddie
On Tue Feb 17 14:47:45 GMT 2009, Gabriele Visconti wrote:

 What I want to do is to replicate the KDE effect, you know that when you
 grab a window and drag it around the window temporary becomes transparent
 (low alpha).
 I found the relevant Qt class which is setWindowOpacity(), I tried to build
 a signal-slot system which when the left mouse is pressed on the main
 widget (i.e. for dragging it around) the widget will become transparent.

One thing to check before trying this is that it is actually possible to make
windows transparent on your system. Lots of people want to try out the window
opacity feature without realising that you need to be running a window manager
that supports it, amongst other things:

  http://doc.trolltech.com/4.4/qwidget.html#windowOpacity-prop

In addition, you need to make sure it is enabled. If you already see other
applications doing things with transparency then it probably is possible to
use PyQt for this as well.

One point to make about the code is that events are not signals:

  self.connect(self, SIGNAL(QMouseEvent()), self.Opacity)

You need to reimplement the event handler related to the event you want to
deal with. So, in this case, you would reimplement QWidget.moveEvent() in
your subclass, as Christophe explains in another message. (The mouse event
handlers are a distraction in this particular situation.)

So, the method/slot you define needs to be written as an event handler
(again, see Christophe's message) and won't work as it is:

  def Opacity(self):
  while QMouseEvent(Qt.LeftButton):
  self.setWindowOpacity(0.5)
  else:
  pass

It's interesting to look at this method because I think it says something
about how you expected events to be handled. If you don't mind me asking,
have you used other frameworks or toolkits extensively?

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


[PyQt] Problem compiling SIP

2009-02-17 Thread Francis Brissette
Hello,

I have installed MSVC2008 and Python26 on my Windows XP x64 machine but I have 
link errors while compiling SIP.

Here what I have:

C:\sip-4.7.9python configure.py
This is SIP 4.7.9 for Python 2.6.1 on win32.
The SIP code generator will be installed in C:\Python26.
The SIP module will be installed in C:\Python26\Lib\site-packages.
The SIP header file will be installed in C:\Python26\include.
The default directory to install .sip files in is C:\Python26\sip.
The platform/compiler configuration is win32-msvc2008.
Creating sipconfig.py...
Creating top level Makefile...
Creating sip code generator Makefile...
Creating sip module Makefile...

C:\sip-4.7.9nmake
... (it's compiling) ...
   Creating library sip.lib and object sip.exp
siplib.obj : error LNK2019: unresolved external symbol __imp___Py_NoneStruct 
referenced in function _setTraceMask
qtlib.obj : error LNK2001: unresolved external symbol __imp___Py_NoneStruct
threads.obj : error LNK2001: unresolved external symbol __imp___Py_NoneStruct
siplib.obj : error LNK2019: unresolved external symbol __imp__PyArg_ParseTuple 
referenced in function _setTraceMask
... (other similar link errors) ...

Do you have any idea how to fix these link errors ?

Thanks,
Francis

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

Re: [PyQt] Problem compiling SIP

2009-02-17 Thread Matt Newell
On Tuesday 17 February 2009 12:06:30 Francis Brissette wrote:
 Hello,

 I have installed MSVC2008 and Python26 on my Windows XP x64 machine but I
 have link errors while compiling SIP.

 Here what I have:

 C:\sip-4.7.9python configure.py
 This is SIP 4.7.9 for Python 2.6.1 on win32.
 The SIP code generator will be installed in C:\Python26.
 The SIP module will be installed in C:\Python26\Lib\site-packages.
 The SIP header file will be installed in C:\Python26\include.
 The default directory to install .sip files in is C:\Python26\sip.
 The platform/compiler configuration is win32-msvc2008.
 Creating sipconfig.py...
 Creating top level Makefile...
 Creating sip code generator Makefile...
 Creating sip module Makefile...

 C:\sip-4.7.9nmake
 ... (it's compiling) ...
Creating library sip.lib and object sip.exp
 siplib.obj : error LNK2019: unresolved external symbol
 __imp___Py_NoneStruct referenced in function _setTraceMask qtlib.obj :
 error LNK2001: unresolved external symbol __imp___Py_NoneStruct threads.obj
 : error LNK2001: unresolved external symbol __imp___Py_NoneStruct
 siplib.obj : error LNK2019: unresolved external symbol
 __imp__PyArg_ParseTuple referenced in function _setTraceMask ... (other
 similar link errors) ...

 Do you have any idea how to fix these link errors ?

 Thanks,
 Francis

Are you sure the first python26.dll the linker is finding is 64 bit?


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