Change mouse pointer while loading a page with QtWebKit

427 views
Skip to first unread message

Andy

unread,
Dec 13, 2012, 12:21:55 PM12/13/12
to pyqt-...@googlegroups.com
Hi guys!

Is there a way to make the mouse pointer/cursor change of shape -for example into an hourglass- like Google Chrome does when it's taking a little time to load a page?

The purpose is to give a visual signal to the user that loading the page is taking a little time, and there's no need to click on the link again.

I've checked the demo that came with PyQt, but even its sample web browser doesn't change the shape of the mouse pointer.  I've also been Googling for a while and I believe that QCursor must come in to the mix, but I haven't found any sample that uses both QtWebKit and QCursor.

I'm using PyQt 4.9.5 with Python 2.6.6 on Windows 7 64 bit.

Thank you!
Andy

zw g

unread,
Jan 4, 2013, 10:06:11 AM1/4/13
to Andy, pyqt-pyside
Hi Andy,

I'm not sure if this can help:


===========================

To associate a cursor with a widget, use QWidget.setCursor(). To associate a cursor with all widgets (normally for a short period of time), use QApplication.setOverrideCursor().

To set a cursor shape use QCursor.setShape() or use the QCursor constructor which takes the shape as argument, or you can use one of the predefined cursors defined in the Qt.CursorShape enum.

If you want to create a cursor with your own bitmap, either use the QCursor constructor which takes a bitmap and a mask or the constructor which takes a pixmap as arguments.

To set or get the position of the mouse cursor use the static methods QCursor.pos() and QCursor.setPos().

Note: It is possible to create a QCursor before QApplication, but it is not useful except as a place-holder for a real QCursor created after QApplication. Attempting to use a QCursor that was created before QApplication will result in a crash.

===========================


Maybe you can set the cursor for the widget you're using, then define some signals & slots. 

After you capture the link-click signal, then you set the shape of the cursor.

Hope this helps.


Gui


Gui


Andy

--
PyQt & PySide的交流信息:
 
QQ群号: 143061743
邮件列表: pyqt-...@googlegroups.com
---
您收到此邮件是因为您订阅了 Google 网上论坛的“PyQt & PySide”论坛。
要向此网上论坛发帖,请发送电子邮件至 pyqt-...@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 pyqt-pyside...@googlegroups.com
通过以下网址访问此论坛:http://groups.google.com/group/pyqt-pyside?hl=zh-CN。
 
 

Reply all
Reply to author
Forward
0 new messages