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

    Hi,

    I now have a Qt project (qtmm - https://github.com/tatung/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
    Location
    Heredia, Costa Rica
    Posts
    257
    Thanks
    24
    Thanked 17 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

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

    Hi,

    You can use JNI to JNA. See this posts

    http://stackoverflow.com/questions/1...lity-from-java

    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 vb.net
    By abghosh in forum Qt Programming
    Replies: 7
    Last Post: 6th March 2010, 18:00
  2. Replies: 1
    Last Post: 7th October 2009, 21:37
  3. call variable from other function
    By walito in forum Newbie
    Replies: 7
    Last Post: 31st August 2007, 19:36
  4. function call
    By Walsi in forum Qt Programming
    Replies: 3
    Last Post: 12th June 2007, 10:13
  5. Cannot call function without object
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 11th June 2007, 15:55

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.