Results 1 to 5 of 5

Thread: Terminal into Qt application

  1. #1
    Join Date
    Jan 2009
    Location
    Varna, Bulgaria / Villeurbanne, France
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Terminal into Qt application

    I'm currently working on a project in which I need to have several terminals to display SSH sessions on several distant machines. Until now I was using a normal XTerm to display the sessions, but it's not very ergonomic when the number of machines increases, so I decided to use an integrated terminal in my application main window. So does anyone have an idea how to integrate a terminal into a Qt application? However I'd like to take advantage of Qt's portability, so I don't want to use KDE classes (as I already saw such examples).
    Thanks in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Terminal into Qt application

    In short there are no portable solutions unless you handle the telnet protocol yourself using plain TCP sockets. On X11 you can try to use XEmbed, on Windows maybe there is some terminal application that has a COM interface, on MacOSX - I have no idea. Other than that - you're on your own or you can try to hack Konsole from KDE to see if you can incorporate its sources into your application. Based on a brief look I see it is using something called "libkpty" which probably implements the terminal protocol, so I'd start with stripping libkdecore dependencies and trying to compile it on WIndows and Mac.

  3. The following user says thank you to wysota for this useful post:

    paF4uko (26th January 2009)

  4. #3
    Join Date
    Jan 2009
    Location
    Varna, Bulgaria / Villeurbanne, France
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Terminal into Qt application

    Thanks for the reply. Actually I need to make it work on POSIX systems only independently of whether there's KDE or not. I started looking at Konsole yesterday, but the source code has to be explored in details and I have something like a week to finish this part of the project along with many others. Anyway, I'll try to figure something out and I'll post the solution here for others to use.
    Cheers!

    P.S: I think I'll consider using XEmbed, "libkpty" being part of the KDE libraries. Thanks again!
    Last edited by paF4uko; 26th January 2009 at 01:37.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Terminal into Qt application

    Quote Originally Posted by paF4uko View Post
    P.S: I think I'll consider using XEmbed,
    "xterm -into" is a good place to start. Just remember xterm might not be available on a particular system.

    "libkpty" being part of the KDE libraries. Thanks again!
    That's why I said you'd have to strip out KDE dependencies for it. They are probably only few calls from kdelibs which you can substitute with pure Qt calls.

  6. #5
    Join Date
    Jan 2009
    Location
    Varna, Bulgaria / Villeurbanne, France
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Terminal into Qt application

    Someone already ported the Konsole terminal to pure Qt. The project is available at Sourceforge: http://sourceforge.net/projects/qtermwidget

    Have fun!

Similar Threads

  1. qtopia terminal application
    By Savita in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 29th February 2008, 07:24
  2. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37
  3. Replies: 3
    Last Post: 8th December 2006, 18:51

Tags for this Thread

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.