|
|
2010-11-20
, 21:34
|
|
Posts: 1,179 |
Thanked: 770 times |
Joined on Nov 2009
|
#21
|
|
|
2010-11-20
, 22:59
|
|
Posts: 52 |
Thanked: 13 times |
Joined on Nov 2010
|
#22
|
| The Following User Says Thank You to maddude For This Useful Post: | ||
|
|
2010-11-22
, 04:25
|
|
|
Posts: 275 |
Thanked: 389 times |
Joined on Feb 2010
@ Sydney
|
#23
|
| The Following 4 Users Say Thank You to GreatGonzo For This Useful Post: | ||
|
|
2010-11-22
, 23:51
|
|
|
Posts: 275 |
Thanked: 389 times |
Joined on Feb 2010
@ Sydney
|
#25
|
|
|
2010-11-23
, 18:37
|
|
Posts: 25 |
Thanked: 3 times |
Joined on Aug 2010
|
#26
|
|
|
2010-11-23
, 19:13
|
|
|
Posts: 2,853 |
Thanked: 968 times |
Joined on Nov 2005
|
#27
|
This application is for use of qml as desktop widgets. If you want to run qml as separate applications you can use the qmlviewer which is in the package qt4-declarative-qmlviewer. Then just run the qmlviewer and load the qml file.
|
|
2010-11-23
, 22:22
|
|
|
Posts: 275 |
Thanked: 389 times |
Joined on Feb 2010
@ Sydney
|
#28
|
Sorry for the off-topic, but where does one find that package with the qmlviewer ? I don't see it anywhere...
apt-cache policy qt4-declarative-qmlviewer
qt4-declarative-qmlviewer:
Installed: 4.7.0~git20100909-0maemo1+0m5
Candidate: 4.7.0~git20100909-0maemo1+0m5
Version table:
*** 4.7.0~git20100909-0maemo1+0m5 0
500 https://downloads.maemo.nokia.com ./ Packages
100 /var/lib/dpkg/status
sudo gainroot apt-get install qt4-declarative-qmlviewer
| The Following User Says Thank You to GreatGonzo For This Useful Post: | ||
|
|
2010-11-23
, 22:30
|
|
|
Posts: 275 |
Thanked: 389 times |
Joined on Feb 2010
@ Sydney
|
#29
|
Great work, congratulations to the author. I see a lot of potential here.
|
|
2010-11-24
, 01:38
|
|
|
Posts: 275 |
Thanked: 389 times |
Joined on Feb 2010
@ Sydney
|
#30
|
import Qt 4.7
import QtWebKit 1.0
Item {
// Modify these to customize
// widget width
width: 300
// widget height
height: 350
// the url to display
property string url: "http://touch.facebook.com"
// the optimum width for the website. The page is scaled down
// from this width to the widget's width
property int optimal_width: 340
// interval when to reload the page
// setting it to 0 means never refresh
property real reload_in_minutes: 10
// end user mods.
id: main
MouseArea {
anchors.right: parent.right
width: 30
height: parent.height
onClicked: {
}
}
Rectangle {
anchors.fill: parent
radius: 10
color: "gray"
opacity: 0.6
}
Text {
id: txt
anchors.centerIn: parent
text: "loading..."
color: "white"
}
WebView {
id: browser
transformOrigin: Item.TopLeft
property bool scaled: false
smooth: true
visible: false
preferredWidth: optimal_width
preferredHeight: parent.height
url: parent.url
Behavior on y { PropertyAnimation {} }
onUrlChanged: {
y = 0
}
onLoadFinished: {
if (!scaled) {
browser.contentsScale = main.width/browser.width
scaled = true;
}
browser.visible = true
//console.log('loaded')
txt.z = 0
}
}
MouseArea {
anchors.right: parent.right
width: 30
height: parent.height
onClicked: {
var inc = main.height*0.9
if (mouse.y > main.height/2) {
var dy = Math.min(inc,
browser.contentsSize.height-main.height+browser.y)
browser.y -= dy
} else {
var dy = Math.min(inc, Math.abs(browser.y))
browser.y += dy
}
}
}
Timer {
id: refresh
interval: 1000*60*parent.reload_in_minutes
running: runtime.isActiveWindow
repeat: true
onTriggered: { txt.z = 1
browser.reload.trigger()
}
}
}