Qt-interest Archive, August 2006
Re: QTextEdit/QTextDocument maximum lines/columns
Message 1 in thread
Simon,
Em Segunda 31 Julho 2006 17:38, Simon Hausmann escreveu:
>
> Don't despair though. :) We do have intentions of spicing up the API (and
> performance) to suit better the use case where the content is massive
> amounts of semi-plain text, where lines (blocks) and columns are needed,
> where you may want to limit the total number of lines, the use case of a
> programmer's editor or a read-only log viewer.
Thanks for your answer. ItÅ good to see that you will reimplement some
features that is missing in Qt4.
I started with Qt3 and i don't see how was Qt2 to Qt3 evolution. I don't know
if it's normal for Qt comunity change to another version with so many
pre-existent featrues postponed for later version of a final release.
I think that TrollTech has the right to chose ant strategy. But as a user, i
hope a final release of a new version at least with the same features of a
previous version. So, when i move to this new version, i can continue to do
what i already have done before.
Maybe, next time i should wait more to change. But it's strange to see a new
version, after finished testes and release candidate cycles, with missing
parts.
I liked Qt4, except for the problems converting Qt3 to Qt4 code.
Not "automatic conversion", with a tool. But a "hands on" conversion,
learning how to do the same things with the new version. I don't like to do
automatic conversions, using "support" classes/functions because this
class/functions some day will be cutted-off, so, i think it's a bad idea to
use it.
Josinei
_______________________________________________________
Você quer respostas para suas perguntas? Ou você sabe muito e quer compartilhar seu conhecimento? Experimente o Yahoo! Respostas !
http://br.answers.yahoo.com/
--
[ signature omitted ]
Message 2 in thread
Hello Josinei-
I am uncertain whether this might meet your needs, but I have a few ideas
(of which two briefly follow).
I assume from context that you are using Qt 4 :)
I believe there is a way to set a fixed number of columns using
QTextEdit::FixedColumnWidth.
(http://doc.trolltech.com/4.0/qtextedit.html#LineWrapMode-enum )
This may be less flexible than you would like, however, depending on your
constraints, this may do.
Assuming this meets your needs, you can use the fixed column size to
enforce the number of lines, based on total text size. If you expect "\n"
characters, you may have to do some additional math, but math is fun!
Another possibility may be to use QTextLayout/QTextLine. I have only
used Qt 3, so I cannot offer any insight regarding these classes.
If none of this will work for you, if you are set against using
Q3TextEdit or Q3MultiLineEdit, and if you are willing to clarify some
additional constraints, if any exist, I would be glad to try and help.
Best Wishes-
Craig
http://doc.trolltech.com/4.0/qtextedit.html#LineWrapMode-enum
> There's how to set a maximum number of lines/columns in a QTextEdit or a
> QTextDocument?
>
> I saw that Qt3 QMultiLineEdit has a maximum lines. But, itÅ a Qt3 widget
> and Qt documentation tells to doesn't use it :(
>
> I read QTextEdit, QTextDocument and QTextCursor documentation, but i
> didn't find nothing that could help me.
--
[ signature omitted ]
Message 3 in thread
"Craig Greenberg" <scraig@xxxxxxxxxxxxx> wrote in message
news:eaqid6$r73$1@xxxxxxxxxxxxxxxxxxxxx
> Hello Josinei-
>
> I am uncertain whether this might meet your needs, but I have a few
ideas
> (of which two briefly follow).
> I assume from context that you are using Qt 4 :)
>
> I believe there is a way to set a fixed number of columns using
> QTextEdit::FixedColumnWidth.
> (http://doc.trolltech.com/4.0/qtextedit.html#LineWrapMode-enum )
> This may be less flexible than you would like, however, depending on
your
> constraints, this may do.
> Assuming this meets your needs, you can use the fixed column size to
> enforce the number of lines, based on total text size. If you expect "\n"
> characters, you may have to do some additional math, but math is fun!
>
> Another possibility may be to use QTextLayout/QTextLine. I have only
> used Qt 3, so I cannot offer any insight regarding these classes.
> If none of this will work for you, if you are set against using
> Q3TextEdit or Q3MultiLineEdit, and if you are willing to clarify some
> additional constraints, if any exist, I would be glad to try and help.
We need something that allows automatic restriction of the number
of characters (sort of like QLineEdit::maxLength). The number of
lines doesn't really help.
For example, we have a database project
and some tables have columns intended for comments or user
descriptions. The field is configured as varchar(length). If the user
enters more text than the field length, there's an error writing to
the db. We currently have to validate it at the point of commit.
This is annoying from a user's POV. It would be better to
limit it at the time of input.
Something like a multiline line edit may work. We'll probably
end up rolling our own but it's not so trivial to deal with
considering things like cut/paste etc.
--
[ signature omitted ]