Modifyed declarative test to avoi use of network.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
This commit is contained in:
parent
e1d1a0cbd1
commit
4e6d901bf8
2 changed files with 13 additions and 11 deletions
|
|
@ -40,8 +40,16 @@
|
||||||
|
|
||||||
import Qt 4.7
|
import Qt 4.7
|
||||||
|
|
||||||
Image {
|
Rectangle {
|
||||||
width: 100
|
id: page
|
||||||
height: 100
|
width: 500; height: 200
|
||||||
source: "http://qt.nokia.com/logo.png"
|
color: "lightgray"
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: helloText
|
||||||
|
text: "Hello world!"
|
||||||
|
y: 30
|
||||||
|
anchors.horizontalCenter: page.horizontalCenter
|
||||||
|
font.pointSize: 24; font.bold: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -8,11 +8,6 @@ from PySide.QtNetwork import QNetworkAccessManager
|
||||||
|
|
||||||
from helper import adjust_filename, TimedQApplication
|
from helper import adjust_filename, TimedQApplication
|
||||||
|
|
||||||
class MyNetworkAccessManagerFactory(QDeclarativeNetworkAccessManagerFactory):
|
|
||||||
def create(self, parent):
|
|
||||||
nam = QNetworkAccessManager(parent)
|
|
||||||
return nam
|
|
||||||
|
|
||||||
class TestQDeclarativeNetworkFactory(TimedQApplication):
|
class TestQDeclarativeNetworkFactory(TimedQApplication):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
@ -21,9 +16,8 @@ class TestQDeclarativeNetworkFactory(TimedQApplication):
|
||||||
def testQDeclarativeNetworkFactory(self):
|
def testQDeclarativeNetworkFactory(self):
|
||||||
view = QDeclarativeView()
|
view = QDeclarativeView()
|
||||||
|
|
||||||
url = QUrl.fromLocalFile(adjust_filename('network.qml', __file__))
|
url = QUrl.fromLocalFile(adjust_filename('hw.qml', __file__))
|
||||||
|
|
||||||
view.engine().setNetworkAccessManagerFactory(MyNetworkAccessManagerFactory())
|
|
||||||
view.setSource(url)
|
view.setSource(url)
|
||||||
view.show()
|
view.show()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue