Qt-interest Archive, June 2007
Highlighting the running line in QTextEdit
Message 1 in thread
Hello
There is a program running in a QTextEdit, and I know the line number(int
currentLine).Does any knows how to highlighting the running line?
I do it this way, but it's doesn't work well(Just move down a few lines,
then stops there.But the program has not came to the end yet, that is, the
program is still exected.)
void Neopen::Highlighting(int currentLine)
{
QTextCursor cursor = programTextEdit->textCursor();
cursor.setPosition(line, QTextCursor::KeepAnchor);
cursor.select(QTextCursor::LineUnderCursor);
programTextEdit->setTextCursor(cursor);
}
--
[ signature omitted ]
Message 2 in thread
Hello
There is a program running in a QTextEdit, and I know the line number(int
currentLine).Does any knows how to highlighting the running line?
I do it this way, but it's doesn't work well(Just move down a few lines,
then stops there.But the program has not came to the end yet, that is, the
program is still exected.)
void Neopen::Highlighting(int currentLine)
{
QTextCursor cursor = programTextEdit->textCursor();
cursor.setPosition(currentLine, QTextCursor::KeepAnchor);
cursor.select(QTextCursor::LineUnderCursor);
programTextEdit->setTextCursor(cursor);
}
--
[ signature omitted ]
Message 3 in thread
Hi,
Does anyone have any ideas?
Please!
2007/6/4, 张凤丽 <zhangfenglisdu@xxxxxxxxx>:
>
> Hello
> There is a program running in a QTextEdit, and I know the line number(int
> currentLine).Does any knows how to highlighting the running line?
> I do it this way, but it's doesn't work well(Just move down a few lines,
> then stops there.But the program has not came to the end yet, that is, the
> program is still exected.)
>
> void Neopen::Highlighting(int currentLine)
> {
> QTextCursor cursor = programTextEdit->textCursor();
> cursor.setPosition(currentLine, QTextCursor::KeepAnchor);
> cursor.select(QTextCursor::LineUnderCursor);
> programTextEdit->setTextCursor(cursor);
> }
> --
> Best Regards
> Fengli Zhang
--
[ signature omitted ]
Message 4 in thread
Waiting 5 hours, after posting at a time when many are asleep (1:30 am local for me) or are just waking up, and then sending out a “Any ideas response” is just downright rude.
I highly suggest you read through the QT documentation… look at the “all classes” page and look for the work highlight…
Scott
________________________________
From: 张凤丽 [mailto:zhangfenglisdu@xxxxxxxxx]
Sent: Monday, June 04, 2007 6:03 AM
To: qt-interest
Subject: Re: Highlighting the running line in QTextEdit
Hi,
Does anyone have any ideas?
Please!
2007/6/4, 张凤丽 <zhangfenglisdu@xxxxxxxxx>:
Hello
There is a program running in a QTextEdit, and I know the line number(int currentLine).Does any knows how to highlighting the running line?
I do it this way, but it's doesn't work well(Just move down a few lines, then stops there.But the program has not came to the end yet, that is, the program is still exected.)
void Neopen::Highlighting(int currentLine)
{
QTextCursor cursor = programTextEdit->textCursor();
cursor.setPosition(currentLine, QTextCursor::KeepAnchor);
cursor.select(QTextCursor::LineUnderCursor);
programTextEdit->setTextCursor(cursor);
}
--
[ signature omitted ]
Message 5 in thread
On Monday 04 June 2007, Scott Aron Bloom wrote:
> Waiting 5 hours, after posting at a time when many are asleep (1:30 am
> local for me) or are just waking up, and then sending out a ¡°Any ideas
> response¡± is just downright rude.
(Grin) *rude* isn't the word to describe this. *Pushy and lazy to read Docs*
comes to mind..
--
[ signature omitted ]
Message 6 in thread
On 06-04-2007 10:14 AM, "Peter M. Groen" wrote:
> On Monday 04 June 2007, Scott Aron Bloom wrote:
>> Waiting 5 hours, after posting at a time when many are asleep (1:30 am
>> local for me) or are just waking up, and then sending out a ÂÂAny ideas
>> responseÂÂ is just downright rude.
>
> (Grin) *rude* isn't the word to describe this. *Pushy and lazy to read Docs*
> comes to mind..
Desperate, more likely. The docs don't help much in cases like this.
> On 06-04-2007 3:26 AM, "ååä" wrote:
>
> Hello
> There is a program running in a QTextEdit, and I know the line number(int
> currentLine).Does any knows how to highlighting the running line?
> I do it this way, but it's doesn't work well(Just move down a few lines, then
> stops there.But the program has not came to the end yet, that is, the program
> is still exected.)
>
> void Neopen::Highlighting(int currentLine)
> {
> QTextCursor cursor = programTextEdit->textCursor();
> cursor.setPosition(currentLine, QTextCursor::KeepAnchor);
> cursor.select(QTextCursor::LineUnderCursor);
> programTextEdit->setTextCursor(cursor);
> }
You probably need to either call programTextEdit->repaint(), or
QApplication::ProcessEvents() to allow the repaint to update the screen.
Keith
**Please do not reply to me, reply to the list.**
--
[ signature omitted ]
Message 7 in thread
Hi
I did have read qt docs before posting here, but got little help enough for
me.Then I decided to ask for help here.
2007/6/5, Keith Esau <keith.esau@xxxxxxx>:
>
> On 06-04-2007 10:14 AM, "Peter M. Groen" wrote:
>
> > On Monday 04 June 2007, Scott Aron Bloom wrote:
> >> Waiting 5 hours, after posting at a time when many are asleep (1:30 am
> >> local for me) or are just waking up, and then sending out a ÂÂAny ideas
> >> responseÂÂ is just downright rude.
> >
> > (Grin) *rude* isn't the word to describe this. *Pushy and lazy to read
> Docs*
> > comes to mind..
>
> Desperate, more likely. The docs don't help much in cases like this.
>
> > On 06-04-2007 3:26 AM, "ååä" wrote:
> >
> > Hello
> > There is a program running in a QTextEdit, and I know the line
> number(int
> > currentLine).Does any knows how to highlighting the running line?
> > I do it this way, but it's doesn't work well(Just move down a few lines,
> then
> > stops there.But the program has not came to the end yet, that is, the
> program
> > is still exected.)
> >
> > void Neopen::Highlighting(int currentLine)
> > {
> > QTextCursor cursor = programTextEdit->textCursor();
> > cursor.setPosition(currentLine, QTextCursor::KeepAnchor);
> > cursor.select(QTextCursor::LineUnderCursor);
> > programTextEdit->setTextCursor(cursor);
> > }
>
> You probably need to either call programTextEdit->repaint(), or
> QApplication::ProcessEvents() to allow the repaint to update the screen.
>
> Keith
> **Please do not reply to me, reply to the list.**
>
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
--
[ signature omitted ]