Qt-interest Archive, July 2006
QTextEdit/QTextDocument maximum lines/columns
Message 1 in thread
Hi,
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.
Thanks.
Josinei R. L. Silva
_______________________________________________________
O Yahoo! está de cara nova. Venha conferir!
http://br.yahoo.com/preview
--
[ signature omitted ]
Message 2 in thread
On 31.07.06 14:43:35, Josinei Silva wrote:
> There's how to set a maximum number of lines/columns in a QTextEdit or a
> QTextDocument?
QTextEdit and accompanying classes don't really support lines or
columns. It is more meant as a rich-text editor and as such has no
lineCount() or anything like that.
I saw here that some people use a QListView or QTableView as something
that has lines and columns...
Andreas
--
[ signature omitted ]
Message 3 in thread
Andreas,
Thanks for your help, but...
Em Segunda 31 Julho 2006 15:14, Andreas Pakulat escreveu:
> On 31.07.06 14:43:35, Josinei Silva wrote:
> > There's how to set a maximum number of lines/columns in a QTextEdit or a
> > QTextDocument?
>
> QTextEdit and accompanying classes don't really support lines or
> columns. It is more meant as a rich-text editor and as such has no
> lineCount() or anything like that.
>
> I saw here that some people use a QListView or QTableView as something
> that has lines and columns...
QListView or QTableView can work as a text editor? It does line wrap?
It looks like Qt4 is uncomplete. Some things that was offered with Qt3 are
missing.
I had to write a lot of code to hava something that could replace QSqlForm. At
least, i preferer my new code than QSqlForm.
QDateEdit and QDateTimeEdit doesn't support empty date/date-time. And i don't
understand how someone imagine that all dates will be complete and the world
doesn't need empty/missing dates. I had to write a new DateEdit/DateTimeEdit
based on QLineEdit.
But at this time, i couldn find a good way around another change made by
TrollTech.
I'm afraid about Qt5. I'll have to turn my code upside down again??? Qt is a
great toolkit. I like it very much. But these kind of unstability is not what
i expect for the base of my programs :(
Josinei R. L. Silva
_______________________________________________________
Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora!
http://br.mobile.yahoo.com/mailalertas/
--
[ signature omitted ]
Message 4 in thread
On 31.07.06 15:44:31, Josinei Silva wrote:
> Em Segunda 31 Julho 2006 15:14, Andreas Pakulat escreveu:
> > On 31.07.06 14:43:35, Josinei Silva wrote:
> > > There's how to set a maximum number of lines/columns in a QTextEdit or a
> > > QTextDocument?
> >
> > QTextEdit and accompanying classes don't really support lines or
> > columns. It is more meant as a rich-text editor and as such has no
> > lineCount() or anything like that.
> >
> > I saw here that some people use a QListView or QTableView as something
> > that has lines and columns...
>
> QListView or QTableView can work as a text editor?
Don't ask me, I wouldn't even think about this misuse...
> It does line wrap?
No.
> It looks like Qt4 is uncomplete. Some things that was offered with Qt3 are
> missing.
Well, QTextEdit has a function for setting the width where the line wrap
should occur. However I have no idea how you would fix the length of the
document. Qt4.2 will have a blockCount method on QTextDocument, but that
only works for RichtText or LogText, not for PlainText. I guess in the
latter case you have to count the number of '\n's. While internally
QTextEdit still uses Qt::LogText, it does so in only 2 places and it
seems that QTextEdit is not meant to be used for that.
> QDateEdit and QDateTimeEdit doesn't support empty date/date-time. And i don't
> understand how someone imagine that all dates will be complete and the world
> doesn't need empty/missing dates. I had to write a new DateEdit/DateTimeEdit
> based on QLineEdit.
Did you submit a bugreport about this?
Anyway I don't see a problem here, I can set and "empty" QDate onto a
QDateTimeEdit. It then shows 01.01.2000 00:00:00.
> I'm afraid about Qt5. I'll have to turn my code upside down again??? Qt is a
> great toolkit. I like it very much. But these kind of unstability is not what
> i expect for the base of my programs :(
You're free to use Qt3.3. Qt4 is a major change, it's not something that
is supposed to working exactly as Qt3. This is the same with other
toolkits I've seen, consider the changes between gtk1.2 and gtk2 for
example (if you know those toolkits).
Anyway expect Qt4.2 to be much more complete as it will be the base for
KDE4.
Andreas
--
[ signature omitted ]