requestinfo.qml Example File
httptest/assets/requestinfo.qml
import bb.cascades 1.0
import Network.RequestHeaders 1.0
import "controls"
import my.library 1.0
Page {
Container {
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///images/background.png"
}
Container {
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
leftPadding: 50
TextArea {
id: headers
visible: false
editable: false
backgroundVisible: false
text: qsTr("Retrieving Headers")
textStyle {
base: SystemDefaults.TextStyles.BodyText;
color: Color.White
}
}
}
NetworkActivity {
id: progressIndicator
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
title: qsTr("Retrieving Headers")
}
attachedObjects: [
QTimer {
id: timer
interval: 1000
onTimeout: {
netheaders.getRequest();
}
},
RequestHeaders {
id : netheaders
onComplete :{
progressIndicator.active = false;
progressIndicator.visible = false;
headers.text = info;
headers.visible = true;
timer.stop();
}
}
]
onCreationCompleted: {
progressIndicator.active = true;
timer.start();
}
}
}