Re: [PyQt] Trigger mouse click on arbitrary coordinate using Webkit?

2010-07-27 Thread Albert Cervera i Areny
A Dimarts, 27 de juliol de 2010, Yao Ko va escriure:
 Hi,
 
 I'm using Qt Webkit to load a a webpage and interact with it.  Is
 there a way to programmatically trigger a mouse click given the X, Y
 coordinates of a webpage?
 
 So far, I was able to use QWebFrame.hitTestContent(QPoint) to get the
 QWebElement under the given QPoint.  However, the element is a Flash
 object, and I'd like to trigger a mouse click somewhere on that Flash
 object.
 
 Any suggestions?

I guess postEvent() or sendEvent() should do the trick.

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


-- 
Albert Cervera i Areny
http://www.NaN-tic.com
OpenERP Partners
Mòbil: +34 669 40 40 18

http://twitter.com/albertnan 
http://albert-nan.blogspot.com 
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] connect problem on windows xp

2010-07-27 Thread Fabio Mauri
Hi all, I'm trying to get an application run on both windows xp and ubuntu
10.04 platforms.
My app imports twisted, coherence and PyQt.
The problem is that under windows XP the signals seems not to be connected
to slots, even if the QObject.connect() returns True.
Clicking on buttons have no effect.
Any idea?

Thanks in advance.

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

Re: [PyQt] connect problem on windows xp

2010-07-27 Thread makhamisa senekane
Hi,
could you please provide us with your code, because I run most of my
applications on windows XP, and they work very well(using signal/slot
connections).

Makhamisa

On Tue, Jul 27, 2010 at 10:15 AM, Fabio Mauri fabio.ma...@gmail.com wrote:


 Hi all, I'm trying to get an application run on both windows xp and ubuntu
 10.04 platforms.
 My app imports twisted, coherence and PyQt.
 The problem is that under windows XP the signals seems not to be connected
 to slots, even if the QObject.connect() returns True.
 Clicking on buttons have no effect.
 Any idea?

 Thanks in advance.

 --
 Fabio Mauri

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




-- 
No trees were killed in the sending of this message. However a large number
of electrons were terribly inconvenienced. 
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] connect problem on windows xp

2010-07-27 Thread Fabio Mauri
Hi,

   the whole file is quite big, but I think that the following is the
interesting part (if you need something more, ask me and I'll post
it):

class UPnPgui(QtCore.QObject, Ui_Wdw):

    def __init__(self, sear):
    self.version = 0.5b
    self.s = sear
    self.serva = [] # services list
    self.timeout = 0
    self.val = QRegExpValidator(QRegExp([0-9]{1,7}), None)
    self.refreshing = False
    self.INTERNAL = 0
    self.EXTERNAL = 1
    self.MIN = 2
    self.MAX = 3
    self.t = None
    self.upSer = None
    self.unlock_t = None
    return

    def doConnections(self):
    self.updateThread = myUpdate()
    QObject.connect(self.refresh, SIGNAL(clicked()), self.refreshList)
    QObject.connect(self.clearSel, SIGNAL(clicked()), self.noneSelected)
    QObject.connect(self.auto_2, SIGNAL(stateChanged(int)),
self.manageAuto)
    QObject.connect(self.time, SIGNAL(editingFinished()), self.manageTime)
    self.objList.itemDoubleClicked.connect(self.showItem)
    self.updateThread.update.connect(self.autoRefresh)
    self.updateThread.newTimeout.connect(self.updateThread.updateTimeout)
    self.manageTime()
    self.manageAuto(Qt.Checked)
    # refreshing thread starts..
    self.updateThread.start()
    return

---

if __name__ == __main__:
s = Searcher()
searchThread = Thread(target=runSearcher, args=(s,))
searchThread.start()
app = QtGui.QApplication(sys.argv)
window = QtGui.QWidget()
ui = UPnPgui(s)
ui.setupUi(window)
ui.doConnections()
window.show()
window.geometry()
window.setWindowTitle(window.windowTitle() +  version  + ui.version)
sys.exit(runApp(app))



