Results 1 to 5 of 5

Thread: Integrating a .jar in a QT window

  1. #1
    Join Date
    Jun 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Integrating a .jar in a QT window

    Hi everybody !

    I am actually trying to create a GUI using QTCreator on MacOSX. A part of the work I want to do in this UI has already been done in Java, and I detain the executable .jar which launch this application in a new window.

    I would like to simply insert the window launched through the .jar in a sub-window of my QT mainwindow (for instance in a specific Qframe).

    My code is actually as this :

    mainwindow.h
    Qt Code:
    1. #include<QProcess>
    2.  
    3. ...
    4.  
    5. Qprocess *PFDprocess;
    To copy to clipboard, switch view to plain text mode 

    mainwindow.cpp
    Qt Code:
    1. ...
    2. PFDprocess = new QProcess( );
    3. PFDprocess -> start("java -jar /path/to/my/file.jar");
    4. ...
    To copy to clipboard, switch view to plain text mode 

    The problem is that the .jar executes in a new window, even if I specify a "parent object" in the constructor of QProcess(---).

    Is there a way to specify that every output generated by the QProcess execution can be displayed in a specific area (in the mainwindow), and not in a new window ?

    I use QTCreator with QT 4.8.1.

    Thank you very much

    Eska

  2. #2
    Join Date
    Oct 2009
    Posts
    483
    Thanked 97 Times in 94 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Integrating a .jar in a QT window

    QProcess derives from QIODevice. By default the standard output of the process is bound to the QProcess. Therefore what you can do is:
    1. read asynchronously from the QProcess as you would from any QIODevice;
    2. interpret the data as text;
    3. append the text to a display widget such as QTextEdit.

  3. #3
    Join Date
    Jun 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Integrating a .jar in a QT window

    Thank you yeye_olive..

    I understand that it's possible in order to get text, but my .jar is in fact a whole GUI.

    To be more specific, my QT application is a Cockpit for a home-made flight simulator, and the .jar gives a render of a PFD (http://www.albadawi.be/images/PFD%20B747-400.jpg) that is already communicating with my simulation parameters.

    The objective would be to inser this java feature in part of the Qt window...

    I hope I am clear enough.

    Eska

  4. #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: Integrating a .jar in a QT window

    In a general case this is not possible, In some cases, on some platforms with applications written in a special way this is possible. In your particular case it's probably not, though (unless you use some platform specific API for this).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jun 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Integrating a .jar in a QT window

    Thank you... Then I guess that is not possible...

    Maybe it's possible to cheat though, using transparency in the QT window and launching automatically the .jar at the good place in background... I will see...

    Thanks a lot... If anyway i find alternative solutions I will add them to this thread.

    Eska

Similar Threads

  1. QT Integrating C++ and Javascript
    By bmn in forum Newbie
    Replies: 9
    Last Post: 9th August 2011, 14:19
  2. Integrating of module into one
    By Anshuman in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2011, 10:54
  3. integrating QT to ARM board
    By piyushpandey in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 31st August 2010, 14:15
  4. Integrating X window application in QT Widgets
    By augusbas in forum Qt Programming
    Replies: 2
    Last Post: 10th July 2010, 07:52
  5. Integrating C with Qt
    By deepakn in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2007, 09:12

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.