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. OSX Service and QApplication::macEventFilter()
Qt 6.11 is out! See what's new in the release blog

OSX Service and QApplication::macEventFilter()

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.4k 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.
  • S Offline
    S Offline
    SquimbellyToes
    wrote on last edited by
    #1

    Hello Folks;

    I'm relatively new to QT and am developing a QT application for OSX that I wish to respond to a custom service invoked on a file. However, I'm not clear on how to implement this and would be very grateful for any knowledge or advice you might be able to offer.

    Here's an example of what I need to accomplish:

    1. The QT application, "MyApplication.app" is started. It has no UI to interact with.

    2. The user right-clicks on a file somewhere on the file system. For sake of this example, let's say it's /Users/Bob/Desktop/MyGroceryList.txt.
      On the context menu they see a custom Service (that lives in /System/Library/Services), that will notify MyApplication.app of an operation to perform on /Users/Bob/Desktop/MyGroceryList.txt. A good example of the type of action to be performed would be adding the path of /Users/Bob/Desktop/MyGroceryList.txt to an XML file.

    3. MyApplication.app is notified of the request, via the Service, performs the requested operation, and notifies the user that the operation has completed.

    I've looked at the d-bus implementation included with QT, but including d-bus with my custom application is not straight-forward - my target users will not be amenable to compiling and installing it.

    I see that QApplication::macEventFilter() may offer some hope (please see http://portal.nersc.gov/svn/visit/trunk/src/gui/QvisApplication.C), but I'm not clear on how one would raise an event to be consumed on the invocation of my custom Service.

    Might anyone have some advice on how I might proceed?

    Thank you very much,
    ST

    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