[Qt-interest] Inserting a QTextBlock without inserting a newline

d3fault d3faultdotxbe at gmail.com
Tue Mar 8 10:11:33 CET 2011


I'm not sure I get what you mean by split the block. Do I remove the text to
fold from the "visible" text block and put it into another QTextBlock (that
QTextBlock is then hidden)??

What if I wanted to have this:

-Initial State:
word1 word2 word 3 word4

-"word2" is then clicked on, resulting in:
word1 [+] word3 word4

-clicking on the plus sign changes it back to word2. clicking on any of the
words converts them into pluses. they can all be folded up too, like this:
[+] [+] [+] [+]

This is what I mean by folding multiple texts on a single line. I also want
to be able to highlight the collapsed blocks with my cursor (the one your
mouse controls... not programmatically) and be able to copy the contents to
the clipboard, just like in Qt Creator.

Thanks for your response,
d3fault

On Tue, Mar 1, 2011 at 2:45 AM, Tony Rietwyk <tony.rietwyk at rightsoft.com.au>
wrote:
>
> Hi,
>
> No, to insert a fold, split the block at the position required.  To remove
a fold, join the two blocks together.
>
> But - I have no idea what 'using multiple folding texts on a single line'
means!  Can you explain more?
>
> Tony
>
>
> -----Original Message-----
> From: d3fault [mailto:d3faultdotxbe at gmail.com]
> Sent: Tuesday, 1 March 2011 11:28
> To: Tony Rietwyk
> Subject: Re: [Qt-interest] Inserting a QTextBlock without inserting a
newline
>
> So you're saying I need to maintain an internal copy of the qtextdocument
that's improperly formatted and convert between the two whenever something
happens? Sounds painful. There's gotta be an easier way. Dealing with user
edits also sounds like a pain... but maybe it sounds harder than it is. Is
this what you mean?
>
> Perhaps I should rephrase the question: how should I go about using
multiple folding texts on a single line? Is there an alternative to using
QTextBlocks?
>
> -d3fault
>
> On Mon, Feb 28, 2011 at 5:47 AM, Tony Rietwyk <
tony.rietwyk at rightsoft.com.au> wrote:
>>
>> HI,
>>
>> I think QTextBlock's correspond to paragraphs?  So each word and each
space is laid out vertically.  To unfold the words back into one line, you
would need to convert the spaces back into embedded text.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110308/9c1f1cc0/attachment.html 


More information about the Qt-interest-old mailing list