Re: [SailfishDevel] Wanting to port my app, QML questions (TextArea)

2013-09-18 Thread Knight Andrew
Hi Mark,

Text[1] does indeed support rich text and links, and by extension so do Silica 
text components. The text property is just get/set though - so if you add to it 
(i.e. += ), there may be some extra overhead of reprocessing the entire string. 
Alternatively, you can modify the document itself (the textDocument property) 
[2], but this is unsupported even though it works.

This would be a good use case for a ListView[3] and a Text item as a delegate. 
Each time a new text line comes in, you just add it to your model. The ListView 
only creates a new delegate for the new text, and view can be programmed to 
scroll away. Delegate instances that leave the view are deleted by default 
until they come back into view.

[1] http://doc-snapshot.qt-project.org/qt5-stable/qtquick/qml-qtquick2-text.html
[2] 
http://doc-snapshot.qt-project.org/qt5-stable/qtquick/qquicktextdocument.html
[3] 
http://doc-snapshot.qt-project.org/qt5-stable/qtquick/qml-qtquick2-listview.html


HTH,
ak


From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of m...@faultycode.com [m...@faultycode.com]
Sent: Wednesday, September 18, 2013 2:53 PM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] Wanting to port my app, QML questions (TextArea)

Hi Everyone,

I have written an IRC client for iOS over the last years, and I am at a
point where I'd like to choose a second platform to port my app over to.
I've always been fond of Qt, but lost interest in it when Nokia
switched to windows phone. Thus, I never got around to learning QML,
which means I only have knowledge of making GUI's with QWidgets.
However, now with Jolla, I'm really interested in starting my port.

I have a few questions/concerns before I start porting.

On the iOS side of things, I paste all my IRC messages into a textView
(UITextView for the people here that know).
As of iOS 7, I use the new TextKit features. That is, I can take a
message coming from the TCP socket, make an Attributed String out of it
(I guess a rich string in the Qt world), apply colours, underlining,
bold etc to specific words depending on the colour codes in the message,
then finally append it to the textView.

I've been skimming through the QML components for Sailfish, and I've
found the TextArea component. There is a string property to it, but I
don't know if I can simply append data to it (specifically rich text
data). It seems to me it's either read, or set.

Is the TextArea string property modifiable, or is it immutable? If it's
immutable, then perhaps I need to look at webkit.
Secondly, the textView in iOS is capable of having URL links applied to
ranges of text. Is that also possible with TextArea?

In general, I prefer not to use Webkit, since my html and javascript
skills are really lacking. Hence why I have been using rich text editing
in my iOS app. However, if there is no other possibility, then I just
might have to go the webkit route.

Those are my biggest questions really. QML is completely new to me, but
seems like a fun and powerful thing to learn.

Thanks for you help,

-Mark
___
SailfishOS.org Devel mailing list
___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] Using QJson in Sailfish OS

2013-08-19 Thread Knight Andrew
___
From: devel-boun...@lists.sailfishos.org [devel-boun...@lists.sailfishos.org] 
on behalf of Dimitris [sarlis@gmail.com]
Sent: Monday, August 19, 2013 2:53 PM
To: devel@lists.sailfishos.org
Subject: [SailfishDevel] Using QJson in Sailfish OS

Hello!

I am trying to use QJson in my app. But I don't know what I should do to 
install QJson and how I can use it afterwards. I followed the instructions 
herehttps://lists.sailfishos.org/pipermail/devel/2013-June/000352.html but it 
doesn't seem to work.

Cheers,
Dimitris


Why not use the JSON support built into QtCore? 
https://qt-project.org/doc/qt-5.1/qtcore/qjsondocument.html
No extra packages/linking required.

-AK
___
SailfishOS.org Devel mailing list