On Tue, Jul 27, 2010 at 10:20 AM, makhamisa senekane
makhamis...@gmail.com wrote:

 Hi,
 could you please provide us with your code, because I run most of my 
 applications on windows XP, and they work very well(using signal/slot 
 connections).
 Makhamisa

 On Tue, Jul 27, 2010 at 10:15 AM, Fabio Mauri fabio.ma...@gmail.com wrote:

 Hi all, I'm trying to get an application run on both windows xp and ubuntu 
 10.04 platforms.
 My app imports twisted, coherence and PyQt.
 The problem is that under windows XP the signals seems not to be connected 
 to slots, even if the QObject.connect() returns True.
 Clicking on buttons have no effect.
 Any idea?

 Thanks in advance.

 --
 Fabio Mauri

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



 --
 No trees were killed in the sending of this message. However a large number
 of electrons were terribly inconvenienced. 



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


[PyQt] PyQt Installer Does Not Run

2010-07-27 Thread Ben Thompson

Hi,

I just tried to install PyQt for Windows Vista 64 and Python 2.6. The 
latter is installed in the sense that I can type python at a prompt 
and get


ActivePython 2.6.4.10 (ActiveState Software Inc.) based on
Python 2.6.4 (r264:75706, Jan 22 2010, 17:24:21) [MSC v.1500 64 bit 
(AMD64)] on win32

Type help, copyright, credits or license for more information.

but when I try to install PyQt I get

This copy of PyQt has been built against Python v2.6 which doesn't seem 
to be installed.


I've googled a bit and looked in the searchable archives but can't see a 
solution.


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


Re: [PyQt] PyQt Installer Does Not Run

2010-07-27 Thread Phil Thompson
On Tue, 27 Jul 2010 11:42:51 +0100, Ben Thompson
p...@kilgore.demon.co.uk
wrote:
 Hi,
 
 I just tried to install PyQt for Windows Vista 64 and Python 2.6. The 
 latter is installed in the sense that I can type python at a prompt 
 and get
 
 ActivePython 2.6.4.10 (ActiveState Software Inc.) based on
 Python 2.6.4 (r264:75706, Jan 22 2010, 17:24:21) [MSC v.1500 64 bit 
 (AMD64)] on win32
 Type help, copyright, credits or license for more information.
 
 but when I try to install PyQt I get
 
 This copy of PyQt has been built against Python v2.6 which doesn't seem 
 to be installed.
 
 I've googled a bit and looked in the searchable archives but can't see a

 solution.

You would get that message if the installer couldn't find the
Software\Python\PythonCore\2.6\InstallPath registry key. I've no idea if
ActiveState messes with the registry.

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


Re: [PyQt] Issue with pyqtSlot(QModelIndex, QModelIndex)

