Results 1 to 20 of 20

Thread: Photoshop filter plug-in

  1. #1

    Default Photoshop filter plug-in

    Hi all!
    I'm using Qt for creating a photoshop filter plugin.
    I have a problem on Mac OS X. After I close my dialog the photoshop's menu hides.

    Here is my code:

    Qt Code:
    1. char **argv = { 0 };
    2. (void) new QApplication(argc, argv);
    3. MainDialog *w = new MainDialog();
    4. w->setWindowFlags(Qt::WindowStaysOnTopHint);
    5. qApp->connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) );
    6. w->show();
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Photoshop filter plug-in

    Try removing this line of code:

    Qt Code:
    1. qApp->connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) );
    To copy to clipboard, switch view to plain text mode 

  3. #3

    Default Re: Photoshop filter plug-in

    Quote Originally Posted by codeslicer View Post
    Try removing this line of code:

    Qt Code:
    1. qApp->connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) );
    To copy to clipboard, switch view to plain text mode 
    This take no effect.

  4. #4
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Photoshop filter plug-in

    what menu and where exactly is ur dialog showing..can u post a snapshot

  5. #5

    Default Re: Photoshop filter plug-in

    Ok, here is my screenshots:

    Picture 1 - screen before i open dialog.
    Picture 2 - dialog opened, main menu changed.
    Picture 3 - dialog closed, but main menu is not defaulted.
    Attached Images Attached Images

  6. #6
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Photoshop filter plug-in

    do u have any idea why it is hiding the menu in the first place?

  7. #7

    Default Re: Photoshop filter plug-in

    In the firs post I forgive one line
    Qt Code:
    1. char **argv = { 0 };
    2. (void) new QApplication(argc, argv);
    3. MainDialog *w = new MainDialog();
    4. w->setWindowFlags(Qt::WindowStaysOnTopHint);
    5. qApp->connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) );
    6. w->show();
    7. qApp->exec()
    To copy to clipboard, switch view to plain text mode 

    Another case is:
    Qt Code:
    1. char **argv = { 0 };
    2. (void) new QApplication(argc, argv);
    3. MainDialog *w = new MainDialog();
    4. w->setWindowFlags(Qt::WindowStaysOnTopHint);
    5. qApp->connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) );
    6. w->exec();
    To copy to clipboard, switch view to plain text mode 
    This code works like first case.

    Quote Originally Posted by talk2amulya View Post
    do u have any idea why it is hiding the menu in the first place?
    Modal dialog should block menu.

  8. #8
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Photoshop filter plug-in

    i dont think there is any plausible reason why dialog would hide the menu..have u written any specific code to do that

  9. #9

    Default Re: Photoshop filter plug-in

    Quote Originally Posted by talk2amulya View Post
    i dont think there is any plausible reason why dialog would hide the menu..have u written any specific code to do that
    In Mac OS X there is no separate menu for each window, like in Windows. Mac OS shows only menu for active window.

  10. #10
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Photoshop filter plug-in

    u r creating the QApplication variable on the heap but r not deleting it..also, check if there is no event loop running..i think ur application is not quitting properly because of which control is not going back to the main application, thus the menu doesnt show

  11. #11
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Photoshop filter plug-in

    Hi,

    the problem is - as talk2amulya says - in not destroying the dialog. The lastWindowClosed() isn't emitted because after exec() the dialog is just hidden not destroyed! So do
    Qt Code:
    1. (void) new QApplication(argc, argv);
    2. qApp->connect( qApp, SIGNAL( lastWindowClosed() ), qApp, SLOT( quit() ) );
    3. MainDialog *w = new MainDialog();
    4. w->setWindowFlags(Qt::WindowStaysOnTopHint);
    5. if (QDialog::Accepted == w->exec())
    6. {
    7. // do your stuff
    8. }
    9. w->close();
    To copy to clipboard, switch view to plain text mode 

    should solve your problem.

    Lykurg

  12. #12

    Default Re: Photoshop filter plug-in

    I close window on button click event:

    Qt Code:
    1. void MainDialog::on_pushButton_clicked()
    2. {
    3. this->close();
    4. }
    To copy to clipboard, switch view to plain text mode 

    It doesn't work.
    Your code works like mine.

  13. #13
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Photoshop filter plug-in

    i still hv one issue with what u r doing.. u r creating the QApplication object on a heap(i've never seen anyone do that)..where r u deleting it?i m sure the application isnt closing properly..or thru sm other way, the focus is STILL not returning back to Photoshop..there is ur issue..lookin at what u've given us

  14. #14

    Default Re: Photoshop filter plug-in

    Quote Originally Posted by talk2amulya View Post
    i still hv one issue with what u r doing.. u r creating the QApplication object on a heap(i've never seen anyone do that)..where r u deleting it?i m sure the application isnt closing properly..or thru sm other way, the focus is STILL not returning back to Photoshop..there is ur issue..lookin at what u've given us
    This code work propertly on Win XP.
    You want to tell me, that I should do something like that:
    Qt Code:
    1. qApp->quit();
    2. delete qApp;
    To copy to clipboard, switch view to plain text mode 
    ? This code doesn't work too.

  15. #15
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Photoshop filter plug-in

    ok, one last thing

    Qt Code:
    1. w->setWindowFlags(Qt::WindowStaysOnTopHint);
    To copy to clipboard, switch view to plain text mode 

    try to remove this flag..i know what its purpose is..but just try it..i dunno what else could be done to resolve ur issue

  16. #16

    Default Re: Photoshop filter plug-in

    Quote Originally Posted by talk2amulya View Post
    ok, one last thing

    Qt Code:
    1. w->setWindowFlags(Qt::WindowStaysOnTopHint);
    To copy to clipboard, switch view to plain text mode 

    try to remove this flag..i know what its purpose is..but just try it..i dunno what else could be done to resolve ur issue
    I tryed.
    If I use qApp->exec() or w->exec() i take problem with menu. Elsewere dialog box closes immediatly after it shows.

  17. #17

    Default Re: Photoshop filter plug-in

    Has anyone another ideas?

  18. #18
    Join Date
    Aug 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Photoshop filter plug-in

    Hi, and now I also get stuck to the same problem as yours. Have you had any solution so far? Please kindly help. Thanks a lot.

  19. #19
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: Photoshop filter plug-in

    Hello,

    i'm also interessted on this solution.

    Best Regards
    NoRulez

  20. #20

    Default Re: Photoshop filter plug-in

    Add this line just after you create QApplication:
    qApp->setAttribute(Qt::AA_MacPluginApplication,true);

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.