Results 1 to 2 of 2

Thread: Dynamic library with GUI for Mac

  1. #1
    Join Date
    Jul 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Dynamic library with GUI for Mac

    Hi All,

    I successfully made dynamic library (Photoshop plug-in) on QT for Windows. I create one global QApplication and I use QWinWidget for passing parent Photoshop window to my QDialog. I open my QDialog with exec() method and everything works perfect.

    But I have problems with my library on Mac.
    My dialog can be opened in Photoshop but it changes main top menu. It looks like my dialog is a separate application. And Photoshop's menu is not recovered after closing the dialog and deleting QApplication.
    Is there any way to pass native Mac window as a parent for QT QDialog like I do using QWinWidget in Windows?

    My simplified code for Windows is

    MACPASCAL void PluginMain(const short selector, FilterRecord *filterParamBlock, long *hwnd_parent, short *result)
    {
    int argc = 0;
    QApplication *theQApp = new QApplication(argc, NULL);

    PlatformData *platform = (PlatformData*)(fpb->platformData);
    QWinWidget main_wnd((HWND)hwnd_parent);

    CPhFToolDlg *dlg = new CPhFToolDlg(data, &main_wnd, Qt::WindowCloseButtonHint);
    dlg->exec();

    delete dlg;
    delete theQApp;
    }

    And for Mac is the same but without using parent window:
    MACPASCAL void PluginMain(const short selector, FilterRecord *filterParamBlock, long *hwnd_parent, short *result)
    {
    int argc = 0;
    QApplication *theQApp = new QApplication(argc, NULL);
    CPhFToolDlg *dlg = new CPhFToolDlg(data, NULL, Qt::WindowCloseButtonHint);
    dlg->exec();

    delete dlg;
    delete theQApp;
    }

    I have a problem on Mac even without a GUI.
    Simple creation and deleting of QApplication make "Quit Photoshop" item of main Photoshop menu not work. Photoshop launches my PluginMain function, and all main menu items work properly but Photoshop stays open after "Quit" item for some reason.
    MACPASCAL void PluginMain(const short selector, FilterRecord *filterParamBlock, long *hwnd_parent, short *result)
    {
    int argc = 0;
    QApplication *theQApp = new QApplication(argc, NULL);
    delete theQApp;
    }

    Does anybody have an experience in dynamic library creation for Mac? Can you point me some examples? Your help will be very appreciated.

    Thank you,
    Sofia

  2. #2
    Join Date
    Jul 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Dynamic library with GUI for Mac

    I've found description of my problem on http://bugreports.qt.nokia.com/browse/QTBUG-8087

Similar Threads

  1. Generating a static and dynamic library
    By elcuco in forum Qt Programming
    Replies: 3
    Last Post: 20th August 2011, 12:46
  2. QTForm in QT Dynamic Library
    By Kokos in forum Newbie
    Replies: 1
    Last Post: 17th February 2010, 16:56
  3. Linking Qt in a dynamic library
    By dave_mm0 in forum Qt Programming
    Replies: 4
    Last Post: 18th July 2009, 17:28
  4. Load objects from dynamic library
    By Trok in forum Qt Programming
    Replies: 10
    Last Post: 17th July 2009, 21:04
  5. How to use a Dynamic Link Library with QT / C++.
    By nivaldonicolau in forum Newbie
    Replies: 5
    Last Post: 29th April 2009, 15:05

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.