2010-07-27 Thread Phil Thompson
On Tue, 27 Jul 2010 06:12:23 +0200, Sybren A. Stüvel syb...@stuvel.eu
wrote:
 Dear list,
 
 I've just upgraded from PyQt 4.6 (PyQt-Py2.6-gpl-4.6-1.exe) to version
 4.7.4 (PyQt-Py2.6-gpl-4.7.4-1.exe), and the upgrade introduced a crash
 in my program. I've narrowed it down to this example:
 
 from PyQt4 import QtCore, QtGui
 
 class Dialog(QtGui.QDialog):
 def __init__(self, parent=None):
 QtGui.QDialog.__init__(self, parent)
 
 self.resultsModel = QtGui.QStandardItemModel()
 self.resultsModel.appendRow(QtGui.QStandardItem('Item 1'))
 self.resultsModel.appendRow(QtGui.QStandardItem('Item 2'))
 self.resultsModel.appendRow(QtGui.QStandardItem('Item 3'))
 
 self.layout = QtGui.QVBoxLayout(self)
 self.resultsView = QtGui.QTreeView(self)
 self.resultsView.setModel(self.resultsModel)
 
 self.layout.addWidget(self.resultsView)
 
 smodel = self.resultsView.selectionModel()
 smodel.currentChanged.connect(self.on_change)
 
 @QtCore.pyqtSlot(QtCore.QModelIndex, QtCore.QModelIndex)
 def on_change(self, current, previous):
 print 'Changed from %s to %s' % (previous.row(),
current.row())
 
 app = QtGui.QApplication([])
 win = Dialog()
 win.show()
 app.exec_()
 
 The program crashes with this error:
 
 Traceback (most recent call last):
   File qttest.py, line 26, in module
 win = Dialog()
   File qttest.py, line 19, in __init__
 smodel.currentChanged.connect(self.on_change)
 TypeError: on_change() has no overload that is compatible with
 currentChanged(QModelIndex,QModelIndex)
 
 When I remove the @QtCore.pyqtSlot() decorator the code runs just
 fine. It's a workaround, but I would prefer a clearner solution, or at
 least an understanding as to the cause of the exception.
 
 The exception occurs when running on PyQt 4.7.4, Qt 4.6.2 and Python
 2.6 on Windows XP.
 
 The same code runs without error on PyQt 4.7.3, Qt 4.6.3 and Python
 2.6 on Ubuntu Linux.

Should be fixed in tonight's snapshot - a patch is attached if you can't
wait.

As this is a regression I'll make a new PyQt release in a few days - once
I've had confirmation that the fix doesn't cause any other problems.

