Results 1 to 2 of 2

Thread: How to call a Qt function from Java swing

  1. #1

    Default How to call a Qt function from Java swing


    I now have a Qt project (qtmm - This project is a working Qt application.

    Now I need to use some functions of this project in Java. I mean calling a Qt function from Java swing application. Does anyone know how to do it

    Or, is there any way to export Qt project to a library and use that library in Java.

    I've found QtJambi but it seems to be used for GUI only. (not really sure about this)

    Please help, Thanks

    PS: the Qt app qtmm above has a function of reading AudioInput and process it, return a string. The function will emit a signal when new string available. I wonder if is there any way to read this string from Java swing. Maybe something like a BlockingQueue as sink for Qt app putting new string in that, and Java app take that string.

  2. #2
    Join Date
    Mar 2010
    Heredia, Costa Rica
    Thanked 16 Times in 13 Posts
    Qt products
    Qt4 Qt5
    Unix/X11 Windows

    Default Re: How to call a Qt function from Java swing


    You can use JNI to JNA. See this posts

    Be aware that qtmm might generate a library that you can use with JNI so you might need to fork that project and create a library from it that would be usable with JNI or JNA.

    Hope this help.

Similar Threads

  1. Qt function call in
    By abghosh in forum Qt Programming
    Replies: 7
    Last Post: 6th March 2010, 17:00
  2. Replies: 1
    Last Post: 7th October 2009, 20:37
  3. call variable from other function
    By walito in forum Newbie
    Replies: 7
    Last Post: 31st August 2007, 18:36
  4. function call
    By Walsi in forum Qt Programming
    Replies: 3
    Last Post: 12th June 2007, 09:13
  5. Cannot call function without object
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 11th June 2007, 14:55

Tags for this Thread


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.