|
|
2011-02-21
, 17:14
|
|
Posts: 324 |
Thanked: 371 times |
Joined on Dec 2009
@ Vancouver, BC
|
#2
|
| The Following 2 Users Say Thank You to Slocan For This Useful Post: | ||
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:
Item { id: delegate height: column.height + 40 width: delegate.ListView.view.width Column { id: column x: 20; y: 20 width: parent.width - 40 signal selected Text { id: titleText text: title; width: parent.width; wrapMode: Text.WordWrap; //Some formatting to change colour based on category is here... MouseArea { id: mouseArea anchors.fill: parent onClicked: onClicked: {column.selected(); console.log (link); //QDesktopServices::OpenUrl (link); } } } Text { id: descriptionText width: parent.width; text: description wrapMode: Text.WordWrap; font { family: "Helvetica"; pointSize: {if (title == "Info") return 8 else return 16} } color: "white" } } Rectangle { width: parent.width; height: 1; color: "#cccccc" anchors.bottom: parent.bottom } }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.
Last edited by alynsparkes; 2011-02-21 at 17:16.