Qt-interest Archive, May 2007
about QTextEdit
Message 1 in thread
hi, every one
Hopes I asked a smart question this time. If it has been asked before ,
forgive me please!
I have created a QTextEdit and wrote a program file(actually, it's a g-code
program for a cnc milling system. of course, this is not important.)into it.
Then I make the program file to start running. Now, I want to get the active
executing line(I know the active line number and it's an int.) into a
QString. I have read all docs about QTextEdit, but not found any resolvent.
Any ideas?
Thank you in advance.
Regards
Fenli
Message 2 in thread
maybe QStrings setNum(int, int) function could help you. Found in the Qt
Assistant in the documentation of QString.
Best regards
seb
On Wednesday 02 May 2007 04:53:20 ååä wrote:
> hi, every one
> Hopes I asked a smart question this time. If it has been asked before ,
> forgive me please!
> I have created a QTextEdit and wrote a program file(actually, it's a g-code
> program for a cnc milling system. of course, this is not important.)into
> it. Then I make the program file to start running. Now, I want to get the
> active executing line(I know the active line number and it's an int.) into
> a QString. I have read all docs about QTextEdit, but not found any
> resolvent. Any ideas?
> Thank you in advance.
> Regards
> Fenli
--
[ signature omitted ]
Message 3 in thread
ååä wrote:
> hi, every one
> Hopes I asked a smart question this time. If it has been asked before ,
> forgive me please!
> I have created a QTextEdit and wrote a program file(actually, it's a
> g-code program for a cnc milling system. of course, this is not
> important.)into it. Then I make the program file to start running. Now,
> I want to get the active executing line(I know the active line number
> and it's an int.) into a QString. I have read all docs about QTextEdit,
> but not found any resolvent.
> Any ideas?
> Thank you in advance.
> Regards
> Fenli
I'm not sure if I understand your question, but isn't
my_text_edit.text( active_line_number )
what you want?
Martin.
--
[ signature omitted ]
Message 4 in thread
"Martin Irman" <imartin@xxxxxxx> wrote in message
news:f1a604$a5a$1@xxxxxxxxxxxxxxxxxxxxx
> ååä wrote:
> > hi, every one
> > Hopes I asked a smart question this time. If it has been asked before ,
> > forgive me please!
> > I have created a QTextEdit and wrote a program file(actually, it's a
> > g-code program for a cnc milling system. of course, this is not
> > important.)into it. Then I make the program file to start running. Now,
> > I want to get the active executing line(I know the active line number
> > and it's an int.) into a QString. I have read all docs about QTextEdit,
> > but not found any resolvent.
> > Any ideas?
> > Thank you in advance.
> > Regards
> > Fenli
>
> I'm not sure if I understand your question, but isn't
>
> my_text_edit.text( active_line_number )
>
> what you want?
QTextEdit::text() is a Qt3 function.
I think that what he wants is to retrieve the actual line in question
as a QString. I think the only way to do this with Qt4 is to use
QTextCursor
to get the line and then QTextCursor::selectedText(). Not sure
how to set the cursor to anything but the current line though.
--
[ signature omitted ]
Message 5 in thread
Hi, once again
I am using qt4. What I really want is the current line which is executed
now. And the current line needs to be read into a QString.
Sorry if I still haven't expressed myself clearly for my poor English.
Regards
Fengli
2007/5/2, 张凤丽 <zhangfenglisdu@xxxxxxxxx>:
>
> hi, every one
> Hopes I asked a smart question this time. If it has been asked before ,
> forgive me please!
> I have created a QTextEdit and wrote a program file(actually, it's a
> g-code program for a cnc milling system. of course, this is not
> important.)into it. Then I make the program file to start running. Now, I
> want to get the active executing line(I know the active line number and it's
> an int.) into a QString. I have read all docs about QTextEdit, but not found
> any resolvent.
> Any ideas?
> Thank you in advance.
> Regards
> Fenli
>
Message 6 in thread
What do you mean by executed now?
________________________________
From: 张凤丽 [mailto:zhangfenglisdu@xxxxxxxxx]
Sent: Wednesday, May 02, 2007 11:07 PM
To: qt-interest
Subject: Re: about QTextEdit
Hi, once again
I am using qt4. What I really want is the current line which is executed now. And the current line needs to be read into a QString.
Sorry if I still haven't expressed myself clearly for my poor English.
Regards
Fengli
2007/5/2, 张凤丽 <zhangfenglisdu@xxxxxxxxx>:
hi, every one
Hopes I asked a smart question this time. If it has been asked before , forgive me please!
I have created a QTextEdit and wrote a program file(actually, it's a g-code program for a cnc milling system. of course, this is not important.)into it. Then I make the program file to start running. Now, I want to get the active executing line(I know the active line number and it's an int.) into a QString. I have read all docs about QTextEdit, but not found any resolvent.
Any ideas?
Thank you in advance.
Regards
Fenli
Message 7 in thread
She means that her excutable program is reading its own source and
prints the corresponding executing line of the source code to the window.
I'm afraid that you'll have to do it in your own code.
Scott Aron Bloom wrote:
> What do you mean by executed now?
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> *From:* 张凤丽 [mailto:zhangfenglisdu@xxxxxxxxx]
> *Sent:* Wednesday, May 02, 2007 11:07 PM
> *To:* qt-interest
> *Subject:* Re: about QTextEdit
>
>
>
> Hi, once again
> I am using qt4. What I really want is the current line which is executed
> now. And the current line needs to be read into a QString.
> Sorry if I still haven't expressed myself clearly for my poor English.
> Regards
> Fengli
>
> 2007/5/2, 张凤丽 <zhangfenglisdu@xxxxxxxxx
> <mailto:zhangfenglisdu@xxxxxxxxx>>:
>
> hi, every one
> Hopes I asked a smart question this time. If it has been asked before ,
> forgive me please!
> I have created a QTextEdit and wrote a program file(actually, it's a
> g-code program for a cnc milling system. of course, this is not
> important.)into it. Then I make the program file to start running. Now,
> I want to get the active executing line(I know the active line number
> and it's an int.) into a QString. I have read all docs about QTextEdit,
> but not found any resolvent.
> Any ideas?
> Thank you in advance.
> Regards
> Fenli
>
>
>
--
[ signature omitted ]
Message 8 in thread
I'm sorry that I didn't read your original message.
To your problem, you should read your file line by line and print the
line yourself.
You can get the line number. Right?
>>
>> *From:* 张凤丽 [mailto:zhangfenglisdu@xxxxxxxxx]
>> *Sent:* Wednesday, May 02, 2007 11:07 PM
>> *To:* qt-interest
>> *Subject:* Re: about QTextEdit
>>
>>
>>
>> Hi, once again
>> I am using qt4. What I really want is the current line which is executed
>> now. And the current line needs to be read into a QString.
>> Sorry if I still haven't expressed myself clearly for my poor English.
>> Regards
>> Fengli
>>
>> 2007/5/2, 张凤丽 <zhangfenglisdu@xxxxxxxxx
>> <mailto:zhangfenglisdu@xxxxxxxxx>>:
>>
>> hi, every one
>> Hopes I asked a smart question this time. If it has been asked before ,
>> forgive me please!
>> I have created a QTextEdit and wrote a program file(actually, it's a
>> g-code program for a cnc milling system. of course, this is not
>> important.)into it. Then I make the program file to start running. Now,
>> I want to get the active executing line(I know the active line number
>> and it's an int.) into a QString. I have read all docs about QTextEdit,
>> but not found any resolvent.
>> Any ideas?
>> Thank you in advance.
>> Regards
>> Fenli
>>
>>
>>
--
[ signature omitted ]
Message 9 in thread
Hi,
Sorry firstly.
In fact, the program file in the QTextEdit is an executable program. The
current line is the line which is executed now provided that I have start
running the program. What I really what is reading the current line into a
QString.
Understand? Hoping... ^_^
Fengli
2007/5/2, 张凤丽 <zhangfenglisdu@xxxxxxxxx>:
>
> hi, every one
> Hopes I asked a smart question this time. If it has been asked before ,
> forgive me please!
> I have created a QTextEdit and wrote a program file(actually, it's a
> g-code program for a cnc milling system. of course, this is not
> important.)into it. Then I make the program file to start running. Now, I
> want to get the active executing line(I know the active line number and it's
> an int.) into a QString. I have read all docs about QTextEdit, but not found
> any resolvent.
> Any ideas?
> Thank you in advance.
> Regards
> Fenli
>