![]() |
Opening web link from QML (QT Quick)
Hi,
I'm trying to get to grips with QT, c++ and QML all at the same time, so please bear with me. I have been modifying the RSSNews project that come included with the Nokia QT SDK 1.1 (and possibly others, but that's where I found it). I've got it doing almost exactly what I've decided is my target except for one thing. I can't get it to follow the <link> tags from the rss feeds. I've modified it so that it goes to some other feeds, one of which is a list of PDF files. I figured that rather than trying to get Poppler working, I could just pass out the link in the feed to MicroB using: Code:
QDesktopServices::OpenUrl (QUrl(link)) Code:
Item { I've tried reading up about signals and slots, on the assumption that I need to pass a signal about the mouse click back to a slot in the main.cpp, but I've got completely lost and can't see how to apply what I've read to my situation. Please can someone help me get this back on track? Many thanks, Alyn. |
Re: Opening web link from QML (QT Quick)
You'd need to either:
- create a C++ object with the required function, and declare it to your QML script so you can call that function - emit a signal in QML, and link it to a slot in your C++ classes Or more easily, use : http://doc.trolltech.com/4.7/qml-qt....ernally-method so, just replace what you had with: Qt.openUrlExternally(link) |
All times are GMT. The time now is 21:57. |
vBulletin® Version 3.8.8