[SOLVED] How can I link an image to a particular website in QML?
-
[quote author="sierdzio" date="1341295789"]I suspect there might be some priority conflict. Why does z equal "-1"? Try making it a bit higher and see if it works.[/quote]
Hey I tried to increase the z value like u said, but it didn't work either.
I am using the default library com.nokia.symbian 1.1.
Does that affect the usage of Qt.openUrlExternally("http://qt.nokia.com")? -
No, but it might affect if the mouse area is active at all. Did you check that the onClicked method of the MouseArea is triggered? If not, please check, and report back.
-
[quote author="Andre" date="1341400959"]No, but it might affect if the mouse area is active at all. Did you check that the onClicked method of the MouseArea is triggered? If not, please check, and report back.[/quote]
how do i check whether it is triggered? call another function and print out something when i click on the image?
-
[quote author="mkhpad" date="1341297064"]Hi Honey,
You can use QWebview and call the URl as below:@
WebView {
id:hg
url: "http://qt.nokia.com"
preferredHeight: 600
preferredWidth : 360
smooth: false}
@
and in the click event of the image(better use button and attach the image) write the coding to link the the QWebview in the same page or in a new page.
You also need to include @import QtWebKit 1.0@ in the .qml page.
Regards,
Harish[/quote]Thanks Harish. I will give this method a try as well. :)
-
[quote author="honeyhong" date="1341807975"][quote author="Andre" date="1341400959"]No, but it might affect if the mouse area is active at all. Did you check that the onClicked method of the MouseArea is triggered? If not, please check, and report back.[/quote]
how do i check whether it is triggered? call another function and print out something when i click on the image?[/quote]
Yes, exactly. That is how the "documentation":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedebugging.html explains it also. -
[quote author="Andre" date="1341840581"]
[quote author="honeyhong" date="1341807975"][quote author="Andre" date="1341400959"]No, but it might affect if the mouse area is active at all. Did you check that the onClicked method of the MouseArea is triggered? If not, please check, and report back.[/quote]how do i check whether it is triggered? call another function and print out something when i click on the image?[/quote]
Yes, exactly. That is how the "documentation":http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedebugging.html explains it also.[/quote]
gave it a check and yeah it is definitely activated. i changed the path to another qml page that contain WebView and the url to the webpage instead, and it worked. the page loaded.
thank you all for the help. :)but somehow, it just would not load with Qt.openUrlExternally(“http://qt.nokia.com”). any idea why?
-
Perhaps you do not have a default webbrowser registered on your system? Not sure at all about that though.
-
I do. I am using Firefox.
Well, at least managed to get the page to load by combining both methods posted above.Anyway, thanks for your help! :)
-
Hey all. I just managed to get my hands on a Nokia phone to test my application out. Turned out, actually these codes worked perfectly fine. It didn't work in the simulator, but in the phone it could open the web externally. Finally! Thank you all. :)
@onClicked:Qt.openUrlExternally("http://qt.nokia.com")
@ -
Ah, thanks for reporting back on that!
-
[quote author="Andre" date="1343033414"]Ah, thanks for reporting back on that![/quote]
Sure. Thank you again for your help :)