Thanks for the test case,
Phildiff -r 17bbf4f4d4fc qpy/QtCore/qpycore_pyqtboundsignal.cpp
--- a/qpy/QtCore/qpycore_pyqtboundsignal.cpp	Sun Jul 25 21:51:46 2010 +0100
+++ b/qpy/QtCore/qpycore_pyqtboundsignal.cpp	Tue Jul 27 12:00:47 2010 +0100
@@ -617,8 +617,8 @@
 for (int ol = overload-parsed_arguments.count(); ol = 0; --ol)
 {
 // If there are decorations then we compare the signal's signature
-// against it so that we distinguish between Python types that are
-// passed to Qt as PyQt_PyObject objects.  Qt will not make the
+// against them so that we distinguish between Python types that
+// are passed to Qt as PyQt_PyObject objects.  Qt will not make the
 // distinction.  If there are no decorations then let Qt determine
 // if a slot is available.
 if (decorations)
@@ -669,17 +669,45 @@
 const Chimera *sig_arg = signal-parsed_arguments.at(a);
 const Chimera *slot_arg = slot-parsed_arguments.at(a);
 
-if (sig_arg-metatype() != slot_arg-metatype())
+// The same type names must be compatible.
+if (sig_arg-name() == slot_arg-name())
+continue;
+
+enum Match {
+// The type is PyQt_PyObject because it was explicitly
+// specified as such as a string.
+MatchesAll,
+
+// The type is PyQt_PyObject because it was specified as a type
+// object that needed wrapping.
+MatchesPyType,
+
+// The type is something other than PyQt_PyObject.
+MatchesName
+};
+
+Match sig_match, slot_match;
+
+if (sig_arg-name() != PyQt_PyObject)
+sig_match = MatchesName;
+else
+sig_match = sig_arg-py_type() ? MatchesPyType : MatchesAll;
+
+if (slot_arg-name() != PyQt_PyObject)
+slot_match = MatchesName;
+else
+slot_match = slot_arg-py_type() ? MatchesPyType : MatchesAll;
+
+// They are incompatible unless one is called PyQt_PyObject.
+if (sig_match == MatchesName || slot_match == MatchesName)
 break;
 
-if (sig_arg-metatype() != PyQt_PyObject::metatype)
+// They are compatible if neither was a Python type.
+if (sig_match == MatchesAll || slot_match == MatchesAll)
 continue;
 
-// See if the slot type was 'PyQt_PyObject'.
-if (!slot_arg-py_type())
-continue;
-
-  

Re: [PyQt] Issue with pyqtSlot(QModelIndex, QModelIndex)

2010-07-27 Thread Sybren A . Stüvel
On Tue, Jul 27, 2010 at 12:05:34PM +0100, Phil Thompson wrote:
 Should be fixed in tonight's snapshot - a patch is attached if you
 can't wait.
 
 As this is a regression I'll make a new PyQt release in a few days -
 once I've had confirmation that the fix doesn't cause any other
 problems.

Excellent, thanks!

-- 
Sybren Stüvel

http://stuvel.eu/


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

Re: [PyQt] Rapid GUI Programming with Python and Qt

2010-07-27 Thread Hans-Peter Jansen
On Thursday 22 July 2010, 12:29:50 projet...@club-internet.fr wrote:
 Hello,

  I certainly hope to cover WebKit.

  You'll make an happy man... ;-)

  You mean a binary package I guess... that's one for Phil:-)

 Yes.

You might want to compile it yourself now, _and_ make notes for every 
decision, it takes (which arch, which MacOS, cocoa or carbon, universal 
binaries or not and permutate that with different Python, Qt and PyQt build 
variants).

Now, if Phil would want to produce binary support for MacOS, he would had to 
make many choices, only to harvest whining users, because the concrete 
variant, they _instantly_ need, is missing. Be assured, that those users 
will have all valid reasons on why they need that special combination, that 
is missing.. 

The PySide guys might make these decisions for you one day for one or two 
MacOS releases (wasting tears), before they quit that...

Binary Mac support is a task with Don Quijoteoresce dimensions.

See, Christophe, even _you_ don't want Phil to do that, if you're really 
interested in advances of sip, PyQt and dip themselves.

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


Re: [PyQt] Rapid GUI Programming with Python and Qt

2010-07-27 Thread Jan Haag
 Now, if Phil would want to produce binary support for MacOS, he would had to 
 make many choices, only to harvest whining users, because the concrete 
 variant, they _instantly_ need, is missing. Be assured, that those users 
 will have all valid reasons on why they need that special combination, that 
 is missing.. 

Besides, the issue has already been discussed on this mailinglist and,
so far, been dismissed as a hopeless task: It would require four
different builds to be maintained at the very least, six if we wanted
support for 10.4; even more if we wanted support for more than the
latest python.org builds.

Jan


0x1665A74C.asc
Description: application/pgp-keys


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

[PyQt] Subclassing QTableView

2010-07-27 Thread Dom
Hi-

I've been having a problem the last few days retaining the visibility of
selection highlighting on a table cell when the window containing a
qtableview loses focus, I assume that to disable this I'll need to
subclass the qtableview widget, once I've done that what attributes do I
need to change?

Thanks

dom

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

[PyQt] question about dip plugins

2010-07-27 Thread Darren Dale
The dip documentation at
http://www.riverbankcomputing.com/static/Docs/dip/plugins_tutorial.html
mentions:

... When a plugin requests a service the plugin manager will choose
which service is actually used. The plugin does not care about the
particular service, its only concern is that it has an object that
implements the interface. ...

I am starting work on a project that will simulate spectra based on
physical reference data. There are several databases to choose from,
so in a sense the task is similar to the recipe chooser example in the
plugins tutorial. I would like to be able to compare the results of
one recipe with the next. Is it possible for the client to request a
particular service or plugin, rather than simply accept whatever the
plugin manager decides to provide?

Also, from the same tutorial:

@implements(IPlugin)
class RecipeChooserPlugin(Plugin):

Why is it necessary to decorate subclasses of Plugin with
@implements(IPlugin)? Are there cases when subclasses of Plugin would
not implement the IPlugin interface?

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