Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Dynamic library with GUI for Mac
Forum Updated to NodeBB v4.3 + New Features

Dynamic library with GUI for Mac

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 4.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mouse_sonya
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • T Offline
      T Offline
      troubalex
      wrote on last edited by
      #2

      Could you wrap your code in "@" signs please? That makes it a lot easier to read. Thanks!

      THE CAKE IS A LIE
      Web Community Manager - Qt Development Frameworks

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Henrik
        wrote on last edited by
        #3

        Have you tried to use QMacNativeWidget in the same way like the QWinWidget ?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mouse_sonya
          wrote on last edited by
          #4

          I've solved my problems.
          I've found Qt::AA_MacPluginApplication application attribute for main top menu not to be replaced.

          And I've found "Quit" problem description in http://bugreports.qt.nokia.com/browse/QTBUG-8087.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved