Results 1 to 4 of 4

Thread: Alternative QT Initialization (inside DLL)

  1. #1
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Alternative QT Initialization (inside DLL)

    Hi, yesterday I've downloaded QT, because I'm interested in making plugins for FL Studio application, and I need something to handle with GUI. The question is: how to initialize QT without calling app.exec() (this call hungs up my plugin), and with opportunity to use gui widgets and windows? The FL Studio SDK requires one very important function:
    Qt Code:
    1. extern "C" TFruityPlug * _stdcall CreatePlugInstance(TFruityPlugHost *Host, int Tag)
    To copy to clipboard, switch view to plain text mode 
    This function must be exported and returns the TFruityPlug compatible class instance.
    It will be great if QT have something like "QTInitialize" or something. Now using app.exec in above mentioned function hungs up everything and plugin is useless.
    Thank you in advance for help.

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Alternative QT Initialization (inside DLL)

    The QApplication::exec method does not initialize Qt - it *runs* Qt. The exec method contains the Qt event loop that lets Qt process and distribute events to widgets and other components. Not being able to run the event loop, a Qt application just sits there.

    Extending a non-Qt application with a Qt extension is a hard thing to do - if not impossible. I, sadly, think that you will have to look for another solution.

  3. #3
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Alternative QT Initialization (inside DLL)

    QT is great library, I've seen many of demos attached - its very impresive. The only way to use QT is to build standalone application? This only point making disability to use whole library... but I need just a small part - the gui.
    I have some experience with wxWIdgets - it works almost perfectly without one important thing that QT has - performance. So wxWidgets can work with FL Studio (which is written in Delphi) and QT not? Strange. There must be a trick to directly show QWidget or QWindow. Only what i need is to view QWidget and to have a DLL...

  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: Alternative QT Initialization (inside DLL)

    You need to integrate the event loop of Qt with the event loop of the other mechanism you use. In other words you need to make sure that periodically QApplication::processEvents() will be called by the other event loop so that Qt's events are being processed. Note that you can't use Qt timers to trigger the method because they require events too.
    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.


Similar Threads

  1. QDesktopWidget initialization
    By drweilert in forum Qt Programming
    Replies: 4
    Last Post: 8th May 2011, 19:42
  2. A doubt about initialization of variables
    By vcp in forum Qt Programming
    Replies: 5
    Last Post: 11th December 2009, 10:42
  3. QWT application initialization error
    By Urban in forum Qwt
    Replies: 3
    Last Post: 17th September 2008, 10:17
  4. 'new' in initialization list
    By Kumosan in forum General Programming
    Replies: 5
    Last Post: 26th May 2008, 16:09
  5. Initialization code
    By Doug Broadwell in forum Newbie
    Replies: 2
    Last Post: 27th February 2007, 11:48

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.