[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Strange behavior on windowCloseRequested on QWeView
From:       Thomaz de Oliveira dos Reis <thor27 () gmail ! com>
Date:       2011-10-19 18:36:13
Message-ID: CAAXmX-=St0HJKvTtP+2heUbjtwqquYZF-JwvtKwKUwVgyWCi5g () mail ! gmail ! com
[Download RAW message or body]

Hi,

I have this simple code:

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

def close(): sys.exit()

app = QApplication(sys.argv)

web = QWebView()
QObject.connect(web.page(),SIGNAL("windowCloseRequested ()"),close)

web.load(QUrl("a.html"))
web.show()

sys.exit(app.exec_())

and 2 more files, that is a.html:
<a href="b.html">link to B</a><br/>
<a href="#" onclick="window.close()">close this window</a>

and b.html:
<a href="a.html">link to A</a><br/>
<a href="#" onclick="window.close()">close this window</a>

When you load the app, and then clicks on "close this window" the window closes
But if you click on link to B and then click on "close this window"
the window doesn't closes.

Why this happens? There is any solution so this signals keep working
even after loading another URL?


thanks!
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic