Results 1 to 8 of 8

Thread: My First Post - How could I do ...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default My First Post - How could I do ...

    I would like to code a simple telnet client using qt widgets.

    I uses qt 3.3 but I think I could switch to 4.1 if it helps.

    I thought about using a simple QTextEdit but I need some features I can't find in it...

    Features Requested:

    1)I would like to color chars both foreground and background in different ways in the same text
    2)I would like to color the background of a whole line when it's requested
    3)I would like to write blink chars

    A Widget that could render these HTML features would be perfect, but i don't know if it exists

    How should I do to obtain these features?

    Sorry for my bad English,

    Dalamar

  2. #2
    Join Date
    Feb 2006
    Location
    Kirovohrad, Ukraine
    Posts
    72
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: My First Post - How could I do ...

    Dear Dalamar! Please, next time be more precise, when choosing the subject .
    Frankly saying I don't know much about QT3, but in QT4 QTextEdit fits well for feature 1 and 2. As for blinking text... I suppose you should subclass it to implement such a feature.

  3. #3
    Join Date
    Feb 2006
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: My First Post - How could I do ...

    For the subject, I promise I'll do

    Ok I try to switch to QT4 and implement the first two features.

    I'll surely come back for the "blink" feature... i think it's all about recoding some paint function but It's my first approach to QT I don't know if I'll be able.

    Thanks,

    Dalamar

  4. #4
    Join Date
    Feb 2006
    Location
    Österreich
    Posts
    35
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: My First Post - How could I do ...

    Features Requested:

    1)I would like to color chars both foreground and background in different ways in the same text
    2)I would like to color the background of a whole line when it's requested
    3)I would like to write blink chars

    A Widget that could render these HTML features would be perfect, but i don't know if it exists
    Why would the buffer of a telnet application have parsed HTML in it? Are you making a telnet app or a web browsing app?

    I'll surely come back for the "blink" feature... i think it's all about recoding some paint function but It's my first approach to QT I don't know if I'll be able.
    No, just add a QTimer, a slot, and a toggle variable in your reimplementation of the widget, make a connect() in the widget constructor between the timer and the widget, then when the timer sends the timeout() signal, check in your slot if the toggle is set to on or off, hide or show the relevant text, set the toggle to the opposite, and restart the timer.

    Only two problems I have with this without trying it:

    1. Blinking text is annoying and your program will probably take a lot of time to support full terminal emulation, unless you want something like Microsoft's old telnet client (i.e. Notepad with local echo).
    2. I think this program would be funny with 80x24 rows of blinking text and one row at the bottom where you are trying to type something really fast over a slow connection to the remote computer.
    My philosophy is: If you can use a free, open-source alternative: do it. And if you can't, pretend it's free and open-source and hope you don't get caught.

  5. #5
    Join Date
    Feb 2006
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: My First Post - How could I do ...

    I know I'm a Boring Newbie...
    I'm always on QT3 , I have a little problem with signals and slots...

    I have two functions emitting the same signal

    The functions are called alternately:

    func1
    func2
    func1
    func2

    But I get a result like it was:

    func1
    func1
    func2
    func2

    They are asynchronous? Could I sync them?

  6. #6
    Join Date
    Feb 2006
    Location
    Österreich
    Posts
    35
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: My First Post - How could I do ...

    Quote Originally Posted by Dalamar
    I know I'm a Boring Newbie...
    I'm always on QT3 , I have a little problem with signals and slots...

    I have two functions emitting the same signal

    The functions are called alternately:

    func1
    func2
    func1
    func2

    But I get a result like it was:

    func1
    func1
    func2
    func2

    They are asynchronous? Could I sync them?
    What does the code look like? I mean, what exactly are the two functions doing that make the order they are called so important, so one can determine if it could be done another way? Also, check out the manual's entry for QObject::disconnect() and see if this is of any use.
    My philosophy is: If you can use a free, open-source alternative: do it. And if you can't, pretend it's free and open-source and hope you don't get caught.

  7. #7
    Join Date
    Feb 2006
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: My First Post - How could I do ...

    Stop Thinking About THAT! I probably wrote wrong code!

    However the order was a great problem cause...

    func1 manages escape codes
    func2 manages normal output

    Now func1 display only some extra info but in future it have to change the color of the text that will follow, the order is very important.
    Last edited by Dalamar; 16th February 2006 at 00:32.

  8. #8
    Join Date
    Feb 2006
    Location
    Österreich
    Posts
    35
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: My First Post - How could I do ...

    I understand if it is embarrassing to show your code to other people because you think they will laugh at it. But remember, you will never see any of us. So what do you care if someone laughs? Someone who makes fun of others' abilities instead of being polite is probably not wanting to be helpful anyway, so you might as well ignore everything they say.

    Or do you not want to show it for licensing reasons? Then I hope you are not using Qt Free or you will have some bad news in the future from the Trolltech Legal Department :D :D :D

    Either way, it is hard to guess what someone wants a function to do when they only tell you what they believe it is currently doing. Being able to look at the code, another person can say immediately whether it is even written correctly.
    My philosophy is: If you can use a free, open-source alternative: do it. And if you can't, pretend it's free and open-source and hope you don't get caught.

Similar Threads

  1. QHTTP POST problem
    By oscar in forum Qt Programming
    Replies: 5
    Last Post: 10th October 2009, 20:58
  2. QNetworkAccessManager double post
    By QPlace in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2009, 05:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.