Results 1 to 20 of 21

Thread: Call GUI Dll from non-Qt application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Call GUI Dll from non-Qt application

    OK one last question: if the Java application will not periodically call QApplication:rocessEvents() it will not work? I can not call QApplication:rocessEvents() from my code correct?
    Last edited by barak; 11th July 2010 at 12:01.

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

    Default Re: Call GUI Dll from non-Qt application

    Quote Originally Posted by barak View Post
    OK one last question: if the Java application will not periodically call QApplication:rocessEvents() it will not work?
    It depends how you wish to implement it. You need to call your dialog in the context of the same thread the QApplication object was created in. The first thing I'd try would be to create the application object in the same function you are creating the dialog itself.

    I can not call QApplication:rocessEvents() from my code correct?
    Unless your code is called several times each second then no. But you should be able to inject some code into the java app (i.e. setup some timer or something like that). An alternative is to have a helper application in pure C++/Qt and only communicate with it from your two functions using some IPC mechanisms. Your init function would start the application and the other function would communicate with it through shared memory, pipes, sockets or similar mechanisms.
    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.


  3. #3
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Call GUI Dll from non-Qt application

    Some thing like this?

    Qt Code:
    1. bool aseLogin(aseVerifyData& aseData)
    2. {
    3. m_iLastSlotId = aseData.slotID;
    4. QApplication * a = 0;
    5. int argc = 1;
    6. char *argv[] = { "asePinDialog", NULL };
    7. a = new QApplication(argc, argv);
    8.  
    9. if(aseData.pinType == KEY_TYPE_CHAL_RESP)
    10. {
    11. VerifyPin3Des *pinDlg = new VerifyPin3Des(aseData);
    12. m_pOpenDialog = pinDlg;
    13. pinDlg->exec();
    14. delete pinDlg;
    15. m_pOpenDialog = NULL;
    16. }
    17. else
    18. {
    19. VerifyPinSig *pinDlg = new VerifyPinSig(aseData);
    20. m_pOpenDialog = pinDlg;
    21. pinDlg->exec();
    22. delete pinDlg;
    23. m_pOpenDialog = NULL;
    24. }
    25.  
    26. m_iLastSlotId = 0;
    27. return true;
    28. }
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: Call GUI Dll from non-Qt application

    Apart from memory leaks (why use pointers here if all objects are only used in local context?), yes.
    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. The following user says thank you to wysota for this useful post:

    barak (11th July 2010)

  6. #5
    Join Date
    Jul 2010
    Posts
    19
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Call GUI Dll from non-Qt application

    You are correct !!

    Thank you very much it is WORKING !!! I have managed to show the dialog and work with it.

    Again, many thanks

    Keep on with the great job your doing.

Similar Threads

  1. call a class
    By assismvla in forum Newbie
    Replies: 3
    Last Post: 24th May 2010, 12:57
  2. how to call mfc dll use qt?
    By yunpeng880 in forum Qt Programming
    Replies: 2
    Last Post: 12th March 2009, 04:32
  3. Replies: 3
    Last Post: 4th March 2008, 08:35
  4. Call QProcess without GUI
    By mattia in forum Newbie
    Replies: 8
    Last Post: 5th November 2007, 13:39
  5. Timer call
    By mahe2310 in forum Qt Programming
    Replies: 1
    Last Post: 28th March 2006, 08:57

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
  •  
Qt is a trademark of The Qt Company.